Are there GHC extensions we'd like to incorporate wholesale?

Simon Peyton Jones simonpj at microsoft.com
Wed May 4 07:50:29 UTC 2016


|  For example, much as I love GADTs and would be all for them being added
|  in some future language report, I do not feel they should be added this
|  time around. (Though I emphatically and wholeheartedly support adding
|  GADTSyntax.) The primary reason being that while the semantics of the
|  data types themselves is easy enough to define, there's no really
|  sensible way of specifying how type inference should work for them. GHC
|  has gone back and forth with a bunch of different inference methods
|  over the years, and I don't think that's really stabilized yet;

Actually it has stabilised.  The OutsideIn journal paper (http://research.microsoft.com/en-us/um/people/simonpj/papers/constraints/index.htm) describes how it works, and has been absolutely stable for several years.  (All the movement has been on other things: type families, kind polymorphism, etc.)

I agree that the specification isn't entirely satisfactory, because it's a bit operational.  But it's robust and stable.

I'm not arguing for or against GADTs in the next iteration of Haskell.  But I don't think that the ease or difficulty of specifying GADTs is going to change much, so waiting till next time may not help; useful as they are, a declarative specification for GADTs is tricky.


Simon



More information about the Haskell-prime mailing list