fp-option-ref
Installation
SKILL.md
Option Quick Reference
Option = value that might not exist. Some(value) or None.
When to Use
- You need a quick fp-ts reference for nullable or optional values.
- The task involves eliminating null checks, safe property access, or optional chaining with
Option. - You want a short reference card rather than a full migration guide.
Create
import * as O from 'fp-ts/Option'
O.some(5) // Some(5)
O.none // None
O.fromNullable(x) // null/undefined → None, else Some(x)
O.fromPredicate(x > 0)(x) // false → None, true → Some(x)