{"id":18053412,"url":"https://github.com/williamareynolds/ts-cat","last_synced_at":"2025-04-10T19:43:08.578Z","repository":{"id":44019789,"uuid":"231262744","full_name":"williamareynolds/ts-cat","owner":"williamareynolds","description":"A static-land and fantasy-land compliant library containing interfaces for common type-classes and common instances of them.","archived":false,"fork":false,"pushed_at":"2022-12-10T13:36:56.000Z","size":747,"stargazers_count":7,"open_issues_count":24,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-24T17:21:23.635Z","etag":null,"topics":["applicative","category-theory","fantasy-land","fantasy-land-spec","functor","higher-kinded-types","maybe","maybe-monad","monad","static-land","static-land-spec","type-classes","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"https://williamareynolds.github.io/ts-cat/","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/williamareynolds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-01T20:51:05.000Z","updated_at":"2023-03-22T14:08:00.000Z","dependencies_parsed_at":"2023-01-26T07:45:44.538Z","dependency_job_id":null,"html_url":"https://github.com/williamareynolds/ts-cat","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamareynolds%2Fts-cat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamareynolds%2Fts-cat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamareynolds%2Fts-cat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamareynolds%2Fts-cat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/williamareynolds","download_url":"https://codeload.github.com/williamareynolds/ts-cat/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281424,"owners_count":21077423,"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":["applicative","category-theory","fantasy-land","fantasy-land-spec","functor","higher-kinded-types","maybe","maybe-monad","monad","static-land","static-land-spec","type-classes","typescript","typescript-library"],"created_at":"2024-10-30T23:17:20.552Z","updated_at":"2025-04-10T19:43:08.556Z","avatar_url":"https://github.com/williamareynolds.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-cat\n\n[![Build Status](https://travis-ci.org/williamareynolds/ts-cat.svg?branch=master)](https://travis-ci.org/williamareynolds/ts-cat)\n[![Coverage Status](https://coveralls.io/repos/github/williamareynolds/ts-cat/badge.svg?branch=master)](https://coveralls.io/github/williamareynolds/ts-cat?branch=master)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f8a3e86101d4442fb8c6bace12318f09)](https://www.codacy.com/manual/williamareynolds/ts-cat?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=williamareynolds/ts-cat\u0026utm_campaign=Badge_Grade)\n[![npm version](https://badge.fury.io/js/ts-cat.svg)](https://badge.fury.io/js/ts-cat)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nA static-land and fantasy-land compliant library containing interfaces for common type-classes and\ncommon instances of them.\n\nThis library is currently in very active development. Be aware that changes will be frequent, but\nthat breaking changes will always incur a major version change.\n\n## Limitations\n\n### Static Interfaces\n\nBe aware that Typescript simply does not support some typing behaviors that would make some things\nwork as expected. The most serious of these issues is that static methods cannot be specified in\ninterfaces. This means that a fantasy-land compliant interface for Applicative cannot be properly\ncreated because `of` can't be enforced as a class method. There is currently an open issue for this\n[here][ts-static-interface].\n\n### Static Types\n\nstatic-land implementations are limited in their ability to properly type results. This appears to\nbe an issue with typescript, rather than an issue with the implementation. Considering the following\ndemonstration with `Identity\u003cnumber\u003e`:\n\n```typescript\nimport { identity } from './src/instance/Identity'\n\nconst sample = identity.of(5)\nconst mapped = identity.map(a =\u003e a + 5, sample)\n```\n\nIn this case, typescript may think the type of `mapped` is `Identity\u003cany\u003e`, even though it's actually\n`Identity\u003cnumber\u003e`. If we move the static functions from the `identity` object to the `Identity`\nclass as static functions, the type issues are resolved. Unfortunately, we would have to define\nthose static functions on the class, rather than setting them equal to the functions from the\n`identity` object. Due to Typescript's lack of static interface declarations, this causes us to\nlose the value of having an interface for the static functions.\n\n## Documentation\n\n[fantasy-land][fantasy-land-doc]\n\n[static-land][static-land-doc]\n\n[Theory and Usage][theory-doc]\n\n[API Docs][api-doc]\n\n[api-doc]: https://williamareynolds.github.io/ts-cat/\n\n[fantasy-land-doc]: https://github.com/fantasyland/fantasy-land\n\n[static-land-doc]: https://github.com/fantasyland/static-land\n\n[theory-doc]: https://github.com/williamareynolds/ts-cat/wiki\n\n[ts-static-interface]: https://github.com/microsoft/TypeScript/issues/33892\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamareynolds%2Fts-cat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamareynolds%2Fts-cat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamareynolds%2Fts-cat/lists"}