<div dir="ltr"><div><div><div><div><div><div><div>I can&#39;t think of any at the moment that are still in force. However, one that might have been relevant at the time is:<br><br></div>    data C a =&gt; Foo a = Foo a a<br>
<br></div>    foo :: Foo a -&gt; (a, a)<br></div>    foo ~(Foo x y) = (x, y)<br><br></div>Irrefutable matches used to be disallowed for GADT-like things, which would break the above if it were translated to GADTs. Now they just don&#39;t introduce their constraints.<br>
<br></div>However, another thing to consider is that getting rid of data type contexts was accepted into the language standard. It&#39;s not really possible to fix them by translation to GADTs in the report, because GADTs aren&#39;t in the report, and probably won&#39;t be for some time, if ever. And putting a fixed version natively into the report would require nailing down a lot of details. For instance, are the contexts simply invalid on newtypes, or do they just work the old way?<br>
</div><br></div><div>I don&#39;t really think they&#39;re worth saving in general, though. I haven&#39;t missed them, at least.<br><br></div>-- Dan<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 25, 2013 at 3:19 PM, Gábor Lehel <span dir="ltr">&lt;<a href="mailto:illissius@gmail.com" target="_blank">illissius@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">Good point, again. Is that the only problem with it?<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">
On Thu, Apr 25, 2013 at 5:57 PM, Dan Doel <span dir="ltr">&lt;<a href="mailto:dan.doel@gmail.com" target="_blank">dan.doel@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">It is not completely backwards compatible, because (for instance) the declaration:<div><br></div><div>    newtype C a =&gt; Foo a = Foo a</div>

<div><br></div><div>was allowed, but:</div><div>
<br></div><div>    newtype Foo a where</div><div>      Foo :: C a =&gt; a -&gt; Foo a</div><div><br></div><div>is an illegal definition. It can only be translated to a non-newtype data declaration, which changes the semantics.</div>


</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 25, 2013 at 10:35 AM, Gábor Lehel <span dir="ltr">&lt;<a href="mailto:illissius@gmail.com" target="_blank">illissius@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>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><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" target="_blank">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></div></div><span><font color="#888888">-- <br>Your ship was destroyed in a monadic eruption.
</font></span><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Your ship was destroyed in a monadic eruption.
</div></div></blockquote></div><br></div>