mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-22 11:13:36 +03:00
15 lines
329 B
Idris
15 lines
329 B
Idris
|
import System.FFI
|
||
|
|
||
|
libexternal : String -> String
|
||
|
libexternal fn = "C:" ++ fn ++ ",libexternalc,externalc.h"
|
||
|
|
||
|
%foreign (libexternal "add")
|
||
|
add : Int -> Int -> Int
|
||
|
|
||
|
%foreign (libexternal "fastfibsum")
|
||
|
fastfibsum : Int -> Int
|
||
|
|
||
|
main : IO ()
|
||
|
main = do
|
||
|
printLn $ show (add 50 23)
|
||
|
printLn $ show ([fastfibsum x | x <- [0..10]])
|