X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=manipulating_trees_with_monads.mdwn;h=16bbd384885b3b088bab49dfdf3f0d758a8d9a63;hp=87ce974f44dad35532ed324c45c7f5bb714a0134;hb=8431bdd30785d6fe5f551219823d41c640918df4;hpb=54bd68bd1853a9dd2b05813155e53dcf933d8f14 diff --git a/manipulating_trees_with_monads.mdwn b/manipulating_trees_with_monads.mdwn index 87ce974f..16bbd384 100644 --- a/manipulating_trees_with_monads.mdwn +++ b/manipulating_trees_with_monads.mdwn @@ -360,8 +360,14 @@ interesting functions for the first argument of `tree_monadize`: # tree_monadize (fun a -> fun k -> 1 + k a) t1 (fun t -> 0);; - : int = 5 -We could simulate the tree state example too, but it would require -generalizing the type of the Continuation monad to +[To be fixed: exactly which kind of monad each of these computations simulates.] + +We could simulate the tree state example too by setting the relevant +type to `('a, 'state -> 'result) continuation`. +In fact, Andre Filinsky has suggested that the continuation monad is +able to simulate any other monad (Google for "mother of all monads"). + +We would eventually want to generalize the continuation type to type ('a, 'b, 'c) continuation = ('a -> 'b) -> 'c;; @@ -525,7 +531,7 @@ quantification. This sentence means (roughly) - ∀ x . yesterday(saw x) john + forall x . yesterday(saw x) john That is, the quantifier *everyone* contributes a variable in the direct object position, and a universal quantifier that takes scope