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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "fp-types-ref" with this command: npx skills add sickn33/antigravity-awesome-skills/sickn33-antigravity-awesome-skills-fp-types-ref

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

NeedCode
Wrap nullableO.fromNullable(value)
Default valueO.getOrElse(() => default)
Transform if existsO.map(fn)
Chain optionalsO.flatMap(fn)
Wrap try/catchE.tryCatch(() => risky(), toError)
Wrap asyncTE.tryCatch(() => fetch(url), toError)
Run pipepipe(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}`
))

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

clean-code

No summary provided by upstream source.

Repository SourceNeeds Review
3.5K-sickn33
Coding

typescript-expert

No summary provided by upstream source.

Repository SourceNeeds Review
2.5K-sickn33
Coding

bun-development

No summary provided by upstream source.

Repository SourceNeeds Review
1.3K-sickn33
Coding

game-development

No summary provided by upstream source.

Repository SourceNeeds Review
1.2K-sickn33