Add kind equalities to GHC.
[ghc.git] / testsuite / tests / th / T7021a.hs
1 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
2 {-# LANGUAGE ConstraintKinds, TemplateHaskell, PolyKinds, TypeFamilies, RankNTypes #-}
3
4 module T7021a where
5
6 import GHC.Exts
7 import Language.Haskell.TH
8
9 type IOable a = (Show a, Read a)
10 type family ALittleSilly :: Constraint
11
12 data Proxy a = Proxy
13
14 foo :: IOable a => a
15 foo = undefined
16
17 baz :: a b => Proxy a -> b
18 baz = undefined
19
20 bar :: ALittleSilly => a
21 bar = undefined
22
23 test :: Q Exp
24 test = do
25 Just fooName <- lookupValueName "foo"
26 Just bazName <- lookupValueName "baz"
27 Just barName <- lookupValueName "bar"
28 reify fooName
29 reify bazName
30 reify barName
31 [t| forall a. (Show a, (Read a, Num a)) => a -> a |]
32 [| \_ -> 0 |]