Idris-dev/samples/javaffi.idr
Jan de Muijnck-Hughes 5ea6aa0520 Address semantic differences in putting things to STDOUT.
The changes are as follows:

+ `print` is for putting showable things to STDOUT.
+ `printLn` is for putting showable things to STDOUT with a new line
+ `putCharLn` for putting a single character to STDOUT, with a new line.

Effects has been updated accordingly.
2015-03-06 17:26:33 +00:00

13 lines
335 B
Idris

module Main
%include Java "com.google.common.math.IntMath"
%lib Java "com.google.guava:guava:14.0"
binom : Int -> Int -> IO Int
binom n k = mkForeign (FFun "IntMath.binomial" [FInt, FInt] FInt) n k
main : IO ()
main = do print "The number of possibilities in lotto is 49 choose 6:"
res <- binom 49 6
printLn res