CodeVetter · Repo Unpack · Feature catalog
gcanti/fp-ts
The user-facing surface consists of TypeScript APIs for representing values, composing computations, and selecting algebraic behavior. The inspected modules cover optionality, typed failures, asynchronous effects, functional collections, explicit environments, state, and accumulated output. Generic algorithms let callers choose execution and combination policies through instances. This catalog groups the examined capabilities and does not claim exhaustive coverage of every exported symbol.
- Option exposes None/Some, nullable conversion, exception-to-None conversion, map/flatMap, pattern matching, and lazy fallback extraction through getOrElse.
- Either models Left<E>/Right<A>, maps successful values, sequences computations with error unions, and converts synchronous exceptions using a caller-provided onThrow function.
- Task and TaskEither support lazy asynchronous computation, parallel or sequential application, indexed traversal, Promise adapters, and acquire/use/release composition.
- Array and ReadonlyArray provide mapping, flattening, optional lookup/update, sorting by Ord, filterMap, and traversal parameterized by an Applicative.
- ReadonlyMap supports equality-based key lookup and copy-on-change upsert; ReadonlySet builds deduplicated sets and performs union/intersection using a supplied Eq rather than relying only on native identity.
- Eq provides custom equality and structural/tuple composition; Ord adds comparison and tuple ordering; Apply.sequenceT and sequenceS collect heterogeneous effects into tuples or records.
- ReaderTaskEither combines dependencies with typed asynchronous failures, State exposes get/put/modify and result/state projections, and Writer exposes tell/listen plus Monoid-driven accumulation.
- Additional examined APIs include Tree.make/getEq, These's simultaneous Both case, Json.parse/stringify, and lazy console and Math.random wrappers.