Commits

Anonymous committed 5e0c8f7

[Cf_scmonad] Changed [lift] to [liftC] and added [liftS].

Comments (0)

Files changed (3)

 
 --- [Cf_scmonad]
     Added the [bridge] and [eval] functions.
+    Changed [lift] to [liftC] and added [liftS].
     Cleaned up the documentation.
 
 --- [Cf_cmonad]
 let modify c f s = f () (c s)
 let field r f s = f (r s) s
 let down m s f = m (fun () -> f) s
-let lift = Op.( >>= )
+let liftC = Op.( >>= )
+let liftS m c s = let a, s = m s in c a s
 let eval m s x = m (fun () _ -> x) s
 let bridge x b m _ s = b (m (fun () _ -> x) s)
 

cf/cf_scmonad.mli

 *)
 val down: ('s, 'x, unit) t -> 's -> ('x, 's) Cf_cmonad.t
 
-(** Use [lift m] to lift a stateless continuation monad [m] into a
+(** Use [liftC m] to lift a stateless continuation monad [m] into a
     state-continuation monad.
 *)
-val lift: ('x, 'a) Cf_cmonad.t -> ('s, 'x, 'a) t
+val liftC: ('x, 'a) Cf_cmonad.t -> ('s, 'x, 'a) t
+
+(** Use [liftS m] to lift a state monad [m] into a state-continuation monad. *)
+val liftS: ('s, 'a) Cf_smonad.t -> ('s, 'x, 'a) t
 
 (** Use [eval m s] to evaluate the state-continuation monad [m] with initial
 	state [s] to produce a function from an initial context to a final context.