summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/ClosedFam2TH.hs
blob: cd2dc2de60eada73101e3862593e23cab44fdd4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE TemplateHaskell, TypeFamilies, PolyKinds #-}

module ClosedFam2 where

import Language.Haskell.TH

$( return [ ClosedTypeFamilyD (mkName "Equals")
                              [ KindedTV (mkName "a") (VarT (mkName "k"))
                              , KindedTV (mkName "b") (VarT (mkName "k")) ]
                              Nothing
                              [ TySynEqn [ (VarT (mkName "a"))
                                         , (VarT (mkName "a")) ]
                                         (ConT (mkName "Int"))
                              , TySynEqn [ (VarT (mkName "a"))
                                         , (VarT (mkName "b")) ]
                                         (ConT (mkName "Bool")) ] ])

a :: Equals b b
a = (5 :: Int)

b :: Equals Int Bool
b = False