Re: [Haskell-cafe] Portability of MonadError

2009-01-05 Thread Luke Palmer
On Mon, Jan 5, 2009 at 1:48 PM, Peter Robinson thaldy...@gmail.com wrote: Hello, One thing that's been bothering me about MonadError monads is the non-portability of code that uses a custom Error type. Meaning, if I have libraries A and B that use different error types, I won't be able to

Re: [Haskell-cafe] Portability of MonadError

2009-01-05 Thread Luke Palmer
On Mon, Jan 5, 2009 at 2:13 PM, Luke Palmer lrpal...@gmail.com wrote: On Mon, Jan 5, 2009 at 1:48 PM, Peter Robinson thaldy...@gmail.comwrote: Hello, One thing that's been bothering me about MonadError monads is the non-portability of code that uses a custom Error type. Meaning, if I have

Re: [Haskell-cafe] Portability of MonadError

2009-01-05 Thread Peter Robinson
On Mon, Jan 5, 2009 at 2:13 PM, Luke Palmer lrpal...@gmail.com wrote: On Mon, Jan 5, 2009 at 1:48 PM, Peter Robinson thaldy...@gmail.com wrote: Hello, One thing that's been bothering me about MonadError monads is the non-portability of code that uses a custom Error type. Meaning, if I

Re: [Haskell-cafe] Portability of MonadError

2009-01-05 Thread Luke Palmer
On Mon, Jan 5, 2009 at 2:13 PM, Luke Palmer lrpal...@gmail.com wrote: Then your example can become:: func = (mapError Left funcA mapError Right funcB) `catchError` (\e - ...) Luke Oh bother! My new year's resolution: think before I speak. While I do think this is the right answer, it

Re: [Haskell-cafe] Portability of MonadError

2009-01-05 Thread Henning Thielemann
On Mon, 5 Jan 2009, Luke Palmer wrote: Oh bother!  My new year's resolution: think before I speak. While I do think this is the right answer, it is not the right answer in the status quo.  This is because ErrorT e m is only a monad when e is an Error, which Either (and most types) are not.