• simonpj@microsoft.com's avatar
    New syntax for GADT-style record declarations, and associated refactoring · 432b9c93
    simonpj@microsoft.com authored
    The main purpose of this patch is to fix Trac #3306, by fleshing out the
    syntax for GADT-style record declraations so that you have a context in 
    the type.  The new form is
       data T a where
         MkT :: forall a. Eq a => { x,y :: !a } -> T a
    See discussion on the Trac ticket.
    The old form is still allowed, but give a deprecation warning.
    When we remove the old form we'll also get rid of the one reduce/reduce
    error in the grammar. Hurrah!
    While I was at it, I failed as usual to resist the temptation to do lots of
    refactoring.  The parsing of data/type declarations is now much simpler and
    more uniform.  Less code, less chance of errors, and more functionality.
    Took longer than I planned, though.
    ConDecl has record syntax, but it was not being used consistently, so I
    pushed that through the compiler.
HsDecls.lhs 37.2 KB