<br><br><div class="gmail_quote">On Tue, Jun 21, 2011 at 12:53 PM, Elliot Stern <span dir="ltr"><<a href="mailto:eliyahu.ben.miney@gmail.com" target="_blank">eliyahu.ben.miney@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A tuple is basically an anonymous product type. It's convenient to not have to spend the time making a named product type, because product types are so obviously useful.<br><br></blockquote><div><br></div><div>Tuples are not so anonymous. Although syntactic sugar complicates the issue, there is basically a data constructor named (,).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there any reason why Haskell doesn't have anonymous sum types? If there isn't some theoretical problem, is there any practical reason why they haven't been implemented?</blockquote>
<div><br></div><div>The problem is that a sum type must "name" the different types, or else it can't give access to them. How is a function supposed to know if a value </div><div><br></div><div>blah :: A :+: B</div>
<div><br></div><div>is an A or a B? It seems possible that it could figure it out, but that problem is undecidable in general.</div></div>