Start a fresh conversation. Replace the highlighted placeholders.
Use fp-types-ref to recommend the right fp-ts type and imports for [TypeScript scenario], with a concise code example for [desired error-handling behavior].
Required inputs
[TypeScript scenario]
[desired error-handling behavior]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: fp-types-refdescription: 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.risk: safesource: communitydate_added: "2026-03-06"version: 1.0.0tags: [fp-ts, typescript, quick-reference, option, either, task]
fp-ts Quick Reference
When to Use
You need help choosing between Option, Either, Task, TaskEither, or related fp-ts types.
The task is about imports, decision guidance, or selecting the right abstraction for a TypeScript flow.
You want a compact reference for common fp-ts type choices and patterns.
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' // Lazy async; no typed error channel
import * as A from 'fp-ts/Array' // Array utilities
Use this skill only when the task clearly matches the scope described above.
Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Reference scope
These are fp-ts 2.x fragments. Supply application variables, types, validators and imports, and check the installed version. map does not catch thrown exceptions. Task has no typed error channel; an improperly wrapped promise can still reject. Use tryCatch at fallible boundaries.