6 ms·
f: (a -> m b) -> ... -> m Result Maybe and Either are both monads and by convention Left errCode is the fail method of the Either monad. This will work exactly
by yummyfajitas 16y ago
f: (a -> m b) -> ... -> m Result
Maybe and Either are both monads and by convention Left errCode is the fail method of the Either monad. This will work exactly as you think it should. It will also work with, e.g., io actions that might fail.