Feature: limited form of recursion
A non mutual, tail recursive function definition:
let rec f x = if .. then res else f y
in
..
is equivalent with:
let f = Loop.left (fun x ->
if .. then Right res
else Left y) x
in
..
- When exiting the recursion, use
Right
- When continuing the recursion, use
Left
Edited by Jun Furuse