fp-types-ref

Solid

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.

AI & Automation 39,350 stars 6386 forks Updated today MIT

Install

View on GitHub

Quality Score: 97/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
85
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# fp-ts Quick Reference ## When to Use - You need help choosing between `Option`, `Either`, `Task`, `TaskEither`, or related fp-ts types. - The task is about imports, decision guidance, or selecting the right abstraction for a TypeScript flow. - You want a compact reference for common fp-ts type choices and patterns. ## 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 ```typescript // 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)` | ## Pa...

Details

Author
sickn33
Repository
sickn33/antigravity-awesome-skills
Created
4 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category