summaryrefslogtreecommitdiff
path: root/ffi/Foo.hs
blob: 286a8bfc4d6b1c04d09156332ac058fb384121b8 (plain)
1
2
3
4
5
6
7
8
9
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))