fp-either-ref
Quick reference for Either type. Use when user needs error handling, validation, or operations that can fail with typed errors.
npx skills add sickn33/agentic-awesome-skills --skill fp-either-ref --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Either Quick Reference Either = success or failure. `Right(value)` or `Left(error)`. ## When to Use - You need a quick fp-ts reference for typed synchronous error handling. - The task involves validation, fallible operations, or converting throwing code to `Either`. - You want a compact cheat sheet rather than a long tutorial. ## Create ```typescript 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 → Either ``` ## Transform ```typescript 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 fails ``` ## Extract ```typescript E.getOrElse(err => default) // Get Right or default E.match(onLeft, onRight) // Pattern match E.toUnion(either) // E | A (loses type info) ``` ## Common Patterns ```typescript 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
- When to Use
- Create
- Transform
- Extract
- Common Patterns
- vs try/catch
- Limitations
What does the fp-either-ref skill do?
Quick reference for Either type. Use when user needs error handling, validation, or operations that can fail with typed errors.
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill fp-either-ref --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.