Another sample of F# continuation passing style (CPS).
let F01 list =
let rec FF list cont =
match list with
| [] -> cont(0)
| h::t -> FF t (fun x -> cont(h+x))
FF list (fun x-> x)
No comments:
Post a Comment