Since `dpm`s are to be a monad, we have to define a unit and a bind. These are just modeled on the unit and bind for the State monad:
- let unit_dpm (value : 'a) : 'a dpm = fun (r, h) -> (value, r, h);;
+ let dpm_unit (value : 'a) : 'a dpm = fun (r, h) -> (value, r, h);;
- let bind_dpm (u : 'a dpm) (f : 'a -> 'b dpm) : 'b dpm =
+ let dpm_bind (u : 'a dpm) (f : 'a -> 'b dpm) : 'b dpm =
fun (r, h) ->
let (a, r', h') = u (r, h)
in let u' = f a