summaryrefslogtreecommitdiff
path: root/ffi/Foo.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ffi/Foo.hs')
-rw-r--r--ffi/Foo.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/ffi/Foo.hs b/ffi/Foo.hs
new file mode 100644
index 0000000..286a8bf
--- /dev/null
+++ b/ffi/Foo.hs
@@ -0,0 +1,10 @@
+module Foo where
+
+foreign export ccall foo :: Int -> IO Int
+
+foo :: Int -> IO Int
+foo n = return (length (f n))
+
+f :: Int -> [Int]
+f 0 = []
+f n = n:(f (n-1))