From 0b63a8e4950e4628c36f812210cfdf40a28be034 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sat, 30 Mar 2019 16:23:07 +0100 Subject: added simple ffi example calling c from hask --- ffi/barmain.hs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ffi/barmain.hs (limited to 'ffi/barmain.hs') diff --git a/ffi/barmain.hs b/ffi/barmain.hs new file mode 100644 index 0000000..07e81ae --- /dev/null +++ b/ffi/barmain.hs @@ -0,0 +1,6 @@ +foreign import ccall "exp" c_exp :: Double -> Double +foreign import ccall "bar" c_bar :: Double -> Double + +main = do + print $ c_exp 2 + print $ c_bar 2 -- cgit v1.2.3