add Haskell to Rust example
This commit is contained in:
10
haskell-to-rust/src/Main.hs
Normal file
10
haskell-to-rust/src/Main.hs
Normal file
@@ -0,0 +1,10 @@
|
||||
{-# LANGUAGE ForeignFunctionInterface #-}
|
||||
|
||||
import Foreign.C
|
||||
|
||||
foreign import ccall "double_input" doubleInput :: CInt -> CInt
|
||||
|
||||
main = do
|
||||
let input = 4
|
||||
let output = doubleInput input
|
||||
putStrLn $ show input ++ " * 2 = " ++ show output
|
||||
Reference in New Issue
Block a user