File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -41,17 +41,6 @@ module String = struct
4141 buffer
4242end
4343
44- module Sum = struct
45- type ('a, 'b) t =
46- | Left of 'a
47- | Right of 'b
48-
49- let destruct (s : ('a, 'b) t ) (c_x : 'a -> 'c ) (c_y : 'b -> 'c ) : 'c =
50- match s with
51- | Left x -> c_x x
52- | Right y -> c_y y
53- end
54-
5544(* * The command line arguments of the program. *)
5645let argv : string list =
5746 Array. to_list Sys. argv
@@ -68,11 +57,9 @@ let join (x : 'a Lwt.t) (y : 'b Lwt.t) : ('a * 'b) Lwt.t =
6857 | (Some x , Some y ) -> Lwt. return (x, y)
6958 | _ -> Lwt. fail_with " The join expected two answers." )
7059
71- (* * First. *)
72- let first (x : 'a Lwt.t ) (y : 'b Lwt.t ) : ('a, 'b) Sum.t Lwt.t =
73- Lwt. pick [
74- Lwt. bind x (fun x -> Lwt. return @@ Sum. Left x);
75- Lwt. bind y (fun y -> Lwt. return @@ Sum. Right y)]
60+ (* * Choose. *)
61+ let choose (x1 : 'a Lwt.t ) (x2 : 'a Lwt.t ) : 'a Lwt.t =
62+ Lwt. pick [x1; x2]
7663
7764(* * List the files of a directory. *)
7865let list_files (directory : string ) : string list option Lwt.t =
You can’t perform that action at this time.
0 commit comments