X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=hints%2Fassignment_4_hint_3_alternate_1.mdwn;h=f75bad0efce8079169eac9a41b99cbd76c95e31f;hp=f0b720cd0d21b46c70c06bf2a39a241f559a7f44;hb=f212354152a53c6a3ab018c7874570c600f463b9;hpb=004782ebd72fdb95badbaef55d2faaa6c49f3bed diff --git a/hints/assignment_4_hint_3_alternate_1.mdwn b/hints/assignment_4_hint_3_alternate_1.mdwn index f0b720cd..f75bad0e 100644 --- a/hints/assignment_4_hint_3_alternate_1.mdwn +++ b/hints/assignment_4_hint_3_alternate_1.mdwn @@ -18,12 +18,12 @@ Alternate strategy for Y1, Y2 or, expanded into the form we've been working with: - let u = Y (\u g x. (\f. A) (u g)) in - let g = Y ( \g y. (\f. B) (u g)) in + let u = Y (\u g. (\f x. A) (u g)) in + let g = Y ( \g. (\f y. B) (u g)) in let f = u g in C - We abstract the Y1 and Y2 combinators from this as follows: + We could abstract Y1 and Y2 combinators from this as follows: let Yu = \ff. Y (\u g. ff ( u g ) g) in let Y2 = \ff gg. Y ( \g. gg (Yu ff g ) g) in @@ -35,22 +35,24 @@ Alternate strategy for Y1, Y2 * Here's the same strategy extended to three mutually-recursive functions. `f`, `g` and `h`: - let v = Y (\v g h x. (\f. A) (v g h)) in - let w = Y ( \w h x. (\g. (\f. B) (v g h)) (w h)) in - let h = Y ( \h x. (\g. (\f. C) (v g h)) (w h)) in + let v = Y (\v g h. (\f x. A) (v g h)) in + let w = Y ( \w h. (\g. (\f y. B) (v g h)) (w h)) in + let h = Y ( \h. (\g. (\f z. C) (v g h)) (w h)) in let g = w h in let f = v g h in D +