patch applied (ghc): New syntax for GADT-style record declarations, and associated refactoring

Simon Peyton Jones simonpj at microsoft.com
Thu Jul 2 05:58:46 EDT 2009


Thu Jul  2 02:46:57 PDT 2009  simonpj at microsoft.com
  * New syntax for GADT-style record declarations, and associated refactoring
  Ignore-this: bd9817230d3773b3b01fae3d7f04c57d
  
  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.
  

    M ./compiler/deSugar/DsMeta.hs -4 +4
    M ./compiler/hsSyn/Convert.lhs -20 +29
    M ./compiler/hsSyn/HsDecls.lhs -23 +26
    M ./compiler/hsSyn/HsTypes.lhs -2 +21
    M ./compiler/parser/HaddockUtils.hs -6 +5
    M ./compiler/parser/Parser.y.pp -143 +64
    M ./compiler/parser/ParserCore.y -21 +14
    M ./compiler/parser/RdrHsSyn.lhs -188 +205
    M ./compiler/rename/RnHsSyn.lhs +1
    M ./compiler/rename/RnSource.lhs -65 +56
    M ./compiler/rename/RnTypes.lhs -5 +19
    M ./compiler/typecheck/TcHsType.lhs -4 +12
    M ./compiler/typecheck/TcTyClsDecls.lhs -3 +6
    M ./docs/users_guide/glasgow_exts.xml -19 +60

View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20090702094657-1287e-219b62d84c0699e57d3b53fcc342ae2d8c0d5763.gz



More information about the Cvs-ghc mailing list