{"id":28241007,"url":"https://github.com/richecr/holo-fn","last_synced_at":"2025-06-11T20:30:59.963Z","repository":{"id":288534967,"uuid":"967146516","full_name":"richecr/holo-fn","owner":"richecr","description":"A minimal functional library for TypeScript featuring monads like Maybe, Either and Result. Built for composability and Rambda compatibility.","archived":false,"fork":false,"pushed_at":"2025-05-25T23:35:07.000Z","size":787,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-27T15:11:25.904Z","etag":null,"topics":["either-monad","functional-programming","maybe-monad","monads","result-pattern","typescript"],"latest_commit_sha":null,"homepage":"https://richecr.github.io/holo-fn/","language":"TypeScript","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/richecr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2025-04-16T02:15:50.000Z","updated_at":"2025-05-25T23:17:35.000Z","dependencies_parsed_at":"2025-04-18T17:24:06.742Z","dependency_job_id":"80ff1418-1e82-41db-ab78-e80a256eee06","html_url":"https://github.com/richecr/holo-fn","commit_stats":null,"previous_names":["richecr/holo-fn"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/richecr/holo-fn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fholo-fn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fholo-fn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fholo-fn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fholo-fn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richecr","download_url":"https://codeload.github.com/richecr/holo-fn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richecr%2Fholo-fn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259334608,"owners_count":22842466,"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":["either-monad","functional-programming","maybe-monad","monads","result-pattern","typescript"],"created_at":"2025-05-19T04:12:46.418Z","updated_at":"2025-06-11T20:30:59.957Z","avatar_url":"https://github.com/richecr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 holo-fn\n![npm](https://img.shields.io/npm/v/holo-fn?style=flat-square)\n![types](https://img.shields.io/npm/types/holo-fn?style=flat-square)\n![license](https://img.shields.io/npm/l/holo-fn?style=flat-square)\n![tests](https://img.shields.io/badge/tests-passing-green?style=flat-square)\n![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen?style=flat-square)\n\n**A minimal functional library for TypeScript** featuring **monads** like `Maybe`, `Either` and `Result`. Built for composability and Rambda compatibility.\n\n\u003e 💡 Designed to work seamlessly with `pipe` from Rambda. Fully typed, immutable, and safe by default.\n\n---\n\n## ✨ Features\n\n- ✅ Functional types: `Maybe`, `Either`, `Result`\n- ⚙️ Pipe-friendly (Rambda/Ramda compatible)\n- 🔒 Immutable by default\n- 🧪 100% test coverage\n- ⚡️ Zero dependencies\n- 🧠 Full TypeScript inference\n\n---\n\n## 🚀 Installation\n\n```bash\nnpm install holo-fn\n```\n\n---\n\n## 📦 API Overview\n\n[API documentation can be found here](https://richecr.github.io/holo-fn/)\n\n## 🧠 Examples\n\n### Safe object access\n\n```ts\nimport { fromNullable, match } from 'holo-fn/maybe';\n\nconst double = (n: number) =\u003e n * 2;\n\nconst result = pipe(\n  [5, 5, 6],\n  (ns) =\u003e fromNullable(head(ns)),\n  (x) =\u003e x.map(double),\n  match({\n    just: (n) =\u003e n,\n    nothing: () =\u003e -1\n  })\n);\n\nconsole.log(result); // 10\n```\n\n### Optional parsing\n\n```ts\nimport { fromNullable } from 'holo-fn/maybe';\n\nconst parsePrice = (input: string) =\u003e\n  fromNullable(parseFloat(input))\n    .map(n =\u003e (n \u003e 0 ? n : null))\n    .chain(fromNullable)\n    .unwrapOr(0)\n\nconsole.log(parsePrice('123.45')) // 123.45\nconsole.log(parsePrice('0')) // 0\nconsole.log(parsePrice('-123.45')) // 0\nconsole.log(parsePrice('abc')) // 0\n```\n\n---\n\n## Changelog\n\nAll notable changes to this project will be documented in [here](https://richecr.github.io/holo-fn/changelog).\n\n## 🤝 Contributing\n\nPlease refer to [CONTRIBUTING.md](https://richecr.github.io/holo-fn/contributing) for instructions on how to run tests, build the library, and contribute.\n\n## 📜 License\n\n[Here license MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichecr%2Fholo-fn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichecr%2Fholo-fn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichecr%2Fholo-fn/lists"}