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
41
41
buffer
42
42
end
43
43
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
-
55
44
(* * The command line arguments of the program. *)
56
45
let argv : string list =
57
46
Array. to_list Sys. argv
@@ -68,11 +57,9 @@ let join (x : 'a Lwt.t) (y : 'b Lwt.t) : ('a * 'b) Lwt.t =
68
57
| (Some x , Some y ) -> Lwt. return (x, y)
69
58
| _ -> Lwt. fail_with " The join expected two answers." )
70
59
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]
76
63
77
64
(* * List the files of a directory. *)
78
65
let list_files (directory : string ) : string list option Lwt.t =
You can’t perform that action at this time.
0 commit comments