
Fp Either Ref
- 8 installs
- 11 repo stars
- Updated January 30, 2026
- whatiskadudoing/fp-ts-skills
Helps with ai & agent building tasks.
About
fp-either-ref is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- fp-either-ref
- AI & Agent Building
- AI-coding skill
Fp Either Ref by the numbers
- 8 all-time installs (skills.sh)
- Ranked #12,339 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 27, 2026 (Skillselion catalog sync)
npx skills add https://github.com/whatiskadudoing/fp-ts-skills --skill fp-either-refAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 8 |
|---|---|
| repo stars | ★ 11 |
| Last updated | January 30, 2026 |
| Repository | whatiskadudoing/fp-ts-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
Either Quick Reference
Either = success or failure. Right(value) or Left(error).
Create
import * as E from 'fp-ts/Either'
E.right(value) // Success
E.left(error) // Failure
E.fromNullable(err)(x) // null → Left(err), else Right(x)
E.tryCatch(fn, toError) // try/catch → EitherTransform
E.map(fn) // Transform Right value
E.mapLeft(fn) // Transform Left error
E.flatMap(fn) // Chain (fn returns Either)
E.filterOrElse(pred, toErr) // Right → Left if pred failsExtract
E.getOrElse(err => default) // Get Right or default
E.match(onLeft, onRight) // Pattern match
E.toUnion(either) // E | A (loses type info)Common Patterns
import { pipe } from 'fp-ts/function'
import * as E from 'fp-ts/Either'
// Validation
const validateEmail = (s: string): E.Either<string, string> =>
s.includes('@') ? E.right(s) : E.left('Invalid email')
// Chain validations (stops at first error)
pipe(
E.right({ email: 'test@example.com', age: 25 }),
E.flatMap(d => pipe(validateEmail(d.email), E.map(() => d))),
E.flatMap(d => d.age >= 18 ? E.right(d) : E.left('Must be 18+'))
)
// Convert throwing code
const parseJson = (s: string) => E.tryCatch(
() => JSON.parse(s),
(e) => `Parse error: ${e}`
)vs try/catch
// ❌ try/catch - errors not in types
try {
const data = JSON.parse(input)
process(data)
} catch (e) {
handleError(e)
}
// ✅ Either - errors explicit in types
pipe(
E.tryCatch(() => JSON.parse(input), String),
E.map(process),
E.match(handleError, identity)
)Use Either when error type matters and you want to chain operations.
Related skills
AI & Agent Buildingagents