<div>I&#39;ve wondered this too. What would have been wrong with a simple source-to-source translation, where a constraint on the datatype itself translates to the same constraint on each of its constructors? Perhaps it would be unintuitive that you would have to pattern match before gaining access to the constraint? On a superficial examination it would have been backwards-compatible, allowing strictly more programs than the previous handling.</div>
<div><br></div><div class="gmail_quote">On Thu, Apr 25, 2013 at 12:38 PM, harry <span dir="ltr">&lt;<a href="mailto:voldermort@hotmail.com" target="_blank">voldermort@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If I understand correctly, the problem with datatype contexts is that if we<br>
have e.g.<br>
  data Eq a =&gt; Foo a = Foo a<br>
the constraint Eq a is thrown away after a Foo is constructed, and any<br>
method using Foos must repeat Eq a in its type signature.<br>
<br>
Why were these contexts removed from the language, instead of &quot;fixing&quot; them?<br>
<br>
PS This is following up on a discussion on haskell-beginners, &quot;How to avoid<br>
repeating a type restriction from a data constructor&quot;. I&#39;m interested in<br>
knowing whether there&#39;s a good reason not to allow this, or if it&#39;s just a<br>
consequence of the way type classes are implemented by compilers.<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Your ship was destroyed in a monadic eruption.