{"id":19715671,"url":"https://github.com/pyx/fx","last_synced_at":"2026-05-12T08:34:05.357Z","repository":{"id":4777068,"uuid":"5928911","full_name":"pyx/fx","owner":"pyx","description":"an approach to coding higher-order functions","archived":false,"fork":false,"pushed_at":"2014-06-20T21:46:19.000Z","size":195,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-10T15:18:11.693Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/fx/","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyx.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-24T02:57:46.000Z","updated_at":"2014-06-20T21:46:19.000Z","dependencies_parsed_at":"2022-09-21T00:42:40.104Z","dependency_job_id":null,"html_url":"https://github.com/pyx/fx","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyx%2Ffx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyx%2Ffx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyx%2Ffx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyx%2Ffx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyx","download_url":"https://codeload.github.com/pyx/fx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241036334,"owners_count":19898145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T22:39:07.172Z","updated_at":"2026-05-12T08:34:00.337Z","avatar_url":"https://github.com/pyx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"======================================\nfx - a functional programming approach\n======================================\n\n::\n\n   ___\n  |  _|_ _\n  |  _|_'_|\n  |_| |_,_|igher-order function coding.\n\n\nIntroduction\n============\n\n**TL;DR - YAGNI.**\n\nInspired by `Haskell \u003chttp://www.haskell.org/\u003e`_'s rich set of operators,\nthis is an approach to functional programming with operators in `Python \u003chttp://www.python.org/\u003e`_.\n\n  \"It's fun... It's insane... It's insanely fun.\"\n\n  -- John Doe\n\n\nFeatures\n--------\n\n- Currying functions with ``\u003c\u003c``, ``\u0026``\n- Piping output of functions with ``|``\n- Composing functions with ``**``\n- Flipping order of arguments of function with ``~``\n- and more\n\n\nExamples\n--------\n\n::\n\n  \u003e\u003e\u003e from fx import f\n  \u003e\u003e\u003e double_all = f(map) \u003c\u003c 2 .__mul__ | list\n  \u003e\u003e\u003e double_all([1, 2, 3])\n  [2, 4, 6]\n  \u003e\u003e\u003e double_all |= f(map) \u003c\u003c str | ' '.join\n  \u003e\u003e\u003e double_all([1, 2, 3])\n  '2 4 6'\n  \u003e\u003e\u003e sum_upto = 1 .__add__ | f(range) \u003c\u003c 1 | sum\n  \u003e\u003e\u003e sum_upto(100)\n  5050\n  \u003e\u003e\u003e parse_hex_str = ~f(int) \u003c\u003c 16\n  \u003e\u003e\u003e parse_hex_str('ff')\n  255\n  \u003e\u003e\u003e parse_hex_str('c0ffee')\n  12648430\n  \u003e\u003e\u003e # project euler problem 1\n  \u003e\u003e\u003e euler_p1 = f(range) \u003c\u003c 1 | f(filter) \u003c\u003c (lambda n: n % 3 == 0 or n % 5 == 0) | sum\n  \u003e\u003e\u003e euler_p1(10)\n  23\n  \u003e\u003e\u003e euler_p1(1000)\n  233168\n  \u003e\u003e\u003e # project euler problem 20\n  \u003e\u003e\u003e fact = f(lambda n: 1 if n == 1 else n * fact(n - 1))\n  \u003e\u003e\u003e euler_p20 = str ** fact | sum ** f(map) \u003c\u003c int\n  \u003e\u003e\u003e euler_p20(10)\n  27\n  \u003e\u003e\u003e euler_p20(100)\n  648\n\n\nRequirements\n============\n\n- CPython \u003e= 2.6\n\n\nInstallation\n============\n\nInstall from PyPI::\n\n  pip install fx\n\nInstall from source, download source package, decompress, then ``cd`` into source directory, run::\n\n  make install\n\n\nLicense\n=======\n\nBSD New, see LICENSE for details.\n\n\nLinks\n=====\n\nDocumentation:\n  http://fx.readthedocs.org/\n\nIssue Tracker:\n  https://bitbucket.org/pyx/fx/issues/\n\nSource Package @ PyPI:\n  http://pypi.python.org/pypi/fx/\n\nMercurial Repository @ bitbucket:\n  https://bitbucket.org/pyx/fx/\n\nGit Repository @ Github:\n  https://github.com/pyx/fx/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyx%2Ffx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyx%2Ffx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyx%2Ffx/lists"}