summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T12503.hs
blob: d1e3f27a93d32a4d2c62a2faabec779609fc74c2 (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
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module T12503 where

import Language.Haskell.TH

data T1 k
class C1 a

$(do TyConI (DataD [] tName [ KindedTV kName () kKind] _ _ _)
       <- reify ''T1
     d <- instanceD (cxt [])
                    (conT ''C1 `appT`
                      (conT tName `appT` sigT (varT kName) kKind))
                    []
     return [d])

data family T2 (a :: b)
data instance T2 b
class C2 a

$(do FamilyI (DataFamilyD tName _ _) [DataInstD [] _ tyVar _ _ _]
       <- reify ''T2
     d <- instanceD (cxt [])
                    (conT ''C2 `appT` return tyVar)
                    []
     return [d])