<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div><br>On 10 Jan 2014, at 04:17, John Lato <<a href="mailto:jwlato@gmail.com">jwlato@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 9, 2014 at 8:51 AM, Artyom Kazak <span dir="ltr"><<a href="mailto:yom@artyom.me" target="_blank">yom@artyom.me</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On 01/09/2014 08:36 PM, Vlatko Basic wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But instance declarations wouldn't be needed because we already have all the instances for Either. The point would be to have them unified.<br>
</blockquote></div>
Consider a generic Show instance for Either – there’s no way¹ to make it behave differently for Either () (or Maybe if it was a type synonym). I think there are other cases in which we want Maybe to behave differently from Either, but I can’t think of any on the spot.<br>

<br>
¹ this point also applies to String, which is a type synonym for [Char] – and it was solved somewhat inelegantly by adding an additional method to Show typeclass *specifically* for showing lists of things.</blockquote><div>
<br></div><div>I think this is a really important point.  If I may go further, it's arguable that 'type String = [Char]' was a poor decision, and one of the arguments is that it's not possible to make different instances for String and [a] (hence the showsList issue).</div>
<div><br></div><div>Also, due to laziness, Either () a is bigger than Maybe a.  It should be 'Either Void a'.   But Void has only recently been added to the standard-ish library, which means if we'd used Either () from the start now we'd be stuck with the wrong type.  I'd rather have a separate Maybe that does exactly what it's meant to.</div>
<div><br></div></div></div></div></div></blockquote><div><br></div><div>Why is 'Either Void a' isomorphic to 'Maybe a'. What would 'Nothing' be in this case? </div><div><br></div><div>Either () a is the correct version. Roughly speaking 'Maybe a' contains |a|+1 values while Either Void a contains only |a| values, since you can not construct any Left's</div><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>John L.</div></div></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Haskell-Cafe mailing list</span><br><span><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a></span><br><span><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a></span><br></div></blockquote></body></html>