[project @ 1997-05-26 05:58:06 by sof]
[ghc-hetmet.git] / ghc / compiler / tests / ccall / cc007.hs
1 --!!! cc007 -- ccall with synonyms, polymorphic type variables and user type variables.
2 module Test where
3
4 import GlaExts
5
6 -- Since I messed up the handling of polymorphism originally, I'll
7 -- explicitly test code with UserSysTyVar (ie an explicit polymorphic
8 -- signature)
9
10 foo = _ccall_ f `thenADR` \ a -> returnPrimIO (a + 1)
11  where 
12    thenADR :: PrimIO a -> (a -> PrimIO b) -> PrimIO b
13    thenADR = thenPrimIO
14
15 -- and with a PolySysTyVar (ie no explicit signature)
16
17 bar = _ccall_ f `thenADR` \ a -> returnPrimIO (a + 1)
18  where 
19    -- thenADR :: PrimIO a -> (a -> PrimIO b) -> PrimIO b
20    thenADR = thenPrimIO
21
22 -- and with a type synonym
23
24 type INT = Int
25 barfu :: PrimIO INT
26 barfu = _ccall_ b
27