ErrorT :: IO (Either Error String) -> ErrorT Error IO String

I can think that can be written as

ErrorT :: IO (Either Error String) -> ErrorT Error (IO String)

Am I correct?

No, you're not. Similar to function application, type application is also left-associative, so it can (but shouldn't) be written as

ErrorT :: IO ((Either Error) String) -> ((ErrorT Error) IO) String

In reality, ErrorT (or EitherT, for that matters) is just a disguise (meaning, newtype):

newtype ErrorT e m a = ErrorT {runErrorT :: m (Eigher e a)}
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to