# gcanti/fp-ts

Functional programming in TypeScript

Repository: https://github.com/gcanti/fp-ts
Canonical: https://ross.abutalabs.com/products/fp-ts
Homepage: https://gcanti.github.io/fp-ts/
Language: TypeScript
License: MIT
License Family: permissive
Topics: typescript, functional-programming, algebraic-data-types
Last push: 2026-04-20T19:55:05+00:00

## Health v2 (maintenance only)
Score: 58/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 78, release rhythm 8, longevity 100
- inputs: {"age_days": 3507, "days_push": 135, "days_rel": 631, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 11540, forks 510 (observed 2026-08-28T04:10:48.545015+00:00)

## What it is
fp-ts is a library for typed functional programming in TypeScript, providing popular data types (Option, Either, IO, Task), type classes (Functor, Applicative, Monad), and abstractions inspired by Haskell, PureScript, and Scala. It implements Higher Kinded Types, which TypeScript does not support natively, enabling pure functional programming with composable higher-order abstractions.

## Use cases
- write pure functional code in TypeScript
- handle errors and null values with Option and Either instead of exceptions
- compose async operations with Task and IO monads
- use functional type classes like Functor, Applicative, and Monad in TypeScript
- model domain logic with algebraic data types
- learn functional programming patterns from Haskell and Scala in a TypeScript setting

## When to choose
- you want typed functional programming abstractions in an existing TypeScript codebase
- you prefer explicit error handling with Option/Either over exceptions and nulls
- you need composable, law-abiding abstractions rooted in category theory
- you are already familiar with FP concepts from Haskell, PureScript, or Scala

## When to avoid
- you are starting a new project - Effect-TS is the official successor and offers more features
- your team does not already know functional programming - the docs assume FP knowledge
- you need stack-safe recursion everywhere - data types are not stack safe and there is no trampolining
- you want a batteries-included framework rather than a library of abstractions

## Facets
- artifact type: library
- maturity: maintenance
- function: serialization, error-handling, developer-tools
- domain: developer-tools, programming-languages, web-development, frontend, backend
- platform: cross-platform, browser
- tags: functional-programming, typescript, algebraic-data-types, type-classes, monads, option, either, higher-kinded-types, pure-functions, category-theory, nodejs, web-server

## Member repositories
- gcanti/fp-ts (main) score 58

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:48.545015+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:15:31.531770+00:00, confidence not recorded.
  - readme: https://github.com/gcanti/fp-ts (fetched 2026-08-28T04:10:48.545015+00:00, sha 3e355acb39f7)
  - homepage: https://gcanti.github.io/fp-ts/ (fetched 2026-08-29T08:14:20.727867+00:00, sha c514f08b5142)
- Data as of 2026-08-30T08:39:29.467469+00:00.
