3 ms·
The Maybe monad doesn’t have this feature. It’s purposefully simple: the value is either present or absent. If you want different errors, use the Either monad.
by kccqzy 9y ago
The Maybe monad doesn’t have this feature. It’s purposefully simple: the value is either present or absent.
If you want different errors, use the Either monad. It basically means either the value you want is there, or it’s not there but there’s an explanation. Chaining works just as well for the Either monad.