1 -- !!! cc005 -- foreign export declarations
2 module ShouldCompile (d8) where
9 foreign export ccall dynamic d8 :: (Int -> IO ()) -> IO Addr
11 -- exporting functions
13 m_stdcall :: Int -> IO Int
14 m_stdcall x = return x
18 foreign export ccall "m1" doo :: Int -> IO Int
20 doo :: Eq a => a -> IO Int
23 foreign export ccall "listAppend" plusplus :: StablePtr [a] -> StablePtr [a] -> IO (StablePtr [a])
25 plusplus :: StablePtr [a] -> StablePtr [a] -> IO (StablePtr [a])
27 l1 <- deRefStablePtr x
28 l2 <- deRefStablePtr y
29 makeStablePtr (l1 ++ l2)
31 foreign export ccall "m11" m_stdcall :: Int -> IO Int
33 m_ccall :: Int -> Int -> IO Int
34 m_ccall x y = return (x-y)
36 foreign export ccall "m2" m_ccall :: Int -> Int -> IO Int
38 foreign export ccall "putcha" putChar :: Char -> IO ()
40 foreign export stdcall "Math" "sin" my_sin :: Double -> IO Double
41 foreign export stdcall "Math" "cos" my_cos :: Double -> IO Double
46 foreign export stdcall "m111" m8 :: IO Int8
47 foreign export stdcall "m22" m16 :: IO Int16
48 foreign export stdcall "m3" m32 :: IO Int32
49 foreign export stdcall "m4" m64 :: IO Int64
56 foreign export stdcall dynamic d8 :: (Addr -> IO Int8) -> IO Addr
57 foreign export stdcall dynamic d16 :: (Addr -> IO Int16) -> IO Addr
58 foreign export stdcall dynamic d32 :: (Addr -> IO Int32) -> IO Addr
59 foreign export stdcall dynamic d64 :: (Addr -> IO Int64) -> IO Addr
68 foreign export ccall "kitchen"
71 -- -> MutableByteArray Int RealWorld
88 foreign export ccall dynamic
89 sink2 :: (--ForeignObj
91 -- -> MutableByteArray Int RealWorld