On Thu, Apr 25, 2013 at 6:38 AM, harry <volderm...@hotmail.com> wrote:

> If I understand correctly, the problem with datatype contexts is that if we
> have e.g.
>   data Eq a => Foo a = Foo a
> the constraint Eq a is thrown away after a Foo is constructed, and any
> method using Foos must repeat Eq a in its type signature.
>
> Why were these contexts removed from the language, instead of "fixing"
> them?
>

As I understand it, it's because fixing them involves passing around a
dictionary along with the data, and you can't do that with a standard
declaration (it amounts to an extra chunk of data that's only *sometimes*
wanted, and that "sometimes" complicates things). GADTs already have to
pass around extra data in order to support their constructors and
destructors; and, being new and not part of the standard, they don't have
backward compatibility or standards compatibility issues, so they can get
away with including the extra dictionary without breaking existing programs.

-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to