Skip to content
Sohei Yamaga edited this page Sep 30, 2017 · 2 revisions

sample code

main :: Int
main := fact 5;

fact :: Int -> Int
fact n := let
    iszero :: Int -> Bool
    iszero n := n = 0;
    in if iszero n then 1
                   else n * fact (n - 1);
Clone this wiki locally