X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?a=blobdiff_plain;f=zipper-lists-continuations.mdwn;h=0f0662f782bd35aa7b9e3b0aad161d877d5c857e;hb=60a80b81826715a6d5a8e9c53c3d19ea25b8dbdf;hp=a9d0e8faa237e271f7ca44b8de76d80b5d9afaa5;hpb=449ca8e544f4f19ddfc567850014d94b6b985598;p=lambda.git diff --git a/zipper-lists-continuations.mdwn b/zipper-lists-continuations.mdwn index a9d0e8fa..0f0662f7 100644 --- a/zipper-lists-continuations.mdwn +++ b/zipper-lists-continuations.mdwn @@ -55,13 +55,18 @@ so we have to abstract over that variable to balance the books: fun e -> f (u e) ... This types to `env -> 'b reader`, but we want to end up with `env -> -'b`. The easiest way to turn a 'b reader into a 'b is to apply it to +'b`. Once again, the easiest way to turn a `'b reader` into a `'b` is to apply it to an environment. So we end up as follows: r_bind (u:'a reader) (f:'a -> 'b reader):('b reader) = f (u e) e And we're done. +[This bind is a simplified version of the careful `let a = u e in ...` +constructions we provided in earlier lectures. We use the simplified +versions here in order to emphasize similarities of structure across +monads; the official bind is still the one with the plethora of `let`'s.] + The **State Monad** is similar. We somehow intuit that we want to use the following type constructor: