Dag Odenhall dag.odenhall at gmail.com
Tue Aug 13 22:50:21 CEST 2013


I don't see why we need type Except e r = EitherT e Identity r if it's
exactly the same as Either anyway. We don't have this for MaybeT?


On Tue, Aug 13, 2013 at 8:49 PM, Gabriel Gonzalez <gabriel439 at gmail.com>wrote:

> > My preference is to call the new transformer ExceptT, with a basic
> monad called Except, in line with most of the other transformers, and
> to deprecate ErrorT.  (The rationale for the name is that Either isn't
> just for exceptions, and exceptions aren't just for errors.)
>
> Specializing to an identity base monad is usually a misfeature in real
> code and only useful for pedagogical purposes.  Experts leave it
> polymorphic like this:
>
> expertCode :: (Monad m) => EitherT E m R
>
> By designing the API entirely around the identity specialization you're
> optimizing for a narrow skill range of intermediate Haskell programmers who
> are:
>
> a) Smart enough to figure out that `ExceptT` is the official
> generalization of `EitherT`
>
> b) Not smart enough to figure out how to keep the base monad polymorphic
>
> So I propose that you leave the monad transformer name as `EitherT`, but
> use `Except` for the `Identity` specialization:
>
> type Except e r = EitherT e Identity r
>
> This has the nice properties that:
>
> * The identity specialization doesn't conflict with `Either`
>
> * Beginners find `transformers` when they search for `EitherT` as they
> inevitably will
>
> * Existing packages that use `EitherT` won't break, thus preserving
> compatibility with the code bases that Edwards already mentioned
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130813/8effb044/attachment.htm>


More information about the Libraries mailing list