Fp-ts-skills fp-types-ref
Quick reference for fp-ts types. Use when user asks which type to use, needs Option/Either/Task decision help, or wants fp-ts imports.
install
source · Clone the upstream repo
git clone https://github.com/whatiskadudoing/fp-ts-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/whatiskadudoing/fp-ts-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/quick-ref/fp-types-ref" ~/.claude/skills/whatiskadudoing-fp-ts-skills-fp-types-ref && rm -rf "$T"
manifest:
skills/quick-ref/fp-types-ref/SKILL.mdsource content
fp-ts Quick Reference
Which Type Should I Use?
Is the operation async? ├─ NO: Does it involve errors? │ ├─ YES → Either<Error, Value> │ └─ NO: Might value be missing? │ ├─ YES → Option<Value> │ └─ NO → Just use the value └─ YES: Does it involve errors? ├─ YES → TaskEither<Error, Value> └─ NO: Might value be missing? ├─ YES → TaskOption<Value> └─ NO → Task<Value>
Common Imports
// Core import { pipe, flow } from 'fp-ts/function' // Types import * as O from 'fp-ts/Option' // Maybe exists import * as E from 'fp-ts/Either' // Success or failure import * as TE from 'fp-ts/TaskEither' // Async + failure import * as T from 'fp-ts/Task' // Async (no failure) import * as A from 'fp-ts/Array' // Array utilities
One-Line Patterns
| Need | Code |
|---|---|
| Wrap nullable | |
| Default value | |
| Transform if exists | |
| Chain optionals | |
| Wrap try/catch | |
| Wrap async | |
| Run pipe | |
Pattern Match
// Option pipe(maybe, O.match( () => 'nothing', (val) => `got ${val}` )) // Either pipe(result, E.match( (err) => `error: ${err}`, (val) => `success: ${val}` ))