0.0.3 • Published 4 years ago

@hasparus/maybe-ts v0.0.3

Weekly downloads
3
License
MIT
Repository
-
Last release
4 years ago

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:

npm.io


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/

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago