summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer/T13550.hs
blob: 90a70aa4875301ff3681321a115a927643e8526d (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-}
module Bug where

$([d| type family Foo a b
      type instance Foo (Maybe a) b = Either (Maybe a) (Maybe b)

      data family Bar a b
      data instance Bar (Maybe a) b = BarMaybe (Maybe a) (Maybe b)
    |])

{-
    type instance Foo (Maybe a) b = Either (Maybe a) (Maybe b)

becomes

[TySynInstD Bug.Foo
  (TySynEqn
    [AppT
      (ConT GHC.Base.Maybe)
      (VarT a_6989586621679027317)
     ,VarT b_6989586621679027318]
    (AppT
      (AppT
        (ConT Data.Either.Either)
        (AppT
          (ConT GHC.Base.Maybe)
          (VarT a_6989586621679027317)
        )
      )
      (AppT (ConT GHC.Base.Maybe) (VarT b_6989586621679027318))
    )
  )
]

    data instance Bar (Maybe a) b = BarMaybe (Maybe a) (Maybe b)

becomes

[DataInstD [] Bug.Bar
  [AppT
    (ConT GHC.Base.Maybe)
    (VarT a_6989586621679027707)
  ,VarT b_6989586621679027708
  ]
  Nothing
  [NormalC
    BarMaybe_6989586621679027706
    [(Bang
        NoSourceUnpackedness
        NoSourceStrictness
      ,AppT
        (ConT GHC.Base.Maybe)
         (VarT a_6989586621679027707)
      )
    ,(Bang
       NoSourceUnpackedness
       NoSourceStrictness
     ,AppT
       (ConT GHC.Base.Maybe)
       (VarT b_6989586621679027708)
     )
    ]
  ]
  []]


-}