1 Alternate strategy for Y1, Y2
3 * This is (in effect) the strategy used by OCaml. The mutually recursive:
6 f x = A ; A may refer to f or g
8 g y = B ; B may refer to f or g
12 is implemented using regular, non-mutual recursion, like this (`u` is a variable not occurring free in `A`, `B`, or `C`):
14 let rec u g x = (let f = u g in A)
15 in let rec g y = (let f = u g in B)
19 or, expanded into the form we've been working with:
21 let u = Y (\u g x. (\f. A) (u g)) in
22 let g = Y ( \g y. (\f. B) (u g)) in
26 * Here's the same strategy extended to three mutually-recursive functions. `f`, `g` and `h`:
28 let u = Y (\u g h x. (\f. A) (u g h)) in
29 let w = Y ( \w h x. (\g. (\f. B) (u g h)) (w h)) in
30 let h = Y ( \h x. (\g. (\f. C) (u g h)) (w h)) in