Skip to content

Commit 2f89dc6

Browse files
committed
modal modules
1 parent c3026db commit 2f89dc6

Some content is hidden

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

52 files changed

+1614
-863
lines changed

chamelon/chamelon.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ let minimizers_to_run =
121121
(* ______ ONE FILE MINIMIZATION ______ *)
122122

123123
(** [one_file_minimize c map file] minimizes [file] in the file set [map]
124-
regarding to the command [c] *)
124+
regarding to the command [c] *)
125125
let one_file_minimize c (map : structure Smap.t) file : structure Smap.t * bool
126126
=
127127
if !test then (

chamelon/compat.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ type texp_function_param = {
1919
param : Ident.t;
2020
partial : partial;
2121
optional_default : expression option;
22-
(** The optional argument's default value. If [optional_default] is present,
23-
[arg_label] must be [Optional], and [pattern] matches values of type [t]
24-
if the parameter type is [t option]. *)
22+
(** The optional argument's default value. If [optional_default] is
23+
present, [arg_label] must be [Optional], and [pattern] matches values
24+
of type [t] if the parameter type is [t option]. *)
2525
param_identifier : texp_function_param_identifier;
2626
}
2727

chamelon/function_compat.mli

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
open Typedtree
44
open Compat
55

6-
(** [cases_view] is similar to an old version of the [texp_function] type.
7-
It would take some work to update old clients to use the new [texp_function]
8-
type, so instead we have this compatibility layer between [cases_view] and
9-
the new version of [texp_function].
6+
(** [cases_view] is similar to an old version of the [texp_function] type. It
7+
would take some work to update old clients to use the new [texp_function]
8+
type, so instead we have this compatibility layer between [cases_view] and
9+
the new version of [texp_function].
1010
1111
(Though, at some point we should just update the clients and remove this
12-
compatibility layer.)
13-
*)
12+
compatibility layer.) *)
1413

1514
type cases_view_identifier =
1615
| Cases of texp_function_cases_identifier

chamelon/iterator.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ let step_minimizer c minimize cur_file map ~pos ~len =
6969
in
7070
r
7171

72-
(** [apply_minimizer test map cur_file minimize c] applies [minimize] for [cur_file]
73-
in the file set [mapi] for the command [c] as much as possible if (not !test),
74-
only once otherwise *)
72+
(** [apply_minimizer test map cur_file minimize c] applies [minimize] for
73+
[cur_file] in the file set [mapi] for the command [c] as much as possible if
74+
(not !test), only once otherwise *)
7575
let dicho = true
7676

7777
let apply_minimizer test map cur_file minimize (c : string) =

chamelon/minimizer/simplifymatch.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ open Tast_mapper
66
open Compat
77

88
(** [replace_mapper id to_replace] is a mapper replacing every occurence of [id]
9-
by the expression [to_replace]*)
9+
by the expression [to_replace]*)
1010
let replace_mapper id to_replace =
1111
{
1212
Tast_mapper.default with

chamelon/utils.ml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ let rec path_eq p1 p2 =
4141
| Papply (t11, t12), Papply (t21, t22) -> path_eq t11 t21 && path_eq t12 t22
4242
| _ -> false
4343

44-
(** [replace_path path n_path] is a mapper replacing each occurence of the path [path] by [n_path]*)
44+
(** [replace_path path n_path] is a mapper replacing each occurence of the path
45+
[path] by [n_path]*)
4546
let replace_path path n_path =
4647
{
4748
Tast_mapper.default with
@@ -86,7 +87,8 @@ let replace_path path n_path =
8687
| _ -> Tast_mapper.default.typ mapper ct);
8788
}
8889

89-
(** [replace_id id n_id] is a mapper replacing each occurence of the ident [id] by [n_id]*)
90+
(** [replace_id id n_id] is a mapper replacing each occurence of the ident [id]
91+
by [n_id]*)
9092
let replace_id id n_id =
9193
{
9294
Tast_mapper.default with
@@ -182,15 +184,16 @@ let update_single name str =
182184
flush oc;
183185
close_out oc
184186

185-
(** [add_def str] adds dummy1, dummy2 and ignore definitions, needed by some minmizers, in [str]*)
187+
(** [add_def str] adds dummy1, dummy2 and ignore definitions, needed by some
188+
minmizers, in [str]*)
186189
let add_def str =
187190
{
188191
str with
189192
str_items = dummy1_def :: dummy2_def :: ignore_def :: str.str_items;
190193
}
191194

192-
(** [update_output map] replaces the content of each file
193-
by its associated structure in [map] *)
195+
(** [update_output map] replaces the content of each file by its associated
196+
structure in [map] *)
194197
let update_output map = Smap.iter update_single (Smap.map add_def map)
195198

196199
let save_outputs map =

driver/compile_common.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ let typecheck_intf info ast =
8686
(Printtyp.printed_signature (Unit_info.source_file info.target))
8787
sg);
8888
ignore (Includemod.signatures info.env ~mark:Mark_both
89-
~modes:(Legacy None) sg sg);
89+
~modes:Includemod.modes_unit sg sg);
9090
Typecore.force_delayed_checks ();
9191
Builtin_attributes.warn_unused ();
9292
Warnings.check_fatal ();

otherlibs/stdlib_alpha/effect.mli

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ module type S = sig
123123
with [t] to tie the knot on recursive operations. *)
124124

125125
module Result : sig
126-
@@ portable
127126

128127
type eff := t
129128

@@ -274,8 +273,6 @@ module type S1 = sig
274273
with ['p t] to tie the knot on recursive operations. *)
275274

276275
module Result : sig
277-
@@ portable
278-
279276
type 'p eff := 'p t
280277

281278
type ('a, 'p, 'es) t =
@@ -418,8 +415,6 @@ module type S2 = sig
418415
with [('p, 'q) t] to tie the knot on recursive operations. *)
419416

420417
module Result : sig
421-
@@ portable
422-
423418
type ('p, 'q) eff := ('p, 'q) t
424419

425420
type ('a, 'p, 'q, 'es) t =

parsing/builtin_attributes.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ let builtin_attrs =
115115
; "layout_poly"
116116
; "no_mutable_implied_modalities"
117117
; "or_null_reexport"
118-
; "no_recursive_modalities"
119118
; "jane.non_erasable.instances"
120119
]
121120

stdlib/ephemeron.mli

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ end
150150
(** The output signature of the functors {!K1.MakeSeeded} and {!K2.MakeSeeded}.
151151
*)
152152

153-
module K1 : sig
153+
module K1 : sig @@ portable
154154
type ('k,'d) t (** an ephemeron with one key *)
155155

156156
val make : 'k -> 'd -> ('k,'d) t
@@ -161,19 +161,19 @@ module K1 : sig
161161
ephemeron's data) if [key] is physically equal to [eph]'s key, and
162162
[None] if [eph] is empty or [key] is not equal to [eph]'s key. *)
163163

164-
module Make (H:Hashtbl.HashedType) : S with type key = H.t
164+
module (Make @ nonportable) (H:Hashtbl.HashedType) : S with type key = H.t
165165
(** Functor building an implementation of a weak hash table *)
166166

167167
module MakePortable (H:sig @@ portable include Hashtbl.HashedType end)
168168
: sig @@ portable include S with type key = H.t end
169169
(** Like {!Make}, but takes a portable [hash] function to
170170
portable [Ephemeron] operations. *)
171171

172-
module MakeSeeded (H:Hashtbl.SeededHashedType) : SeededS with type key = H.t
172+
module (MakeSeeded @ nonportable) (H:Hashtbl.SeededHashedType) : SeededS with type key = H.t
173173
(** Functor building an implementation of a weak hash table.
174174
The seed is similar to the one of {!Hashtbl.MakeSeeded}. *)
175175

176-
module MakeSeededPortable (H:sig @@ portable include Hashtbl.SeededHashedType end)
176+
module (MakeSeededPortable @ nonportable) (H:sig @@ portable include Hashtbl.SeededHashedType end)
177177
: sig @@ portable include SeededS with type key = H.t end
178178
(** Like {!MakeSeeded}, but takes a portable [seeded_hash] function to
179179
portable [Ephemeron] operations. *)
@@ -206,10 +206,10 @@ module K1 : sig
206206

207207
end
208208

209-
end
209+
end @@ nonportable
210210
(** Ephemerons with one key. *)
211211

212-
module K2 : sig
212+
module K2 : sig @@ portable
213213
type ('k1,'k2,'d) t (** an ephemeron with two keys *)
214214

215215
val make : 'k1 -> 'k2 -> 'd -> ('k1,'k2,'d) t
@@ -218,7 +218,7 @@ module K2 : sig
218218
val query : ('k1,'k2,'d) t -> 'k1 -> 'k2 -> 'd option
219219
(** Same as {!Ephemeron.K1.query} *)
220220

221-
module Make
221+
module (Make @ nonportable)
222222
(H1:Hashtbl.HashedType)
223223
(H2:Hashtbl.HashedType) :
224224
S with type key = H1.t * H2.t
@@ -231,14 +231,14 @@ module K2 : sig
231231
(** Like {!Make}, but takes portable [hash] functions to
232232
portable [Ephemeron] operations. *)
233233

234-
module MakeSeeded
234+
module (MakeSeeded @ nonportable)
235235
(H1:Hashtbl.SeededHashedType)
236236
(H2:Hashtbl.SeededHashedType) :
237237
SeededS with type key = H1.t * H2.t
238238
(** Functor building an implementation of a weak hash table.
239239
The seed is similar to the one of {!Hashtbl.MakeSeeded}. *)
240240

241-
module MakeSeededPortable
241+
module (MakeSeededPortable @ nonportable)
242242
(H1:sig @@ portable include Hashtbl.SeededHashedType end)
243243
(H2:sig @@ portable include Hashtbl.SeededHashedType end) :
244244
sig @@ portable include SeededS with type key = H1.t * H2.t end
@@ -273,10 +273,10 @@ module K2 : sig
273273

274274
end
275275

276-
end
276+
end @@ nonportable
277277
(** Ephemerons with two keys. *)
278278

279-
module Kn : sig
279+
module Kn : sig @@ portable
280280
type ('k,'d) t (** an ephemeron with an arbitrary number of keys
281281
of the same type *)
282282

@@ -286,7 +286,7 @@ module Kn : sig
286286
val query : ('k,'d) t -> 'k array -> 'd option
287287
(** Same as {!Ephemeron.K1.query} *)
288288

289-
module Make
289+
module (Make @ nonportable)
290290
(H:Hashtbl.HashedType) :
291291
S with type key = H.t array
292292
(** Functor building an implementation of a weak hash table *)
@@ -297,13 +297,13 @@ module Kn : sig
297297
(** Like {!Make}, but takes a portable [hash] function to
298298
portable [Ephemeron] operations. *)
299299

300-
module MakeSeeded
300+
module (MakeSeeded @ nonportable)
301301
(H:Hashtbl.SeededHashedType) :
302302
SeededS with type key = H.t array
303303
(** Functor building an implementation of a weak hash table.
304304
The seed is similar to the one of {!Hashtbl.MakeSeeded}. *)
305305

306-
module MakeSeededPortable
306+
module (MakeSeededPortable @ nonportable)
307307
(H:sig @@ portable include Hashtbl.SeededHashedType end) :
308308
sig @@ portable include SeededS with type key = H.t array end
309309
(** Like {!MakeSeeded}, but takes a portable [seeded_hash] function to
@@ -337,5 +337,5 @@ module Kn : sig
337337

338338
end
339339

340-
end
340+
end @@ nonportable
341341
(** Ephemerons with arbitrary number of keys of the same type. *)

0 commit comments

Comments
 (0)