Skip to content

Instantly share code, notes, and snippets.

@raichoo
Created September 13, 2013 22:08
Show Gist options
  • Save raichoo/6556748 to your computer and use it in GitHub Desktop.
Save raichoo/6556748 to your computer and use it in GitHub Desktop.
Positional arguments for the javascript FFI in Idris
module Main
FIO : FTy
FIO = FAny (IO ())
foo : String -> String -> IO ()
foo a b = putStrLn $ a ++ b
test : String -> (String -> String -> IO ()) -> IO ()
test s f =
mkForeign (
FFun "%1(%0,%0)" [ FString
, FFunction FString (FFunction FString FIO)
] FUnit
) s f
main : IO ()
main = test "foo" foo -- prints "foofoo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment