1 2 3 4 5 6 7 8 9 10 11 12 13 14
{-# LANGUAGE ForeignFunctionInterface #-} module Foo (foo) where import Foreign.C.Types (CInt(..)) foreign import ccall "c_add_one" c_add_one :: CInt -> CInt -- | -- >>> foo -- 5 foo :: Int foo = fromIntegral (c_add_one 4)