Re: [Haskell-cafe] Yet another monad transformer or silly usage of Either?

2010-07-25 Thread David Menendez
2010/7/25 Eugeny N Dzhurinsky : > Hello, everybody! > > I am trying to develop some sort of library, which supposed to sign into a WEB > service, then perform some requests with it. > > Initially I designed methods in the following way > > data DServError = InvalidCredentials | InvalidRequest | ...

Re: [Haskell-cafe] Yet another monad transformer or silly usage of Either?

2010-07-25 Thread Job Vranish
Yeah, ErrorT should do what you want (EitherT is probably essentially the same thing) login would have the type: login :: String -> String -> ErrorT DServError IO LoginResponse and you would use it like this: result <- runErrorT $ authenticatedReq You can use runErrorT, or catch when you want to

[Haskell-cafe] Yet another monad transformer or silly usage of Either?

2010-07-25 Thread Eugeny N Dzhurinsky
Hello, everybody! I am trying to develop some sort of library, which supposed to sign into a WEB service, then perform some requests with it. Initially I designed methods in the following way data DServError = InvalidCredentials | InvalidRequest | ... newtype Result a = Result { getOpResult ::