week9 tweak
[lambda.git] / hints / assignment_10_hint.mdwn
index 3e0915a..66da6e7 100644 (file)
@@ -1,11 +1,11 @@
-We'll give you hint, but it will involve some extra work.
+We'll give you a hint, but it will require some extra thought.
 
 
-The hint is a solution to this exercise taken from the source code that accompanies the Glasgow Haskell Compiler. (Underneath /Control/Monad/State/Strict.hs).
+The hint is a solution to this exercise taken from the source code that accompanies the Glasgow Haskell Compiler (underneath */Control/Monad/State/Strict.hs*).
 
 We're not going to massage it in any way. If you want to make use of it, you'll have to figure out for yourself what's going on. This should be within your reach at this point. See our page on 
 
 We're not going to massage it in any way. If you want to make use of it, you'll have to figure out for yourself what's going on. This should be within your reach at this point. See our page on 
-[[translating between OCaml Scheme and Haskell]] for guidance.
+[[translating between OCaml Scheme and Haskell]] for guidance. See our [[state monad tutorial]] for explanation of `get` and `put`.
 
 
-Also, you'll notice that this solution targets trees with labels on their inner nodes, instead of on their leaves. You should be able to get this to work for leaf-labeled trees, too.
+Also, you'll notice that this solution targets trees with labels on their inner nodes, instead of on their leaves. It shouldn't be too hard to get a similar strategy to work for leaf-labeled trees.
 
 
        data Tree a = Nil | Node a (Tree a) (Tree a) deriving (Show, Eq)
 
 
        data Tree a = Nil | Node a (Tree a) (Tree a) deriving (Show, Eq)
@@ -46,5 +46,7 @@ Also, you'll notice that this solution targets trees with labels on their inner
        numTree t = evalState (numberTree t) []
 
        testTree = Node "Zero" (Node "One" (Node "Two" Nil Nil) (Node "One" (Node "Zero" Nil Nil) Nil)) Nil
        numTree t = evalState (numberTree t) []
 
        testTree = Node "Zero" (Node "One" (Node "Two" Nil Nil) (Node "One" (Node "Zero" Nil Nil) Nil)) Nil
-       numTree testTree => Node 0 (Node 1 (Node 2 Nil Nil) (Node 1 (Node 0 Nil Nil) Nil)) Nil
+       numTree testTree
+       
+       ~~> Node 0 (Node 1 (Node 2 Nil Nil) (Node 1 (Node 0 Nil Nil) Nil)) Nil