3 ms·
The option monad is literally isomorphic to maybe. It 100% follows the definition of a monad and is an instance of the monad type class in Cats and Scalaz. Man
by cultus 8y ago
The option monad is literally isomorphic to maybe. It 100% follows the definition of a monad and is an instance of the monad type class in Cats and Scalaz.
Many algebraic data types are monads. I’m not sure why you think that is a contradiction.
- throwaway487549 8y agoThis isomorphism has no meaning. It is also isomorphic to logical OR, if you wish. Shall we wrap OR into a Monad?
- kreetx 8y agoI think you're overthinking it. The isomorphism simply exists. And you don't wrap things into a monad, you just write an instance for it -- it has no effect on the data type itself, it simply allows to use the data type in monadic contexts.
- AnaniasAnanas 8y agoI think you mean of Either. Either is isomorphic to logical OR in type theory.