fp-ts-contrib is a community-driven utility package designed to extend the core functionalities of `fp-ts`, a popular TypeScript library for functional programming. It provides additional data types, combinators, and instances for existing types that are not part of the `fp-ts` core but are frequently requested or useful in a functional programming context. Currently at version 0.1.29, the library exhibits a consistent release cadence with new features and bug fixes, as seen in the frequent micro-version bumps. Its key differentiator is providing a shared space for useful `fp-ts` extensions, reducing boilerplate and fostering a more robust functional ecosystem by incorporating patterns like `IOOption`, `ReaderIO`, and `Zipper`, which are not directly in `fp-ts` itself. It primarily targets TypeScript environments and maintains compatibility with `fp-ts` via peer dependencies.
npm install fp-ts-contribVerified import paths — ran on the pinned version, not inferred.
Demonstrates the use of `IOOption` to handle potentially absent input within an `IO` context, processing it if present.
Ensure `fp-ts` is explicitly installed in your project: `npm install fp-ts` or `yarn add fp-ts`.
Always import modules directly from their path, e.g., `import * as IOOption from 'fp-ts-contrib/IOOption'`.
Upgrade your TypeScript version to 3.5 or newer: `npm install typescript@^3.5` or `yarn add typescript@^3.5`.
Install `fp-ts` manually: `npm install fp-ts` or `yarn add fp-ts`.
Ensure `fp-ts-contrib` is installed (`npm i fp-ts-contrib`) and check import paths. Also verify your `tsconfig.json` includes `node_modules` in its types.
Import the module from its direct path as a namespace: `import * as IOOption from 'fp-ts-contrib/IOOption'`.