Files
antigravity-skills-reference/skills/fp-types-ref/SKILL.md
sck_0 f313788985 release: v7.0.0 - 20k Stars Celebration
- Add 300+ new skills from 35+ community repositories
- Total collection now at 1,200+ skills
- New categories: UI/UX, Security, Data Science, Health, Quantum, Makepad
- Update package.json to v7.0.0
- Update README with new stats and 20k stars celebration banner
- Complete CHANGELOG with all new skills and community credits
- Add release_notes.md with detailed acknowledgments

Validation chain run, catalog regenerated.

Thank you to our incredible community for 20,000 GitHub stars!
2026-03-06 09:08:07 +01:00

1.7 KiB

name, description, version, tags
name description version tags
fp-types-ref 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. 1.0.0
fp-ts
typescript
quick-reference
option
either
task

fp-ts Quick Reference

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'        // Async (no failure)
import * as A from 'fp-ts/Array'       // Array utilities

One-Line Patterns

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)

Pattern Match

// Option
pipe(maybe, O.match(
  () => 'nothing',
  (val) => `got ${val}`
))

// Either
pipe(result, E.match(
  (err) => `error: ${err}`,
  (val) => `success: ${val}`
))