M src/revops/revops.ml +2 -4
@@ 1,12 1,10 @@
(* Implementation for reversible operations. *)
-open Core.Std
-
module Monad = struct
type 'a t = 'a
let ( >>= ) v f = f v
- let return = Fn.id
- let protect = protect
+ let return = CCFun.id
+ let protect ~f ~finally = CCFun.finally ~f ~h:finally
end
(* Functor application, see revops_fn.ml *)
M src/revops/revops_fn.ml +2 -4
@@ 1,7 1,5 @@
(* Implementation for reversible operations. *)
-open Core.Std
-
module Make = functor (Monad : Revops_intf.MONAD) -> struct
module M = Monad
@@ 54,8 52,8 @@ module Make = functor (Monad : Revops_in
let compose_tuple first second =
compose
(fun l r -> return (l, r))
- (Fn.compose return fst)
- (Fn.compose return snd)
+ (CCFun.compose fst return)
+ (CCFun.compose snd return)
first
second
M src/revops/revops_intf.ml +1 -1
@@ 3,7 3,7 @@ module type MONAD = sig
val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t
val return : 'a -> 'a t
- val protect : f:(unit -> 'a t) -> finally:(unit -> unit t) -> 'a t
+ val protect : f:(unit -> 'a t) -> finally:(unit -> 'b) -> 'a t
end
module type S = sig
M src/revops/revops_sys.ml +1 -3
@@ 1,8 1,6 @@
(* Implementation of basic revops for system operations. *)
-open Core.Std
-
let temp_file ?(prefix="Temp") ?(suffix = "CleanMe") () =
Revops.Oprev.make
(fun () -> Filename.temp_file prefix suffix)
- (fun filename -> Unix.remove filename)
+ (fun filename -> Unix.unlink filename)
M src/revops/revops_univ_fn.ml +2 -4
@@ 1,5 1,3 @@
-open Core.Std
-
module Make = functor (Revops : Revops_intf.S) -> struct
module R = Revops
@@ 11,8 9,8 @@ module Make = functor (Revops : Revops_i
let noop =
Revops.Oprev.make
- (Fn.const (M.return Univ_map.empty))
- (Fn.const (M.return ()))
+ (CCFun.const (M.return Univ_map.empty))
+ (CCFun.const (M.return ()))
let extend first (key, oprev) =
let introduce map value = M.return (Univ_map.set map key value) in
M src/revops/revops_univ_intf.ml +0 -2
@@ 1,5 1,3 @@
-open Core.Std
-
module type S = sig
module R : Revops_intf.S