@hasparus/maybe-ts
v0.0.3
Published
A lightweight Maybe type for fp-ts
Downloads
10
Readme
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:

- [x] Monad1
- [x] Foldable1
- [x] Traversable1
- [x] Alternative1
- [x] Extend1
- [x] Compactable1
- [x] Filterable1
Installation
npm install @hasparus/maybe-ts
yarn add @hasparus/maybe-tsRequirements
fp-ts ^2.3
TypeScript >= 3.7Contributing
Found a bug? Have an idea for improvements? Feel free to shoot a PR!
Slides: https://maybe-ts.now.sh/
