summaryrefslogtreecommitdiff
path: root/ffi/barmain.hs
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2019-03-30 16:23:07 +0100
committerMiguel <m.i@gmx.at>2019-03-30 16:23:07 +0100
commit0b63a8e4950e4628c36f812210cfdf40a28be034 (patch)
tree1b1b7914f56752379310781ea01dc9c1192e946f /ffi/barmain.hs
parentb45e37124d855bdf3365e8202559c45cf28e9d88 (diff)
added simple ffi example calling c from hask
Diffstat (limited to 'ffi/barmain.hs')
-rw-r--r--ffi/barmain.hs6
1 files changed, 6 insertions, 0 deletions
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