git @ Cat's Eye Technologies Lanthorn / 1.0-2022.0921 eg / factorial-open.lanthorn
1.0-2022.0921

Tree @1.0-2022.0921 (Download .tar.gz)

factorial-open.lanthorn @1.0-2022.0921raw · history · blame

1
2
3
4
5
let
    fact0 = fun(n, f) -> if eq(n,1) then 1 else mul(n,f(sub(n, 1), f))
    fact  = fun(n)    -> fact0(n, fact0)
in
    fact(5)