about summary refs log tree commit diff
path: root/third_party/bazel/rules_haskell/tests/haskell_doctest/Foo.hs
blob: d2c97b77aeb3e116a2c0665de9235b96ccc5dd63 (plain) (blame)
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)