Haskell.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
thread

Re:

Dag Odenhall

13 Aug 2013 13 Aug '13
4:50 p.m.

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 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@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Attachments:

  • attachment.html (text/html — 4.5 KB)
0 0
Reply
Sign in to reply online Use email software

Back to the thread

Back to the list

HyperKitty Powered by HyperKitty version 1.3.9.