blob: b93b51cd6bfeb96e53358d67e5f88a2908d79579 (
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
|