{"id":26025419,"url":"https://github.com/lagunoff/typescript-concrete-optics","last_synced_at":"2026-06-04T17:31:50.251Z","repository":{"id":40797525,"uuid":"204696267","full_name":"lagunoff/typescript-concrete-optics","owner":"lagunoff","description":"Very basic concrete optics in typescript","archived":false,"fork":false,"pushed_at":"2022-12-10T00:10:32.000Z","size":103,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-08T14:40:37.965Z","etag":null,"topics":["functional-programming","lens","lenses","optics","prism","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lagunoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-27T12:16:45.000Z","updated_at":"2020-06-07T20:54:29.000Z","dependencies_parsed_at":"2023-01-26T00:32:33.010Z","dependency_job_id":null,"html_url":"https://github.com/lagunoff/typescript-concrete-optics","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagunoff%2Ftypescript-concrete-optics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagunoff%2Ftypescript-concrete-optics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagunoff%2Ftypescript-concrete-optics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lagunoff%2Ftypescript-concrete-optics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lagunoff","download_url":"https://codeload.github.com/lagunoff/typescript-concrete-optics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242220466,"owners_count":20091788,"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":["functional-programming","lens","lenses","optics","prism","typescript"],"created_at":"2025-03-06T13:39:38.952Z","updated_at":"2026-06-04T17:31:50.247Z","avatar_url":"https://github.com/lagunoff.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Generic badge](https://img.shields.io/badge/status-experimental-red.svg)](https://shields.io/)\n## Installation\n```sh\n$ yarn add typescript-concrete-optics\n\n```\n## API reference\n#### compose\n\n`function compose\u003cA, B, C\u003e(left: Lens\u003cA, B\u003e, right: Lens\u003cB, C\u003e): Lens\u003cA, C\u003e;\nfunction compose\u003cA, B, C\u003e(left: Prism\u003cA, B\u003e, right: Prism\u003cB, C\u003e): Prism\u003cA, C\u003e;\nfunction compose\u003cA, B, C\u003e(left: Iso\u003cA, B\u003e, right: Iso\u003cB, C\u003e): Iso\u003cA, C\u003e;\nfunction compose\u003cA, B, C\u003e(left: Iso\u003cA, B\u003e, right: Lens\u003cB, C\u003e): Lens\u003cA, C\u003e;\nfunction compose\u003cA, B, C\u003e(left: Lens\u003cA, B\u003e, right: Iso\u003cB, C\u003e): Lens\u003cA, C\u003e;\nfunction compose\u003cA, B, C\u003e(left: Iso\u003cA, B\u003e, right: Prism\u003cB, C\u003e): Prism\u003cA, C\u003e;\nfunction compose\u003cA, B, C\u003e(left: Prism\u003cA, B\u003e, right: Iso\u003cB, C\u003e): Prism\u003cA, C\u003e;\nfunction compose\u003cA, B, C\u003e(left: Optic\u003cA, B\u003e, right: Optic\u003cB, C\u003e): Optic\u003cA, C\u003e;\nfunction compose\u003cR extends Optic\u003cany, any\u003e\u003e(...args: Array\u003cOptic\u003cany, any\u003e\u003e): R;`\n\nCompose several different optics. Function can receive one or more\narguments with type-aligned `Optic`s, but type signatures exist\nonly for two parameters.\n\n```ts\nconst lens = optics.identityLens();\nconst prism = optics.identityPrism();\nconst iso = optics.identityIso();\n\nassert.isTrue(optics.isLens(optics.compose(lens, lens)));\nassert.isTrue(optics.isPrism(optics.compose(prism, prism)));\nassert.isTrue(optics.isIso(optics.compose(iso, iso)));\nassert.isTrue(optics.isLens(optics.compose(iso, lens)));\nassert.isTrue(optics.isPrism(optics.compose(iso, prism)));\nassert.isTrue(optics.isCompose(optics.compose(lens, prism)));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flagunoff%2Ftypescript-concrete-optics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flagunoff%2Ftypescript-concrete-optics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flagunoff%2Ftypescript-concrete-optics/lists"}