Skip to content

Commit

Permalink
added a simple working example
Browse files Browse the repository at this point in the history
  • Loading branch information
crockeea committed Jun 4, 2016
1 parent c4b2e49 commit 154e202
Show file tree
Hide file tree
Showing 29 changed files with 62 additions and 909 deletions.
11 changes: 11 additions & 0 deletions Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import Data.Int

main :: IO ()
main = do
let x = 123
q = 7
helloC x q
putStrLn $ "Hello from Haskell! " ++ (show x) ++ " = " ++ (show $ x `mod` q) ++ " mod " ++ (show q)

foreign import ccall unsafe "helloC" helloC :: Int64 -> Int64 -> IO ()
33 changes: 0 additions & 33 deletions README

This file was deleted.

15 changes: 15 additions & 0 deletions cpptest.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: cpptest
version: 0.3.0.0
build-type: Simple
cabal-version: >= 1.10

-- For information on compiling C with cabal: http://blog.ezyang.com/2010/06/setting-up-cabal-the-ffi-and-c2hs/

executable cpptest
default-language: Haskell2010
Include-dirs: src
C-sources: src/zq.cpp, src/main.cpp
main-is: Main.hs
extra-libraries: stdc++

build-depends: base
9 changes: 0 additions & 9 deletions hlibWithC/clib/generalfuncs.c

This file was deleted.

9 changes: 0 additions & 9 deletions hlibWithC/clib/l.c

This file was deleted.

17 changes: 0 additions & 17 deletions hlibWithC/clib/tensorTypes.h

This file was deleted.

22 changes: 0 additions & 22 deletions hlibWithC/hlibWithC.cabal

This file was deleted.

14 changes: 0 additions & 14 deletions hlibWithC/src/HLibWithC.hs

This file was deleted.

12 changes: 0 additions & 12 deletions hlibWithC/tests/Main.hs

This file was deleted.

9 changes: 0 additions & 9 deletions hlibWithCPP/clib/generalfuncs.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions hlibWithCPP/clib/l.cpp

This file was deleted.

15 changes: 0 additions & 15 deletions hlibWithCPP/clib/tensorTypes.h

This file was deleted.

22 changes: 0 additions & 22 deletions hlibWithCPP/hlibWithCPP.cabal

This file was deleted.

14 changes: 0 additions & 14 deletions hlibWithCPP/src/HLibWithCPP.hs

This file was deleted.

12 changes: 0 additions & 12 deletions hlibWithCPP/tests/Main.hs

This file was deleted.

Loading

0 comments on commit 154e202

Please sign in to comment.