mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-11-15 01:25:05 +03:00
5ea6aa0520
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.
13 lines
335 B
Idris
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
|