monads-from-scratch
This repository does not pretend to be a production library, instead, it defines the most used monads in haskell from scratch and some examples on how to use them; the idea is to understand this useful algebraic constructs.
Note: Some mathematical concepts are skipped.
Please check the tests to see examples of how to use them.
Monads:
- Maybe: Implementation & Usage
- Either: Implementation & Usage
- IO: Implementation & Usage
- List: Implementation & Usage
- Reader: Implementation & Usage
- Writer: Implementation & Usage
- State: Implementation & Usage
Monad transformers:
- ReaderT: Implementation & Usage
- StateT: Implementation & Usage
- EitherT: Implementation & Usage
- MaybeT: Implementation & Usage
- WriterT: Implementation & Usage
Type classes:
- Functor: Implementation
- Applicative Functor: Implementation
- Monad: Implementation
- Monad Transformer: Implementation
Build
stack build
Run tests
stack test