diff options
author | bloodstalker <thabogre@gmail.com> | 2018-03-19 14:08:48 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-03-19 14:08:48 +0000 |
commit | 256aa3de2212dd77d80f4cf86c64f988b448bbc7 (patch) | |
tree | 2237b97f18bb6d5830e69bef7959f5726a6e3a4b /bruiser/hs/Safe.hs | |
parent | added a lua module for asmrewriter, will soon add docs. you can try the new m... (diff) | |
download | mutator-256aa3de2212dd77d80f4cf86c64f988b448bbc7.tar.gz mutator-256aa3de2212dd77d80f4cf86c64f988b448bbc7.zip |
some fixes
Diffstat (limited to '')
-rw-r--r-- | bruiser/hs/Safe.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bruiser/hs/Safe.hs b/bruiser/hs/Safe.hs new file mode 100644 index 0000000..8994e9e --- /dev/null +++ b/bruiser/hs/Safe.hs @@ -0,0 +1,9 @@ +{-#Language ForeignFunctionInterface#-} +module Safe where +import Foreign.C.Types +fibonacci :: Int -> Int +fibonacci n = fibs !! n + where fibs = 0 : 1: zipWith (+) fibs (tail fibs) +fibonacci_hs ::CInt -> CInt +fibonacci_hs = fromIntegral.fibonacci.fromIntegral +foreign export ccall fibonacci_hs::CInt->CInt |