{"id":19758072,"url":"https://github.com/paurkedal/ppx_compose","last_synced_at":"2025-09-14T04:28:05.276Z","repository":{"id":136457585,"uuid":"85249195","full_name":"paurkedal/ppx_compose","owner":"paurkedal","description":"Composition Inlining for OCaml","archived":false,"fork":false,"pushed_at":"2021-10-12T19:41:45.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T09:23:48.406Z","etag":null,"topics":["combinator","function-composition","ocaml","optimization","ppx-rewriter"],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paurkedal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-16T23:03:36.000Z","updated_at":"2021-10-12T19:41:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"273ea4f5-429d-491e-b0f5-23743243d8cb","html_url":"https://github.com/paurkedal/ppx_compose","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/paurkedal/ppx_compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paurkedal%2Fppx_compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paurkedal%2Fppx_compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paurkedal%2Fppx_compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paurkedal%2Fppx_compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paurkedal","download_url":"https://codeload.github.com/paurkedal/ppx_compose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paurkedal%2Fppx_compose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275062764,"owners_count":25398885,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["combinator","function-composition","ocaml","optimization","ppx-rewriter"],"created_at":"2024-11-12T03:22:48.828Z","updated_at":"2025-09-14T04:28:05.231Z","avatar_url":"https://github.com/paurkedal.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/paurkedal/ppx_compose.svg?branch=master)](https://travis-ci.org/paurkedal/ppx_compose)\n\n## `ppx_compose` - Inlined Function Composition\n\n`ppx_compose` is a simple syntax extension which rewrites code containing\nfunction compositions into composition-free code, effectively inlining the\ncomposition operators.  The following two operators are supported\n```ocaml\nlet (%) g f x = g (f x)\nlet (%\u003e) f g x = g (f x)\n```\nCorresponding definitions are not provided, so partial applications of `(%)`\nand `(%\u003e)` will be undefined unless you provide the definitions.\n\nThe following rewrites are done:\n\n  * A composition occurring to the left of an application is reduced by\n    applying each term of the composition from right to left to the\n    argument, ignoring associative variations.\n\n  * A composition which is not the left side of an application is first\n    turned into one by η-expansion, then the above rule applies.\n\n  * Any partially applied composition operators are passed though unchanged.\n\nE.g.\n```ocaml\nh % g % f ==\u003e (fun x -\u003e h (f (g x)))\nh % (g % f) ==\u003e (fun x -\u003e h (f (g x)))\n(g % f) (h % h) ==\u003e g (f (fun x -\u003e h (h x)))\n```\n\n### Is It Needed?\n\nRecent flambda-enabled compilers can inline the following alternative\ndefinitions of the composition operators [[1]]:\n```ocaml\nlet (%) g f = (); fun x -\u003e g (f x)\nlet (%\u003e) f g = (); fun x -\u003e g (f x)\n```\nso this syntax extension will likely be retired at some point.\n\n[1]: https://discuss.ocaml.org/t/ann-ppx-compose-0-0-3/345\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaurkedal%2Fppx_compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaurkedal%2Fppx_compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaurkedal%2Fppx_compose/lists"}