{"id":16488808,"url":"https://github.com/austindd/reason-arrow","last_synced_at":"2026-03-07T04:01:21.979Z","repository":{"id":128179670,"uuid":"314077376","full_name":"austindd/reason-arrow","owner":"austindd","description":"Stack-safe function composition in ReasonML/ReScript","archived":false,"fork":false,"pushed_at":"2020-11-23T19:36:18.000Z","size":50,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T04:23:49.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Reason","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/austindd.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-18T22:49:41.000Z","updated_at":"2021-03-15T16:28:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"d589f596-c079-4e74-8ce7-84de3f99dc80","html_url":"https://github.com/austindd/reason-arrow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/austindd/reason-arrow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austindd%2Freason-arrow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austindd%2Freason-arrow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austindd%2Freason-arrow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austindd%2Freason-arrow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austindd","download_url":"https://codeload.github.com/austindd/reason-arrow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austindd%2Freason-arrow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30207389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-11T13:39:59.585Z","updated_at":"2026-03-07T04:01:21.955Z","avatar_url":"https://github.com/austindd.png","language":"Reason","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reason-arrow\nStack-safe function composition in ReasonML/ReScript\n\n## Usage\n\nUse `Arrow` to compose functions lazily, while also maintaining stack safety, no matter how many functions you compose.\n\n```reason\nlet add = (a, b) =\u003e a + b;\nlet sub = (a, b) =\u003e a - b;\nlet mul = (a, b) =\u003e a * b;\nlet div = (a, b) =\u003e a / b;\n\n// myArrow: Arrow.t(int, int);\nlet myArrow = Arrow.({\n  pure(add(_, 4))\n    -\u003epipeR(mul(_, 3))\n    -\u003epipeR(sub(_, 4))\n    -\u003epipeR(div(_, 1))\n});\n\n// ((((0 + 4) * 3) - 4) / 1) = 8\nlet result = Arrow.runF(myArrow, 0);\n```\n\nWe get nice abstractions over lazy function composition. Here is an example of using `pipeR` with `map`:\n\n```reason\nlet addFloat = (a, b) =\u003e a +. b;\nlet subFloat = (a, b) =\u003e a -. b;\nlet mulFloat = (a, b) =\u003e a *. b;\nlet divFloat = (a, b) =\u003e a /. b;\n\n// useIntegersInstead: (float =\u003e float) =\u003e (int =\u003e int)\nlet useIntegersInstead = (fn, a) =\u003e fn(float_of_int(a))-\u003eint_of_float;\n\n// myArrow: Arrow.t(int, int)\nlet myArrow = Arrow.({\n  pure(addFloat(_, 4.))\n    -\u003epipeR(mulFloat(_, 3.))\n    -\u003epipeR(subFloat(_, 4.))\n    -\u003epipeR(divFloat(_, 1.))\n    -\u003emap(_, useIntegersInstead(_))\n});\n\nlet result = Arrow.runF(myArrow, 0); // 8\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustindd%2Freason-arrow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustindd%2Freason-arrow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustindd%2Freason-arrow/lists"}