Make TH capable of quoting GADT declarations (Trac #5217)
authorSimon Peyton Jones <simonpj@microsoft.com>
Sat, 11 Jun 2011 15:44:07 +0000 (16:44 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Sat, 11 Jun 2011 15:44:07 +0000 (16:44 +0100)
commit5c4a4c4bfe2a007f41f42ebab689bcd7219bed0d
treedd7027bb5da81adb7cfe6b0ceeca78b704f3c5f7
parent792449f555bb4dfa8e718079f6d42dc9babe938a
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
compiler/hsSyn/HsTypes.lhs
compiler/typecheck/TcHsType.lhs
compiler/typecheck/TcMType.lhs