Change Template Haskell representation of GADTs.
[ghc.git] / testsuite / tests / th / T10828b.hs
1 {-# LANGUAGE TemplateHaskell, GADTs, ExplicitForAll, KindSignatures #-}
2
3 module T10828b where
4
5 import Language.Haskell.TH
6 import System.IO
7
8 -- attempting to mix GADT and normal constructors
9 $( return
10 [ DataD [] (mkName "T")
11 [ PlainTV (mkName "a") ]
12 (Just StarT)
13 [ NormalC
14 (mkName "MkT")
15 [ ( Bang NoSourceUnpackedness NoSourceStrictness
16 , VarT (mkName "a")
17 )
18 , ( Bang NoSourceUnpackedness NoSourceStrictness
19 , VarT (mkName "a")
20 )
21 ]
22 , ForallC [PlainTV (mkName "a")]
23 [AppT (AppT EqualityT (VarT $ mkName "a" ) )
24 (ConT $ mkName "Int") ] $
25 RecGadtC
26 [ (mkName "MkC")]
27 [ ( mkName "foo"
28 , Bang NoSourceUnpackedness NoSourceStrictness
29 , VarT (mkName "a")
30 )
31 , ( mkName "bar"
32 , Bang NoSourceUnpackedness NoSourceStrictness
33 , VarT (mkName "b")
34 )
35 ]
36 (AppT (ConT (mkName "T"))
37 (ConT (mkName "Int")))
38 ]
39 [] ])