Advertisement
tarruda

haskell v8

Nov 19th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {-# LANGUAGE ForeignFunctionInterface #-}
  2.  
  3. module V8
  4.     (
  5.     hello
  6.     )
  7.   where
  8.  
  9. import Foreign.C.Types
  10. import Foreign.C.String
  11.  
  12.  
  13. foreign import ccall "hello"
  14.   c_hello :: IO CString
  15.  
  16.  
  17. hello :: IO ()
  18. hello = do
  19.     cstr <- c_hello
  20.     str <- peekCString cstr
  21.     putStrLn str
  22.     return ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement