Skip to content

Commit 37f00b3

Browse files
v0.18~preview.130.48+372
1 parent 81e6175 commit 37f00b3

File tree

204 files changed

+9586
-4151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+9586
-4151
lines changed

.github/workflows/workflow.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,23 @@ jobs:
1717
matrix:
1818
os: [macos-latest, ubuntu-latest, windows-latest]
1919
ocaml:
20-
- 5
20+
- ocaml-base-compiler.5.0.0~alpha0
21+
- 4.14.0
22+
include:
23+
- {os: ubuntu-latest, ocaml: 4.13.1}
24+
- {os: ubuntu-latest, ocaml: 4.12.1}
25+
- {os: ubuntu-latest, ocaml: 4.11.2}
26+
exclude:
27+
- {os: windows-latest, ocaml: ocaml-base-compiler.5.0.0~alpha0}
2128

2229
runs-on: ${{ matrix.os }}
2330

2431
steps:
2532
- name: Checkout code
26-
uses: actions/checkout@v4
27-
with:
28-
ref: ${{ github.event.pull_request.head.ref }}
29-
repository: ${{ github.event.pull_request.head.repo.full_name }}
33+
uses: actions/checkout@v3
3034

3135
- name: Setup OCaml ${{ matrix.ocaml }}
32-
uses: ocaml/setup-ocaml@v3
36+
uses: ocaml/setup-ocaml@v2
3337
with:
3438
cache-prefix: v1-${{ matrix.os }}-${{ matrix.ocaml }}
3539
dune-cache: true

base.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ depends: [
1313
"ocaml" {>= "5.1.0"}
1414
"basement"
1515
"ocaml_intrinsics_kernel"
16+
"ppx_array_base"
1617
"ppx_base"
1718
"ppx_cold"
1819
"ppx_hash"

generate/zarith.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module Big_int_Z = Big_int_Z
22
module Q = Q
33
module Z = Z
4+
module Zarith = Zarith
45
module Zarith_version = Zarith_version

shadow-stdlib/gen/mapper.mll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ let module_replacement = function
274274
| "Gc" -> Some No_equivalent
275275
| "Printexc" -> Some (Repl_text "Use [Exn] or [Backtrace] instead")
276276
| "Seq" -> Some (Approx "Sequence")
277+
| "Atomic" ->
278+
Some (Repl_text "\
279+
Use [Atomic] from [Portable] (or [Core], which reexports it from\n\
280+
[Portable]) instead")
277281
| _ -> None
278282

279283
let replace ~is_exn id replacement =

src/applicative.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,16 @@ module Make_let_syntax
224224
(Intf)
225225
(Impl)]
226226

227-
module Ident = struct
227+
module%template [@mode p = (portable, nonportable)] Ident = struct
228228
type 'a t = 'a
229229

230-
let return = Fn.id
230+
let return x = x
231231
let apply f a = f a
232232
let both a b = a, b
233233
let map3 a b c ~f = f a b c
234234
let map2 a b ~f = f a b
235235
let map a ~f = f a
236-
let all = Fn.id
236+
let all x = x
237237
let all_unit = ignore
238238

239239
module Applicative_infix = struct

src/applicative_intf.ml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ open! Import
1919

2020
module Definitions = struct
2121
[%%template
22-
[@@@mode.default m = (global, local)]
22+
[@@@mode.default m = (global, local), p = (nonportable, portable)]
2323

2424
(** Module types below provide both global and local versions. In OxCaml, the latter
25-
accept local [~f] closures. *)
25+
accept local [~f] closures.
26+
27+
Both [local] and [portable] versions are designed with a strict data structure in
28+
mind. The types won't make sense for Applicatives whose evaluation is delayed (e.g.
29+
most monads, Command.Param, or anything like a database query applicative). *)
2630

2731
(** Applicative operations. An applicative abstracts the notion of computations whose
2832
results can be combined. An ['a t] represents a computation returning ['a].
@@ -78,14 +82,14 @@ module Definitions = struct
7882
module type S2_kernel = sig
7983
type ('a, 'p) t
8084

81-
include S3_kernel [@mode m] with type ('a, 'p, _) t := ('a, 'p) t
85+
include S3_kernel [@mode m p] with type ('a, 'p, _) t := ('a, 'p) t
8286
end
8387

8488
(** Applicative operations for applicatives with one type parameter. *)
8589
module type S_kernel = sig
8690
type 'a t
8791

88-
include S3_kernel [@mode m] with type ('a, _, _) t := 'a t
92+
include S3_kernel [@mode m p] with type ('a, _, _) t := 'a t
8993
end
9094

9195
(** Infix operators. This module type subsumes the other [Index*] types below. *)
@@ -102,14 +106,14 @@ module Definitions = struct
102106
module type Applicative_infix2 = sig
103107
type ('a, 'p) t
104108

105-
include Applicative_infix3 [@mode m] with type ('a, 'p, _) t := ('a, 'p) t
109+
include Applicative_infix3 [@mode m p] with type ('a, 'p, _) t := ('a, 'p) t
106110
end
107111

108112
(** Infix operators for applicatives with one type parameter. *)
109113
module type Applicative_infix = sig
110114
type 'a t
111115

112-
include Applicative_infix3 [@mode m] with type ('a, _, _) t := 'a t
116+
include Applicative_infix3 [@mode m p] with type ('a, _, _) t := 'a t
113117
end
114118

115119
(** Complete applicative interface. Extends [_kernel] with infix operators.
@@ -118,25 +122,25 @@ module Definitions = struct
118122
module type S3 = sig
119123
type ('a, 'p, 'q) t
120124

121-
include S3_kernel [@mode m] with type ('a, 'p, 'q) t := ('a, 'p, 'q) t
122-
include Applicative_infix3 [@mode m] with type ('a, 'p, 'q) t := ('a, 'p, 'q) t
125+
include S3_kernel [@mode m p] with type ('a, 'p, 'q) t := ('a, 'p, 'q) t
126+
include Applicative_infix3 [@mode m p] with type ('a, 'p, 'q) t := ('a, 'p, 'q) t
123127

124128
module Applicative_infix :
125-
Applicative_infix3 [@mode m] with type ('a, 'p, 'q) t := ('a, 'p, 'q) t
129+
Applicative_infix3 [@mode m p] with type ('a, 'p, 'q) t := ('a, 'p, 'q) t
126130
end
127131

128132
(** Complete applicative interface with two type parameters. *)
129133
module type S2 = sig
130134
type ('a, 'p) t
131135

132-
include S3 [@mode m] with type ('a, 'p, _) t := ('a, 'p) t
136+
include S3 [@mode m p] with type ('a, 'p, _) t := ('a, 'p) t
133137
end
134138

135139
(** Complete applicative interface with one type parameter. *)
136140
module type S = sig
137141
type 'a t
138142

139-
include S3 [@mode m] with type ('a, _, _) t := 'a t
143+
include S3 [@mode m p] with type ('a, _, _) t := 'a t
140144
end
141145

142146
(** Supports [let%map] syntax. See [ppx_let] documentation.
@@ -287,8 +291,9 @@ module type Applicative = sig
287291
[%%template:
288292
(** The identity applicative. Useful as an argument to functors that require a monad, to
289293
produce a non-applicative result. *)
290-
module Ident : sig
291-
include S [@mode local]
294+
module%template
295+
[@mode p = (portable, nonportable)] Ident : sig
296+
include S [@mode local p]
292297
end
293298
with type 'a t = 'a
294299

0 commit comments

Comments
 (0)