Skip to content

Commit a1c6a9e

Browse files
committed
Merge branch 'flatten-stdlib'
2 parents c90c99a + 7bc688a commit a1c6a9e

20 files changed

Lines changed: 176 additions & 88 deletions

src/stdlib/array0.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(****************************************************************************)
2+
(* auto-format: Build auto-format commands for custom languages *)
3+
(* SPDX-FileCopyrightText: 2023 Mathieu Barbin <mathieu.barbin@gmail.com> *)
4+
(* SPDX-License-Identifier: MIT *)
5+
(****************************************************************************)
6+
7+
include Stdlib.ArrayLabels
8+
9+
let map t ~f = map ~f t

src/stdlib/array0.mli

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(*_***************************************************************************)
2+
(*_ auto-format: Build auto-format commands for custom languages *)
3+
(*_ SPDX-FileCopyrightText: 2023 Mathieu Barbin <mathieu.barbin@gmail.com> *)
4+
(*_ SPDX-License-Identifier: MIT *)
5+
(*_***************************************************************************)
6+
7+
include module type of struct
8+
include Stdlib.ArrayLabels
9+
end
10+
11+
val map : 'a t -> f:('a -> 'b) -> 'b t

src/stdlib/auto_format_stdlib.ml

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,4 @@
44
(* SPDX-License-Identifier: MIT *)
55
(****************************************************************************)
66

7-
module Code_error = Code_error
8-
module Dyn = Dyn
9-
module Err = Err
10-
module Pp = Pp0
11-
12-
module Array = struct
13-
include Stdlib.ArrayLabels
14-
15-
let map t ~f = map ~f t
16-
end
17-
18-
module List = struct
19-
include Stdlib.ListLabels
20-
21-
let exists t ~f = exists ~f t
22-
let filter t ~f = filter ~f t
23-
let map t ~f = map ~f t
24-
let sort t ~compare = sort ~cmp:compare t
25-
end
26-
27-
module Result = struct
28-
include Stdlib.Result
29-
30-
module Syntax = struct
31-
let ( let* ) x f = bind x f
32-
let ( let+ ) x f = map f x
33-
end
34-
end
35-
36-
module Ref = struct
37-
let set_temporarily t a ~f =
38-
let x = !t in
39-
t := a;
40-
Fun.protect ~finally:(fun () -> t := x) f
41-
;;
42-
end
43-
44-
module String = struct
45-
include Stdlib.StringLabels
46-
47-
let concat ts ~sep = concat ~sep ts
48-
end
7+
include Stdlib0

src/stdlib/auto_format_stdlib.mli

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,6 @@
44
(*_ SPDX-License-Identifier: MIT *)
55
(*_***************************************************************************)
66

7-
module Code_error = Code_error
8-
module Dyn = Dyn
9-
module Err = Err
10-
module Pp = Pp0
11-
12-
module Array : sig
13-
include module type of struct
14-
include Stdlib.ArrayLabels
15-
end
16-
17-
val map : 'a t -> f:('a -> 'b) -> 'b t
18-
end
19-
20-
module List : sig
21-
include module type of struct
22-
include Stdlib.ListLabels
23-
end
24-
25-
val exists : 'a t -> f:('a -> bool) -> bool
26-
val filter : 'a t -> f:('a -> bool) -> 'a t
27-
val map : 'a t -> f:('a -> 'b) -> 'b t
28-
val sort : 'a t -> compare:('a -> 'a -> int) -> 'a t
29-
end
30-
31-
module Result : sig
32-
include module type of struct
33-
include Stdlib.Result
34-
end
35-
36-
(*_ Only available since [5.4] and currently supporting from [5.2]. *)
37-
module Syntax : sig
38-
val ( let* ) : ('a, 'e) result -> ('a -> ('b, 'e) result) -> ('b, 'e) result
39-
val ( let+ ) : ('a, 'e) result -> ('a -> 'b) -> ('b, 'e) result
40-
end
41-
end
42-
43-
module Ref : sig
44-
val set_temporarily : 'a ref -> 'a -> f:(unit -> 'b) -> 'b
45-
end
46-
47-
module String : sig
48-
include module type of struct
49-
include Stdlib.StringLabels
50-
end
51-
52-
val concat : t list -> sep:t -> t
7+
include module type of struct
8+
include Stdlib0
539
end

src/stdlib/dyn0.ml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(****************************************************************************)
2+
(* auto-format: Build auto-format commands for custom languages *)
3+
(* SPDX-FileCopyrightText: 2023 Mathieu Barbin <mathieu.barbin@gmail.com> *)
4+
(* SPDX-License-Identifier: MIT *)
5+
(****************************************************************************)
6+
7+
include Dyn

src/stdlib/dyn0.mli

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(*_***************************************************************************)
2+
(*_ auto-format: Build auto-format commands for custom languages *)
3+
(*_ SPDX-FileCopyrightText: 2023 Mathieu Barbin <mathieu.barbin@gmail.com> *)
4+
(*_ SPDX-License-Identifier: MIT *)
5+
(*_***************************************************************************)
6+
7+
include module type of struct
8+
include Dyn
9+
end

src/stdlib/err0.ml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(****************************************************************************)
2+
(* auto-format: Build auto-format commands for custom languages *)
3+
(* SPDX-FileCopyrightText: 2023 Mathieu Barbin <mathieu.barbin@gmail.com> *)
4+
(* SPDX-License-Identifier: MIT *)
5+
(****************************************************************************)
6+
7+
include Pplumbing_err.Err

src/stdlib/err0.mli

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(*_***************************************************************************)
2+
(*_ auto-format: Build auto-format commands for custom languages *)
3+
(*_ SPDX-FileCopyrightText: 2023 Mathieu Barbin <mathieu.barbin@gmail.com> *)
4+
(*_ SPDX-License-Identifier: MIT *)
5+
(*_***************************************************************************)
6+
7+
include module type of struct
8+
include Pplumbing_err.Err
9+
end

0 commit comments

Comments
 (0)