
19 Oct
2002
19 Oct
'02
3:41 p.m.
Hello all, I am trying to learn how to use FFI with GHC. I've tried the example in GHC's user's guide but it didn't worked. Here it is: 1) The haskell code =================== [bracaman@tucano hib]$ cat foo.hs 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)) 2) The error ============ [bracaman@tucano hib]$ ghc -c foo.hs foo.hs:3: Type signature given for an expression [bracaman@tucano hib]$ I just can't understand why this is happening... can someone, please, help? Thank you in advance, João Ferreira