snix/third_party/bazel/rules_haskell/tests/haskell_doctest/Foo.hs

14 lines
229 B
Haskell

{-# 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)