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

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