summaryrefslogtreecommitdiff
path: root/testsuite/tests/impredicative/SystemF.hs
blob: b1f7f0ede960996c1ac5fadd13a0c0857539e5ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE ImpredicativeTypes #-}

module SystemF where
-- System-F examples


type Sid = forall a. a -> a

apply :: forall a b . (a -> b) -> a -> b
apply f g = f g

hr :: (forall a. a -> a) -> (Int,Bool)
hr f = (f 3,f True)

test0 = apply hr id   -- requires smart-app-arg

selfApp :: Sid -> Sid
selfApp x = (x::(Sid -> Sid)) x