File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -29,31 +29,23 @@ int max(int x1, int x2) {
2929}
3030~~~
3131
32- A different `src/Lib.hs` Haskell module , including a Haskell foreign import
33- declaration making use of the C `max` function:
32+ A different Haskell module in source file `src/Lib.hs`, including a Haskell
33+ foreign import declaration making use of the C `max` function:
3434~~~haskell
35- module Lib
36- ( someFunc
37- , c_max
38- ) where
39-
40- someFunc :: IO ()
41- someFunc = putStrLn "someFunc"
35+ module Lib ( c_max ) where
4236
4337foreign import ccall "max" c_max :: Int -> Int -> Int
4438~~~
4539
46- A different ` app/Main.hs ` Haskell module , making use of the Haskell ` c_max `
47- function now exported from module ` Lib ` :
40+ A different Haskell module in source file ` app/Main.hs ` , making use of the
41+ Haskell function ` c_max ` exported from module ` Lib ` :
4842~~~ haskell
4943module Main ( main ) where
5044
51- import Lib ( c_max , someFunc )
45+ import Lib ( c_max )
5246
5347main :: IO ()
54- main = do
55- someFunc
56- print $ c_max 10 100
48+ main = print $ c_max 10 100
5749~~~
5850
5951The package's ` package.yaml ` file (simplied), used to create the package's
@@ -64,7 +56,6 @@ spec-version: 0.36.0
6456name : c-example
6557version : 0.1.0.0
6658
67- # Hpack 0.36.1 and earlier does not support Cabal's 'includes' field
6859extra-source-files :
6960- include/my-library.h
7061
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ extra-source-files:
5858 doc/glossary.md
5959 doc/GUIDE.md
6060 doc/GUIDE_advanced.md
61+ doc/haskell_and_c_code.md
6162 doc/hoogle_command.md
6263 doc/hpc_command.md
6364 doc/ide_command.md
You can’t perform that action at this time.
0 commit comments