13 lines
429 B
Plaintext
Executable file
13 lines
429 B
Plaintext
Executable file
letrec loop = fun fcond -> fun fnext -> fun feval -> fun arg -> fun acc ->
|
|
if ((fcond) arg) then acc
|
|
else let iter = ((feval) arg) acc in
|
|
let next = (fnext) arg in
|
|
((((((loop) fcond) fnext) feval) next) iter)
|
|
|
|
in
|
|
let done = fun x -> (x = 0) in
|
|
let next = fun x -> (x - 1) in
|
|
let eval = fun x -> fun y -> x * y in
|
|
((((((loop) done) next) eval) 5) 1)
|
|
|