<div dir="ltr">I don&#39;t really see the value in `Except` either, but it&#39;s there to satisfy Ross who wants an `Identity`-specialized version of the monad transformer.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Aug 13, 2013 at 1:50 PM, Dag Odenhall <span dir="ltr">&lt;<a href="mailto:dag.odenhall@gmail.com" target="_blank">dag.odenhall@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><p style="margin:1.2em 0px!important">I don&#39;t see why we need <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">type Except e r = EitherT e Identity r</code> if it&#39;s exactly the same as <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">Either</code> anyway.  We don&#39;t have this for <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px 3px 3px 3px;display:inline">MaybeT</code>?</p>



</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Aug 13, 2013 at 8:49 PM, Gabriel Gonzalez <span dir="ltr">&lt;<a href="mailto:gabriel439@gmail.com" target="_blank">gabriel439@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">&gt; <span style="font-family:arial,sans-serif;font-size:13px">My preference is to call the new transformer ExceptT, with a basic</span><br style="font-family:arial,sans-serif;font-size:13px">


<span style="font-family:arial,sans-serif;font-size:13px">monad called Except, in line with most of the other transformers, and</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">to deprecate ErrorT.  (The rationale for the name is that Either isn&#39;t</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">just for exceptions, and exceptions aren&#39;t just for errors.)</span><div>



<br></div><div><span style="font-family:arial,sans-serif">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:</span></div>



<div><span style="font-family:arial,sans-serif"><br></span></div><div><font face="arial, sans-serif">expertCode :: (Monad m) =&gt; EitherT E m R</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">By designing the API entirely around the identity specialization you&#39;re optimizing for a narrow skill range of intermediate Haskell programmers who are:</font></div>



<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">a) Smart enough to figure out that `ExceptT` is the official generalization of `EitherT`</font></div><div><font face="arial, sans-serif"><br>



</font></div><div><font face="arial, sans-serif">b) Not smart enough to figure out how to keep the base monad polymorphic</font></div><div><font face="arial, sans-serif"><br></font></div><div><div><font face="arial, sans-serif">So I propose that you leave the monad transformer name as `EitherT`, but use `Except` for the `Identity` specialization:</font></div>



<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">type Except e r = EitherT e Identity r</font></div></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">This has the nice properties that:</font></div>



<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">* The identity specialization doesn&#39;t conflict with `Either`</font></div><div><font face="arial, sans-serif"><br></font></div><div>



<font face="arial, sans-serif">* Beginners find `transformers` when they search for `EitherT` as they inevitably will</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">* Existing packages that use `EitherT` won&#39;t break, thus preserving compatibility with the code bases that Edwards already mentioned</font></div>



<div><br></div></div>
<br></div></div>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>