X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?a=blobdiff_plain;f=hints%2Fassignment_4_hint_3.mdwn;h=9cfef8adb6daedb127ffb6c6cbe452fa921f17cb;hb=658a3e2cf942421756632c2ee80084a06739a4eb;hp=48063d3a785193020bbb93e0c76f191ca080f14f;hpb=154e84d6eb3f8aad60181f24327671ff8f090cbc;p=lambda.git diff --git a/hints/assignment_4_hint_3.mdwn b/hints/assignment_4_hint_3.mdwn index 48063d3a..9cfef8ad 100644 --- a/hints/assignment_4_hint_3.mdwn +++ b/hints/assignment_4_hint_3.mdwn @@ -1,2 +1,26 @@ -Hints for enumerating a tree's fringe. +Hints for Y1,Y2. + +* Begin by trying to define `X1` and `X2` directly, then once they're working, you can abstract back to a pair of combinators `Y1` and `Y2` that generate `X1` and `X2` for a given pair of arguments `T1` and `T2`. + + You want: + + X1 <~~> T1 X1 X2 and + X2 <~~> T2 X1 X2 + +* X1 is presumably going to have some form like: + + (\elem1 elem2 ... (T1 + (do-something-with-the-elems-to-make-X1) + (do-something-with-the-elems-to-make-X2) + )) + some-elem1 some-elem2 ... + + Right? What will the form of X2 be? + +* Can you see how to go on? + +* Call the displayed abstract above `(\elem1 elem2 ... (...))` "elem0". What's the relation between `X1`, `elem0`, `elem1`, `elem2`...? + +* Go on, now you can do it. +