Hacker News new | ask | show | jobs
by yummyfajitas 5827 days 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.