Skip to content

Commit 57a5d4b

Browse files
committed
make [all] ordered
1 parent b6b4e58 commit 57a5d4b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

testsuite/tests/typing-layouts/allow_any.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ Lines 1-2, characters 0-34:
385385
Error: This variant or record definition does not match that of type "'a t"
386386
They have different unsafe mode crossing behavior:
387387
Both specify [@@unsafe_allow_any_mode_crossing], but their bounds are not equal
388-
the original has: mod many portable contended unyielding stateless
389-
immutable with 'a
390-
but this has: mod many portable contended unyielding stateless
391-
immutable
388+
the original has: mod unyielding many stateless portable immutable
389+
contended with 'a
390+
but this has: mod unyielding many stateless portable immutable
391+
contended
392392
|}]
393393

394394
type ('a, 'b) arity_2 : immutable_data with 'b = { x : 'a }
@@ -406,10 +406,10 @@ Error: This variant or record definition does not match that of type
406406
"('a, 'b) arity_2"
407407
They have different unsafe mode crossing behavior:
408408
Both specify [@@unsafe_allow_any_mode_crossing], but their bounds are not equal
409-
the original has: mod many portable contended unyielding stateless
410-
immutable with 'b
411-
but this has: mod many portable contended unyielding stateless
412-
immutable with 'a
409+
the original has: mod unyielding many stateless portable immutable
410+
contended with 'b
411+
but this has: mod unyielding many stateless portable immutable
412+
contended with 'a
413413
|}]
414414

415415
(* mcomp *)

typing/mode.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,7 @@ module Value_with (Areality : Areality) = struct
23762376
P (Comonadic Yielding);
23772377
P (Comonadic Statefulness);
23782378
P (Monadic Visibility) ]
2379+
|> List.sort (fun (P ax0) (P ax1) -> compare ax0 ax1)
23792380
end
23802381

23812382
let proj_obj : type a d0 d1. (a, d0, d1) Axis.t -> a C.obj = function

typing/mode_intf.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,14 @@ module type S = sig
415415
| Monadic : (Monadic.Const.t, 'a) Axis.t -> ('a, 'd, 'd neg) t
416416
| Comonadic : (Comonadic.Const.t, 'a) Axis.t -> ('a, 'd, 'd pos) t
417417

418+
(** Compare two axes in implication order. If A implies B, then A is before B. *)
418419
val compare : ('a, 'd0, 'd1) t -> ('b, 'e0, 'e1) t -> int
419420

420421
type packed = P : (_, _, _) t -> packed
421422

422423
val print : Format.formatter -> ('a, _, _) t -> unit
423424

425+
(** List of all axes, ordered by [compare]. *)
424426
val all : packed list
425427
end
426428

0 commit comments

Comments
 (0)