summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi/should_compile/cc001.hs
blob: cd7318d000cf11862117dfdd6192458a0433287a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- !!! cc001 -- ccall with standard boxed arguments and results

module ShouldCompile where

-- simple functions

foreign import ccall unsafe "a" a :: IO Int

foreign import ccall unsafe "b" b :: Int -> IO Int

foreign import ccall unsafe "c" 
  c :: Int -> Char -> Float -> Double -> IO Float

-- simple monadic code

d =	a		>>= \ x ->
	b x		>>= \ y ->
	c y 'f' 1.0 2.0