Skip to content

Instantly share code, notes, and snippets.

@raichoo
Last active August 29, 2015 13:56
Show Gist options
  • Save raichoo/9342409 to your computer and use it in GitHub Desktop.
Save raichoo/9342409 to your computer and use it in GitHub Desktop.
module Main
foo : (Int -> Int -> Int) -> IO Int
foo f = mkForeign (FFun "%0(1,2)" [FFunction FInt (FFunction FInt FInt)] FInt) f
main : IO ()
main = print !(foo (+))
-- Version with Le pretty!
module Main
infixr 7 ~>
(~>) : FTy -> FTy -> FTy
(~>) a b = FFunction a b
foo : (Int -> Int -> Int) -> IO Int
foo f = mkForeign (FFun "%0(1,2)" [FInt ~> FInt ~> FInt] FInt) f
main : IO ()
main = print !(foo (+))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment