0.0.3 • Published 4 years ago
@hasparus/maybe-ts v0.0.3
maybe-ts
A lightweight Maybe type for fp-ts
export type Nothing = null | undefined;
export const Nothing = null as Nothing;
export type Maybe<T> = T | Nothing;
🤹♂️ Instance of your favorite type classes
Edit: Not really. This is not a functor over nullables.
counterexample to composition law of the functor:
Installation
npm install @hasparus/maybe-ts
yarn add @hasparus/maybe-ts
Requirements
fp-ts ^2.3
TypeScript >= 3.7
Contributing
Found a bug? Have an idea for improvements? Feel free to shoot a PR!
Slides: https://maybe-ts.now.sh/