CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

gcanti/fp-ts

Scanned commit c0a6472121 dated 2026-04-20 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/gcanti/fp-ts ↗ · 429 files · 3.9 MB

Functional programming in TypeScript 📢 Important Announcement: fp-ts is Joining the Effect-TS Ecosystem!

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (397s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

fp-ts 2.16.11 is a TypeScript library for developers composing typed functional programs through Option, Either, lazy effects, collections, and algebraic interfaces. Its distinctive architecture uses higher-kinded type dictionaries and explicit instance objects to share combinators across different computational contexts. This brief examines commit c0a6472121c67a2b083e62fcff13e7d022e39d8f through bounded source inspection, including consumer pipelines, asynchronous execution, mutable references, and package assembly; nothing was executed.

System map

The inspected system is a library whose consumers import functions and instance dictionaries. Its runtime representations use tagged objects, ordinary collections, and functions; higher-kinded types connect these representations at compile time. Package assembly produces two JavaScript module formats and declarations, with special handling for HKT identity. Repository tooling provides linting, runtime tests, type assertions, documentation generation, and publication.

Feature catalog

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.

Data flow

Values enter through constructors, conversion functions, or caller-supplied effect functions. Tagged branches determine whether transformations continue, while instance arguments determine how generic algorithms combine results. Effects execute at explicit function invocation boundaries, and environments or state remain caller-provided values. Persistent file output appears in package tooling; the inspected library state mechanisms operate through tuples or process-local references.

Behavior traces

Eight source walks describe consumer and maintainer behavior without executing it. The primary consumer paths cover optional-value extraction, JSON decoding, asynchronous failures, concurrent and sequential traversal, cleanup, and mutable references. The package path follows compilation through generated artifact assembly. Each trace identifies execution order and the branch that changes subsequent work.

Testing signals

Tests and CI were inspected, not executed; no passing result, coverage percentage, or benchmark result is established by this investigation. Runtime examples use Vitest globals and Node assertions, while dtslint separately checks inferred public types. The inspected cases exercise conversion boundaries, cleanup branches, traversal execution, references, serialization, and barrel exports. Coverage remains bounded, and several source-level limitations require distinguishing test intent from actual assertions.

Risk map

These are source observations and explicitly labeled hypotheses, not confirmed vulnerabilities or reproduced failures. Sensitive boundaries in the inspected files include foreign callbacks, Promise rejection, filesystem operations, and npm publication. Searches across the examined public source and tooling were bounded; they do not establish whole-repository absence of authentication, secrets handling, networking, or other security behavior. Compatibility and test reliability deserve attention alongside runtime failure handling.

Extension points

Extension primarily happens through TypeScript interfaces and explicit instance arguments. New data types register with HKT dictionaries, then provide operations satisfying the relevant type classes. Existing factories accept caller-defined equality, ordering, error combination, and output accumulation policies. Maintainer tooling also exposes an injectable filesystem boundary and automatically derives packaged module entries from compiler output.

Contributor handoff

Begin with the affected public module, its shared helpers, runtime tests, and type assertions. Preserve inferred types, laziness, branch behavior, and compatibility aliases when making small changes. Tests and CI were inspected, not executed; any later validation must report actual commands and outcomes separately. This inventory is bounded and should guide targeted investigation rather than substitute for complete coverage.

Languages

LanguageFilesShare of source
TypeScript271100%
Markdown140docs/config
JSON9docs/config
YAML3docs/config
HTML1docs/config
Sass10%

Start reading here

Probable source entrypoint: src/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (123 files)

Source layout — src/

PathFiles
src/Alt.ts1
src/Alternative.ts1
src/Apply.ts1
src/Array.ts1
src/Bifunctor.ts1
src/BooleanAlgebra.ts1
src/BoundedMeetSemilattice.ts1
src/Category.ts1
src/ChainRec.ts1
src/Compactable.ts1
src/Const.ts1
src/Date.ts1
src/EitherT.ts1
src/FilterableWithIndex.ts1

Repository structure

Top-level pathFiles
docs/135
src/123
test/81
dtslint/44
perf/15
scripts/6
.github/6
examples/3

Docs found: README.mddocs/ecosystem.mddocs/guides/HKT.mddocs/guides/code-conventions.mddocs/guides/do-notation.mddocs/guides/getting-started.mddocs/guides/index.mddocs/guides/purescript.mddocs/guides/upgrade-to-v2.mddocs/index.md

Package

package.json — fp-ts v2.16.11, 24 declared dependencies.

@effect/dtslint@effect/language-service@types/benchmark@types/chai@types/glob@types/node@typescript-eslint/eslint-plugin@typescript-eslint/parser@vitest/coverage-istanbulbenchmarkdocs-tseslint

CI & config entrypoints

Structural health signals

Average score 7.1/10 across 96 analyzed source files; 18 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history