# 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;;
This sentence means (roughly)
- &Forall; 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
that is intended to represent non-deterministic computations as a tree.
-What's this have to do with tree\_mondadize?
+What's this have to do with tree\_monadize?
--------------------------------------------
So we've defined a Tree monad: