Skip to content

Commit 720fd2b

Browse files
authored
chore: remove all the stdune [O] references (#1483)
Signed-off-by: Rudi Grinberg <[email protected]>
1 parent cda6880 commit 720fd2b

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

ocaml-lsp-server/src/import.ml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
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

43
include struct
54
open Stdune
@@ -53,13 +52,31 @@ module List = struct
5352
end
5453

5554
module 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
5861
end
5962

6063
module 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
6481
end
6582

0 commit comments

Comments
 (0)