[GHC] #3306: Improve syntax for GADT + records
GHC
trac at galois.com
Fri Jul 17 08:07:17 EDT 2009
#3306: Improve syntax for GADT + records
---------------------------------+------------------------------------------
Reporter: simonpj | Owner: simonpj
Type: feature request | Status: closed
Priority: normal | Milestone: 6.12.1
Component: Compiler | Version: 6.10.2
Severity: normal | Resolution: fixed
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Changes (by simonpj):
* status: new => closed
* resolution: => fixed
Comment:
In fact I'd even committed that patch, so I declare this done:
{{{
Thu Jul 2 10:46:57 BST 2009 simonpj at microsoft.com
* New syntax for GADT-style record declarations, and associated
refactoring
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
}}}
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3306#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list