summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T7021a.hs
blob: b07ef55196beea505432117a98ec55a80bb1e77e (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
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE ConstraintKinds, TemplateHaskell, PolyKinds, TypeFamilies, RankNTypes #-}

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| forall a. (Show a, (Read a, Num a)) => a -> a |]
    [| \_ -> 0 |]