Quick reference for fp-ts types: decision tree for Option/Either/TaskEither/TaskOption/Task, common imports, one-line patterns, and pattern matching.
From antigravity-awesome-skillsnpx claudepluginhub sickn33/antigravity-awesome-skills --plugin antigravity-awesome-skillsThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
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>
// 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
| Need | Code |
|---|---|
| Wrap nullable | O.fromNullable(value) |
| Default value | O.getOrElse(() => default) |
| Transform if exists | O.map(fn) |
| Chain optionals | O.flatMap(fn) |
| Wrap try/catch | E.tryCatch(() => risky(), toError) |
| Wrap async | TE.tryCatch(() => fetch(url), toError) |
| Run pipe | pipe(value, fn1, fn2, fn3) |
// Option
pipe(maybe, O.match(
() => 'nothing',
(val) => `got ${val}`
))
// Either
pipe(result, E.match(
(err) => `error: ${err}`,
(val) => `success: ${val}`
))