diff options
Diffstat (limited to 'testsuite/tests/printer/T14289c.hs')
-rw-r--r-- | testsuite/tests/printer/T14289c.hs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/testsuite/tests/printer/T14289c.hs b/testsuite/tests/printer/T14289c.hs new file mode 100644 index 0000000000..6e58df1a54 --- /dev/null +++ b/testsuite/tests/printer/T14289c.hs @@ -0,0 +1,40 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeOperators #-} +{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-} + +import Language.Haskell.TH + +$([d| data Foo a = Foo a deriving (a ~ a) |]) + +{- + +Note: to debug + +~/inplace/bin/ghc-stage2 --interactive +load the following +---------------------------------------- +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE TemplateHaskell #-} +{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-} + +import Language.Haskell.TH + +class (a `C` b) c + +main :: IO () +main + = putStrLn $([d| data Foo a = Foo a deriving (a ~ a) |] >>= stringE . show) + +---------------------------------------- +Becomes + +[DataD [] Foo_0 [PlainTV a_2] Nothing + [NormalC Foo_1 [(Bang NoSourceUnpackedness NoSourceStrictness,VarT a_2)]] + [DerivClause Nothing + [AppT (AppT EqualityT (VarT a_2)) + (VarT a_2)]]] + + +-} |