summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer/T14289c.hs
blob: 6e58df1a544b394a7ed6fc91289ce0228dade773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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)]]]


-}