git @ Cat's Eye Technologies Lanthorn / experiment-in-modules eg / different-arities.lanthorn
experiment-in-modules

Tree @experiment-in-modules (Download .tar.gz)

different-arities.lanthorn @experiment-in-modulesraw · history · blame

1
2
3
4
5
letrec
    oddsump  = fun(x,y,z) -> if eq(add(x, add(y, z)), add(y, z)) then false else evensump(sub(x, 1), add(y, z))
    evensump = fun(p,q)   -> if eq(add(p, q), q) then true else oddsump(sub(p, 1), 1, sub(q, 1))
in
    oddsump(5,3,1)