blob: bd191336dd6ed8b613646e761e7f02344fd49948 (
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
|
{-# LANGUAGE ConstraintKinds, TemplateHaskell, PolyKinds, TypeFamilies #-}
module T7021a where
import GHC.Prim
import Language.Haskell.TH
type IOable a = (Show a, Read a)
type family ALittleSilly :: Constraint
data Proxy a = Proxy
foo :: IOable a => a
foo = undefined
baz :: a b => Proxy a -> b
baz = undefined
bar :: ALittleSilly => a
bar = undefined
test :: Q Exp
test = do
Just fooName <- lookupValueName "foo"
Just bazName <- lookupValueName "baz"
Just barName <- lookupValueName "bar"
reify fooName
reify bazName
reify barName
[t| (Show a, (Read a, Num a)) => a -> a |]
[| \_ -> 0 |]
|