4 ms·
I was slightly mistaken, because I missed how the error type was put last in all of those Results. In Haskell, the error type is typically written first (Either
by thinkpad20 12y ago
I was slightly mistaken, because I missed how the error type was put last in all of those Results. In Haskell, the error type is typically written first (Either MyError x), because since `Either a` is an instance of monad, we can replace `Either a` with `m` and get
bind :: (a -> m b) -> m a -> m b
Which is exactly the signature of (=<<). So you don't just get a cleaner syntax; you now have the ability to use `bind` with any monad (Maybe, List, IO, State...).