From: Jim Pryor Date: Sun, 5 Dec 2010 14:33:24 +0000 (-0500) Subject: tree_monadize tweaks X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=874a793d588bc067f680d5fa5dd9d57d2aa191db;hp=6bdd5bdd6e49ead61951cecff822c161f28098ca tree_monadize tweaks Signed-off-by: Jim Pryor --- diff --git a/code/tree_monadize.ml b/code/tree_monadize.ml index c751b36e..08b8d690 100644 --- a/code/tree_monadize.ml +++ b/code/tree_monadize.ml @@ -184,7 +184,7 @@ module TreeCont = Tree_monadizer2(Continuation_monad);; *) -let int_readerize : int -> int reader = +let int_readerize : int -> int Reader_monad.monad = fun (a : int) -> fun (env : int -> int) -> env a;; (* int_readerize takes an int and returns a Reader monad that @@ -202,7 +202,7 @@ TreeReader.monadize int_readerize t1 env;; -let incrementer : int -> int state = +let incrementer : int -> int State_monad.monad = fun (a : int) -> fun s -> (a, s+1);; (* incrementer takes an 'a and returns it wrapped in a @@ -221,7 +221,7 @@ TreeList.monadize (fun i -> [ [i;i*i] ]) t1;; (* do nothing *) let initial_continuation = fun t -> t in -TreeCont.monadize cont_unit t1 initial_continuation;; +TreeCont.monadize Continuation_monad.unit t1 initial_continuation;; (* convert tree to list of leaves *) let initial_continuation = fun t -> [] in