X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=reader_monad.mdwn;h=b0f64867f8430fc8cbdb5aafd20ca3adbbf58e9f;hp=ef049d5b7b71a1362a8bdacd43276d46f52ec431;hb=5eafd339063de2c77f30a7c9aea2ed1c09bc7673;hpb=f08c2ba23b0d6ffec440219aa64f27ec7bd3ae62 diff --git a/reader_monad.mdwn b/reader_monad.mdwn index ef049d5b..b0f64867 100644 --- a/reader_monad.mdwn +++ b/reader_monad.mdwn @@ -244,7 +244,7 @@ That is, it takes as arguments a clause-type reader-monad `u`, and an entity-typ You can trace through what happens then if we apply \[[who(i)]] to (\[[spurned]] applied to \[[Alice]] and \[[i]]): - [[Alice spurned i]] = [[spurned]] [[Alice]] [[i]] + \[[Alice spurned i]] = \[[spurned]] \[[Alice]] \[[i]] = (lift2 S) (unit Alice) (lookup i) = bind (unit Alice) (fun x -> bind (lookup i) (fun y -> unit (S x y))) @@ -263,7 +263,7 @@ Substituting in the definition of `unit`, this is: And now supplying \[[Alice spurned i]] as an argument to \[[who(i)]], we get: - [[who(i): Alice spurned i]] = [[who(i)]] [[Alice spurned i]] + \[[who(i): Alice spurned i]] = \[[who(i)]] \[[Alice spurned i]] = (fun u v -> shift i v u) (fun e -> S Alice (lookup i e)) = fun v -> shift i v (fun e -> S Alice (lookup i e))