fp-types-ref
/fp-types-ref
Podaje skrócone odniesienie do typów fp-ts, pomagając wybrać między Option, Either i Task oraz wskazując potrzebne importy.
- Autor
- LiHongwei-cn ↗
- Repozytorium
- lihongwei-cn ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 08.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Podaje skrócone odniesienie do typów fp-ts, pomagając wybrać między Option, Either i Task oraz wskazując potrzebne importy.
Oryginalny opis (EN)
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.
Jak działa
- When to Use
- Which Type Should I Use?
- Common Imports
- One-Line Patterns
- Pattern Match
- Limitations
Podgląd SKILL.md
---
name: fp-types-ref
description: 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.
risk: safe
source: community
version: 1.0.0
tags: [fp-ts, typescript, quick-reference, option, either, task]
---
# 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)` |
## Pattern Match
```typescript
// Option
pipe(maybe, O.match(
() => 'nothing',
(val) => `got ${val}`
))
// Either
pipe(result, E.match(
(err) => `error: ${err}`,
(val) => `success: ${val}`
))
```
## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · LiHongwei-cn/lihongwei-cn | 100 | MIT |
| FrancoStino/opencode-skills-collection | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 9c9e3a477f84 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100fp-option-ref
Podaje skrócone odniesienie do typu Option w fp-ts, przy obsłudze wartości nullable i opcjonalnych danych oraz unikaniu sprawdzania null. - 100fp-option-ref
Podaje skrócone odniesienie do typu Option w fp-ts, przy obsłudze wartości nullable i opcjonalnych danych oraz unikaniu sprawdzania null. - 100fp-either-ref
Podaje skrócone odniesienie do typu Either w fp-ts, przy obsłudze błędów, walidacji i operacji mogących zakończyć się typowanym błędem. - 100fp-either-ref
Podaje skrócone odniesienie do typu Either w fp-ts, przy obsłudze błędów, walidacji i operacji mogących zakończyć się typowanym błędem. - 95docs-module-ref
Pisze dokumentację referencyjną modułu z wieloma powiązanymi typami danych, z opisem relacji i wzorców kompozycji. - 95polyspace-find-option-documentation
Odnajduje stronę dokumentacji opcji Polyspace, takiej jak -c, -target czy -sources, zamiast zgadywać adres po fladze.