Mode.AllocThe mode on arrow types. Compared to Value, it contains the Locality axis instead of Regionality axis, as arrow types are exposed to users and would be hard to understand if it involves Regionality.
module Monadic : sig ... endmodule Comonadic : sig ... endmodule Axis : sig ... endmodule Const : sig ... endtype 'a simple_axerror := 'a simple_errortype 'd t = ('d Monadic.t, 'd Comonadic.t) monadic_comonadicinclude Mode_intf.Common
with module Const := Const
and type error := error
and type simple_error := simple_error
and type 'd t := 'd tval print_error : Mode_hint.pinpoint -> error -> Mode_intf.print_errorTakes a submode error accompanied by a pinpoint of the original submode, returns an explaining printer for each side. Each printer prints either a mode constant name, or "mode because ...". The function assumes pinpoint is already printed, which allows simplifying its own printing. The caller is responsible for printing pinpoint and placing the result of this function in a suitable linguistic context.
type equate_error = Mode_intf.equate_step * errorval to_simple_error : error -> simple_errortype l = (Allowance.allowed * Allowance.disallowed) tLeft-only mode
type r = (Allowance.disallowed * Allowance.allowed) tRight-only mode
type lr = (Allowance.allowed * Allowance.allowed) tLeft-right mode
include Allowance.Allow_disallow with type (_, _, 'd) sided = 'd ttype (_, _, 'd) sided = 'd tval disallow_right :
('a, 'b, 'l * 'r) sided ->
('a, 'b, 'l * Allowance.disallowed) sidedDisallows on the right.
val disallow_left :
('a, 'b, 'l * 'r) sided ->
('a, 'b, Allowance.disallowed * 'r) sidedDisallows a the left.
val allow_right :
('a, 'b, 'l * Allowance.allowed) sided ->
('a, 'b, 'l * 'r) sidedGeneralizes a right-hand-side allowed to be any allowance.
val allow_left :
('a, 'b, Allowance.allowed * 'r) sided ->
('a, 'b, 'l * 'r) sidedGeneralizes a left-hand-side allowed to be any allowance.
val min : lrval max : lrval legacy : lrval newvar : unit -> ('l * 'r) tval submode :
?pp:Mode_hint.pinpoint ->
(Allowance.allowed * 'r) t ->
('l * Allowance.allowed) t ->
(unit, error) resultTakes the actual and expected mode of something, check that the actual mode is less than the expected mode. In case of error, the error is returned and no mutation is done.
The two modes should be hinted sufficently that the submode is self-evident. In particular, the two modes should be about the "same thing". See the notes How to submode for details.
val submode_err :
Mode_hint.pinpoint ->
(Allowance.allowed * 'r) t ->
('l * Allowance.allowed) t ->
unitSimilar to submode, but instead of returning an error, raise user-friendly errors directly, with pinpoint describing the thing whose actual and expected modes are being checked.
If you need more than pinpoint as the context in the error message, consider submode.
val equate : lr -> lr -> (unit, equate_error) resultval submode_exn :
?pp:Mode_hint.pinpoint ->
(Allowance.allowed * 'r) t ->
('l * Allowance.allowed) t ->
unitSimiliar to submode, but crashes the compiler if errors. Use this function if the submode is guaranteed to succeed.
val join : (Allowance.allowed * 'r) t list -> Allowance.left_only tval meet : ('l * Allowance.allowed) t list -> Allowance.right_only tval newvar_above : (Allowance.allowed * 'r) t -> ('l * 'r_) t * boolval newvar_below : ('l * Allowance.allowed) t -> ('l_ * 'r) t * boolval print : ?verbose:bool -> unit -> Format.formatter -> ('l * 'r) t -> unitval zap_to_ceil : ('l * Allowance.allowed) t -> Const.tval zap_to_floor : (Allowance.allowed * 'r) t -> Const.tval of_const :
?hint_monadic:('l * 'r) Allowance.neg Hint.const ->
?hint_comonadic:('l * 'r) Allowance.pos Hint.const ->
Const.t ->
('l * 'r) tmodule List : sig ... endval proj_comonadic : 'a Comonadic.Axis.t -> ('l * 'r) t -> ('a, 'l * 'r) modeval proj_monadic : 'a Monadic.Axis.t -> ('l * 'r) t -> ('a, 'r * 'l) modeval meet_const : Comonadic.Const.t -> ('l * 'r) t -> ('l * 'r) tval join_const : Monadic.Const.t -> ('l * 'r) t -> ('l * 'r) tval max_with_comonadic :
'a Comonadic.Axis.t ->
('a, 'l * 'r) mode ->
(disallowed * 'r) tmax_with ax elt returns max but with the axis ax set to elt.
val min_with_comonadic :
'a Comonadic.Axis.t ->
('a, 'l * 'r) mode ->
('l * disallowed) tmin_with ax elt returns min but with the axis ax set to elt.
val min_with_monadic :
'a Monadic.Axis.t ->
('a, 'l * 'r) mode ->
('r * disallowed) tval meet_with : 'a Comonadic.Axis.t -> 'a -> ('l * 'r) t -> ('l * 'r) tval join_with : 'a Monadic.Axis.t -> 'a -> ('l * 'r) t -> ('l * 'r) tval comonadic_to_monadic_min :
?hint:('r * disallowed) Allowance.neg Hint.morph ->
('l * 'r) Comonadic.t ->
('r * disallowed) Monadic.tval monadic_to_comonadic_max :
('r * disallowed) Monadic.t ->
(disallowed * 'r) Comonadic.tval close_over :
(('l * allowed) Monadic.t, (allowed * 'r) Comonadic.t) monadic_comonadic ->
lReturns the lower bound needed for B -> C in relation to A