File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 1- (* All modules from [Stdune] should be in the struct below. The modules are
2- listed alphabetically. Try to keep the order. *)
1+ (* The modules are listed alphabetically. Try to keep the order. *)
32
43include struct
54 open Stdune
@@ -53,13 +52,31 @@ module List = struct
5352end
5453
5554module Result = struct
56- module O = Stdune.Result. O
55+ module O = struct
56+ let ( let+ ) x f = Result. map f x
57+ let ( let* ) x f = Result. bind x f
58+ end
59+
5760 include Base. Result
5861end
5962
6063module Option = struct
61- module O = Stdune.Option. O
62- module List = Stdune.Option. List
64+ module O = struct
65+ let ( let+ ) x f = Option. map f x
66+ let ( let* ) x f = Option. bind x f
67+ end
68+
69+ module List = struct
70+ let all =
71+ let rec loop acc = function
72+ | [] -> Some (List. rev acc)
73+ | None :: _ -> None
74+ | Some x :: xs -> loop (x :: acc) xs
75+ in
76+ fun xs -> loop [] xs
77+ ;;
78+ end
79+
6380 include Base. Option
6481end
6582
You can’t perform that action at this time.
0 commit comments