[Haskell-cafe] FFI basics

Donald Bruce Stewart dons at cse.unsw.edu.au
Sat Feb 10 03:21:58 EST 2007


bulat.ziganshin:
> Hello Yitzchak,
> 
> Friday, February 9, 2007, 3:23:53 PM, you wrote:
> 
> > I would like to use FFI for the first time. Can someone
> > give me a really, really simple complete example?
> 
> nothing can be easier
> 
> main = print (c_mysin 1.0)
> 
> foreign import ccall "mysin.h mysin"
>   c_mysin :: Double -> Double

Shouldn't that be CDouble? At least for Int/CInt you can hit troubles on
64 bit machines...

-- Don


More information about the Haskell-Cafe mailing list