{"id":13566908,"url":"https://github.com/fp4ts/fp4ts","last_synced_at":"2026-05-30T11:03:24.242Z","repository":{"id":43068939,"uuid":"417510764","full_name":"fp4ts/fp4ts","owner":"fp4ts","description":"Zero-dependency, purely functional library for effectful programming in Typescript","archived":false,"fork":false,"pushed_at":"2023-06-05T14:39:09.000Z","size":9392,"stargazers_count":27,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T14:58:55.039Z","etag":null,"topics":["algebraic-effects","category-theory","functional-programming","higher-kinded-types","typelevel","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fp4ts.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}},"created_at":"2021-10-15T13:32:18.000Z","updated_at":"2025-03-25T19:13:08.000Z","dependencies_parsed_at":"2023-02-18T05:30:38.478Z","dependency_job_id":"3b6e99a7-f5b6-41e6-8eb5-498efb985611","html_url":"https://github.com/fp4ts/fp4ts","commit_stats":{"total_commits":1054,"total_committers":2,"mean_commits":527.0,"dds":0.000948766603415585,"last_synced_commit":"684fb93153118f09fdcdb57d0f382e9b68586cb4"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/fp4ts/fp4ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fp4ts%2Ffp4ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fp4ts%2Ffp4ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fp4ts%2Ffp4ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fp4ts%2Ffp4ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fp4ts","download_url":"https://codeload.github.com/fp4ts/fp4ts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fp4ts%2Ffp4ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33689565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":["algebraic-effects","category-theory","functional-programming","higher-kinded-types","typelevel","typescript"],"created_at":"2024-08-01T13:02:19.317Z","updated_at":"2026-05-30T11:03:24.205Z","avatar_url":"https://github.com/fp4ts.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# fp4ts\n\n[![Node.js CI](https://github.com/mattapet/fp4ts/actions/workflows/build.yml/badge.svg)](https://github.com/fp4ts/fp4ts/actions/workflows/build.yml)\n\n[![Publish Nightly](https://github.com/fp4ts/fp4ts/actions/workflows/publish-nightly.yml/badge.svg?branch=master)](https://github.com/fp4ts/fp4ts/actions/workflows/publish-nightly.yml)\n\n[![codecov](https://codecov.io/gh/fp4ts/fp4ts/branch/master/graph/badge.svg?token=wXOEoz3yOm)](https://codecov.io/gh/fp4ts/fp4ts)\n\nWelcome to fp4ts! Fp4ts is a zero-dependency, purely functional library that\nattempts to provide idiomatic support for lazy, safe, and performant functional\nprogramming in Typescript by porting a portion of the [Typelevel](https://typelevel.org/)\nand Haskell ecosystems.\n\n_The project is currently under development and is not intended to be used in\nproduction._\n\n## Project Structure\n\nFp4ts is fairly large and offers multiple packages:\n\n- `@fp4ts/core` The library implementing basic building blocks and utilities\nused across the rest of the packages, namely the HKT abstraction.\n\n- `@fp4ts/cats` Port of the [Cats](https://github.com/typelevel/cats) library\nproviding basic data types, collections and fundamental abstraction (e.g.,\nFunctor, Monad) used for functional programming. It also provides a set of laws,\nto verify correctness of those implementations.\n\n  - `@fp4ts/cats-kernel` Small set of basic types and type classes (_included_)\n  - `@fp4ts/cats-core` Majority of the type classes and basic data types (_included_) \n  - `@fp4ts/cats-laws` Laws for testing type class instances/implementations\n  - `@fp4ts/cats-profunctor` Profunctor type classes, data type, and instances for core types\n  - `@fp4ts/cats-profunctor-laws` Laws for testing profunctor type classes\n  - `@fp4ts/cats-arrow` Arrow type classes, data type, and instances for core types\n  - `@fp4ts/cats-arrow-laws` Laws for testing arrow type classes\n  - `@fp4ts/cats-test-kit` Jest integration for testing type class instances and collection of builtin arbitraries for provided data types\n  - `@fp4ts/free` Free structures\n\n\n- `@fp4ts/collections` Basic collections such as `List`, `LazyList`, `OrdMap`,\nand `OrdSet`.\n\n  - `@fp4ts/collections-core` Implementation of the collection data types (_included_)\n  - `@fp4ts/collections-test-kit` Set of `fast-check` arbitraries for the collections.\n\n\n- `@fp4ts/mtl` Monad Transformer Library\n\n  - `@fp4ts/mtl-core` Set of type classes and transformer data types (_included_)\n  - `@fp4ts/mtl-laws` Set of laws for testing monad transformer implementations\n\n\n- `@fp4ts/effect` Port of the [Cats Effect](https://github.com/typelevel/cats-effect)\nlibrary providing data types, fundamental abstraction (e.g., MonadCancel, Async)\nused for effectful and async functional programming. It also provides a set of\nlaws, to verify correctness of those implementations.\n\n  - `@fp4ts/effect-kernel` Set of type classes for describing effectful computations/data types (_included_)\n  - `@fp4ts/effect-core` Implementations of the `IO` and `SyncIO` data types (_included_)\n  - `@fp4ts/effect-std` Implementations of the standard effectful data types such as `Queue` or `Semaphore` (_included_)\n  - `@fp4ts/effect-laws` Laws for testing type class instances/implementations\n  - `@fp4ts/effect-test-kit` Jest integration for testing type class instances and collection of builtin arbitraries for provided data types\n\n- `@fp4ts/fused` Partial port of the [fused-effects](https://hackage.haskell.org/package/fused-effects) providing algebraic, higher-order, extensible effects with a standard library compatible with `@fp4ts/cats-mtl`.\n\n  - `@fp4ts/fused-kernel` Set of type classes and primitives for defining effect carriers as well as interpreters (_included_)\n  - `@fp4ts/fused-core` Definition of standard effect types (_included_)\n  - `@fp4ts/fused-std` Library of standard effect carriers using `@fp4ts/cats-mtl` (_included_)\n\n- `@fp4ts/http` Port of the [http4s](https://github.com/http4s/http4s) library,\nproviding minimal functional interface for building HTTP services. In addition\nto the http4s, this port also includes [Servant](https://haskell-servant.github.io/)-like [dsl](./packages/http/dsl) for API declaration.\n\n  - `@fp4ts/http-core` Implementation of the basic data types for building HTTP services, such as `Request\u003cF\u003e`, `Response\u003cF\u003e`, and more (_included_)\n  - `@fp4ts/http-client` Definition of the `Client\u003cF\u003e` type and its default implementation\n  - `@fp4ts/http-server` Definition of the `Server\u003cF\u003e` type and a set of middlewares\n  - `@fp4ts/dsl` Servant-like library for defining APIs\n  - `@fp4ts/dsl-client` Derivation of the clients for APIs defined using `@fp4ts/dsl`\n  - `@fp4ts/dsl-server` Derivation of the servers for APIs defined using `@fp4ts/dsl`\n  - `@fp4ts/node-client` Node.js bindings for the HTTP clients\n  - `@fp4ts/node-server` Node.js bindings for the HTTP servers\n  - `@fp4ts/test-kit` Library for testing HTTP services and clients\n  - `@fp4ts/test-kit-node` Node bindings for testing HTTP services and clients\n\n\n- `@fp4ts/logging` Logging library inspired by [log4cats](https://github.com/typelevel/log4cats),\n[purescript-logging](https://github.com/rightfold/purescript-logging),\nand [zio-logging](https://github.com/zio/zio-logging). The library provides\nbrackets using `Writer`, `WriterT` and `Console` type classes.\n\n  - `@fp4ts/logging-kernel` Set of type classes and default implementation for logging (_included_)\n  - `@fp4ts/logging-core` Implementation for standard loggers (_included_)\n\n\n- `@fp4ts/optics` Port of the [lens](https://github.com/ekmett/lens) library,\na Haskell optics library providing families of lenses, isomorphisms, folds, traversals, setters, and getters.\n\n  - `@fp4ts/optics-core` Implementation of the common regular, index preserving and indexed optics (_included_)\n  - `@fp4ts/optics-derivation` Binding for deriving common optics from `@fp4ts/schema` definitions (_included_)\n  - `@fp4ts/optics-std` Implementation of standard optics (_included_)\n  - `@fp4ts/optics-laws` Set of laws to verify properties of the optics\n\n\n- `@fp4ts/parse` Adaptation of the [Parsec](https://hackage.haskell.org/package/parsec-3.1.15.0/docs/Text-Parsec.html) library,\na parser combinator library with polymorphic input and evaluation effect type.\nBy default, the library provides tools for text parsing. Parsec was chosen instead\nof the [cats-parse](https://github.com/typelevel/cats-parse/) existing in the Typelevel\necosystem for the simplicity of the implementation, support for polymorphic input types\nand contrary to the decision made in cats-pase, unification of parsers guaranteed\nto consume input and ones that do not.\n\n  - `@fp4ts/prase-kernel` Type classes for defining tokens and streams of values (_included_)\n  - `@fp4ts/parse-core` Implementation of the parse and its default combinators (_included_)\n  - `@fp4ts/parse-text` Implementation of the text-parses and helpers for their usage (_included_)\n\n\n- `@fp4ts/schema` The library for describing types of Kind-0 and Kind-1, with\nderivation capabilities for common typeclasses such as `Eq`, `Functor`, `Foldable`, and more.\nInspired by [io-ts](https://github.com/gcanti/io-ts), [shapeless](https://github.com/milessabin/shapeless), and [kittens](https://github.com/typelevel/kittens).\n\n  - `@fp4ts/schema-kernel` Type classes for describing types for derivations of Kind-0 and Kind-1 types (_included_)\n  - `@fp4ts/schema-core` Derivable data types for validation, encoding and decoding of types (_included_)\n  - `@fp4ts/schema-derivation` Derivation of data type constructors (_included_)\n  - `@fp4ts/schema-json` JSON-specific encoders and decoders\n  - `@fp4ts/schema-laws` Set of laws for codable data types\n  - `@fp4ts/schema-test-kit` Set of arbitraries for testing schemable types\n\n\n- `@fp4ts/sql` Partial port of the [doobie](https://github.com/tpolecat/doobie) library\nproviding functional interface for SQL databases.\n\n  - `@fp4ts/sql-core` Core data types for describing communication with RDMS (_included_)\n  - `@fp4ts/sql-mariadb` Driver for MariaDB\n  - `@fp4ts/sql-pg` Driver for Postgres\n  - `@fp4ts/sql-sqlite` Driver for SQLite\n\n\n- `@fp4ts/stream` Port of the [FS2](https://github.com/typelevel/fs2) library\nfor purely functional, effect-ful, and polymorphic stream processing.\n\n  - `@fp4ts/stream-core` Definition of basic `Stream`, `Pull` and `Chunk` types, and related type classes for compiling the effectful streams (_included_)\n  - `@fp4ts/stream-io` Node.js interop providing bindings for `Readable`, `Writable` and console IO\n\nEach of the listed packages is released separately. However, packages which are\nmarked as _included_ can be consumed by installing the root module. For example,\nfor consuming anything from `@fp4ts/cats-kernel` or `@fp4ts/cats-core` one can\njust install `@fp4ts/cats` and:\n\n```typescript\nimport { Ord, None, Some } from '@fp4ts/cats';\nimport { OrdMap } from '@fp4ts/collections';\n\nconst xs: [string, number][] = [['a', 42], ['b', 43]];\nconst x: OrdMap\u003cstring, string\u003e = OrdMap\n  .fromArray(xs, Ord.fromUniversalCompare())\n  .collect(v =\u003e v % 2 === 0 ? Some(`${v}`) : None)\n\n...\n```\n\n### Versioning\n\nAs the project is under development and not intended to be used in production,\n_all_ of the packages are versioned as `0.0.x` without _any_ API stability guarantees.\n\n## Examples\n\n- John De Goes' [FP to the Max](./packages/examples/fp-to-the-max/src/program.ts)\n- [Todo API](./packages/examples/todo-api/) implemented using the [Servant-style\nAPI dsl](./packages/examples/todo-api/src/api)\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2021-2023 Peter Matta.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n```\n\nThe full license with all references to ported projects can be found in [LICENSE](/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffp4ts%2Ffp4ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffp4ts%2Ffp4ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffp4ts%2Ffp4ts/lists"}