code-srv-test/dita-ot-3.6/docsrc/resources/fact.hs
2021-03-23 22:38:58 +00:00

6 lines
102 B
Haskell

-- START-FACT
fact :: Int -> Int
fact 0 = 1
fact n = n * fact (n-1)
-- END-FACT
main = print $ fact 7