CodeVetter · Repo Unpack · System map
gcanti/fp-ts
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.
- package.json identifies version 2.16.11 and exposes lib/index.js, es6/index.js, and lib/index.d.ts; it declares sideEffects:false, while the getting-started guide explicitly describes a library without runtime dependencies.
- src/index.ts is a namespace barrel importing modules such as Option, Either, IO, TaskEither, and ReaderTaskEither; its exported names include lowercase namespaces and aliases for reserved words.
- HKT.ts defines HKT through HKT4, open URItoKind dictionaries, URI key unions, and Kind projections; Option and Either register their concrete types through module augmentation.
- Runtime boundaries are explicit: IO<A> is () => A, Task<A> is () => Promise<A>, and TaskEither<E,A> extends Task<Either<E,A>>.
- ReaderTaskEither receives a caller-supplied environment and returns a TaskEither; State receives state and returns [value,state], while IORef stores a private mutable value in an object.
- npm run build compiles CommonJS and ES modules before executing scripts/build.ts; that script copies package metadata and documentation, generates module manifests, then fixes HKT paths.
- The configured npm test chain runs ESLint, Prettier, dtslint, Vitest, and docs-ts; GitHub Actions installs dependencies, builds, and runs that chain on Ubuntu with Node 20.12.2.
- Documentation uses docs-ts with src/internal.ts excluded and a Just the Docs site configuration; release executes npm publish from dist, while the root prepublishOnly script deliberately fails.