Monads are cross cutting functionality shaped into a unified interface. Kinds that are in common use:
- lists are monads that provide multiplicity
- options are monads that provide nullability
- try wrappers are monads that provide failure semantics
- futures and promises are monads that provide asyncrony
- either is a monad that provides duality
… and many more. The key concept here is that you wrap computations in some behavior before executing them. there are many problems that can be monadefied.
The problem is that learning about monads comes with a lot of threads to pull about category theory and it’s use in computation. This is where I feel folks get lost.
Monads are tremendously useful and understandable. Many go full theory when teaching them and that is regrettable.
- lists are monads that provide multiplicity
- options are monads that provide nullability
- try wrappers are monads that provide failure semantics
- futures and promises are monads that provide asyncrony
- either is a monad that provides duality
… and many more. The key concept here is that you wrap computations in some behavior before executing them. there are many problems that can be monadefied.
The problem is that learning about monads comes with a lot of threads to pull about category theory and it’s use in computation. This is where I feel folks get lost.
Monads are tremendously useful and understandable. Many go full theory when teaching them and that is regrettable.