Quick reference for fp-ts pipe and flow to chain functions, transform values like strings/Options/Arrays, and build reusable pipelines.
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.
import { pipe } from 'fp-ts/function'
// pipe(startValue, fn1, fn2, fn3)
// = fn3(fn2(fn1(startValue)))
const result = pipe(
' hello world ',
s => s.trim(),
s => s.toUpperCase(),
s => s.split(' ')
)
// ['HELLO', 'WORLD']
import { flow } from 'fp-ts/function'
// flow(fn1, fn2, fn3) returns a new function
const process = flow(
(s: string) => s.trim(),
s => s.toUpperCase(),
s => s.split(' ')
)
process(' hello world ') // ['HELLO', 'WORLD']
process(' foo bar ') // ['FOO', 'BAR']
| Use | When |
|---|---|
pipe | Transform a specific value now |
flow | Create reusable transformation |
import * as O from 'fp-ts/Option'
import * as A from 'fp-ts/Array'
// Option chain
pipe(
O.fromNullable(user),
O.map(u => u.email),
O.getOrElse(() => 'no email')
)
// Array chain
pipe(
users,
A.filter(u => u.active),
A.map(u => u.name)
)
// Data last enables partial application
const getActiveNames = flow(
A.filter((u: User) => u.active),
A.map(u => u.name)
)
// Reuse anywhere
getActiveNames(users1)
getActiveNames(users2)