[Haskell-cafe] data type declaration

Richard O'Keefe ok at cs.otago.ac.nz
Mon Jul 26 19:20:55 EDT 2010


On Jul 27, 2010, at 3:02 AM, Brandon S Allbery KF8NH wrote:
> As I understand it:
> 1) carrying [contexts] around complicates Haskell98 (and now Haskell2010)
> compatibility (also see below);

Like the availability of so many other features,
this one could be controlled by a language pragma.

> 2) GADTs do what you want, since they don't have backward compatibility baggage.

They are also more complex than is needed for the problem at hand.
> 
> As to the current proposal, I think nobody's certain what would happen to
> older programs if data were changed to carry contexts around --- someone
> might be relying on the current behavior, and changing it might produce
> runtime oddness instead of a compile-time error --- whereas making contexts
> illegal will produce an easily-fixed error message in all relevant cases.

Does anyone know why `data' contexts were broken in the first place?



More information about the Haskell-Cafe mailing list