[commit: ghc] master: Make TH capable of quoting GADT declarations (Trac #5217) (5c4a4c4)
Simon Peyton Jones
simonpj at microsoft.com
Mon Jun 13 23:41:44 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/5c4a4c4bfe2a007f41f42ebab689bcd7219bed0d
>---------------------------------------------------------------
commit 5c4a4c4bfe2a007f41f42ebab689bcd7219bed0d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Sat Jun 11 16:44:07 2011 +0100
Make TH capable of quoting GADT declarations (Trac #5217)
Template Haskell doesn't support GADTs directly but
we can use equality constraints to do the job. Here's
an example of the dump from splicing such a declaration:
[d| data T a b
where
T1 :: Int -> T Int Char
T2 :: a -> T a a
T3 :: a -> T [a] a
T4 :: a -> b -> T b [a] |]
======>
T5217.hs:(6,3)-(9,53)
data T a[aQW] b[aQX]
= (b[aQX] ~ Char, a[aQW] ~ Int) => T1 Int |
b[aQX] ~ a[aQW] => T2 a[aQW] |
a[aQW] ~ [b[aQX]] => T3 b[aQX] |
forall a[aQY]. b[aQX] ~ [a[aQY]] => T4 a[aQY] a[aQW]
compiler/deSugar/DsMeta.hs | 110 +++++++++++++++++++++++++++++----------
compiler/hsSyn/HsTypes.lhs | 14 +++++
compiler/typecheck/TcHsType.lhs | 19 +------
compiler/typecheck/TcMType.lhs | 5 +-
4 files changed, 102 insertions(+), 46 deletions(-)
Diff suppressed because of size. To see it, use:
git show 5c4a4c4bfe2a007f41f42ebab689bcd7219bed0d
More information about the Cvs-ghc
mailing list