jon.recoil.org

Module Mode.Visibility

module Const : sig ... end
include Ocaml_typing.Mode.Common_axis_neg with module Const := Ocaml_typing.Mode.Visibility.Const
include Ocaml_typing.Mode_intf.Common_axis with module Const := Ocaml_typing.Mode.Visibility.Const and type 'd t = (Ocaml_typing.Mode.Visibility.Const.t, 'd Ocaml_typing.Allowance.neg) Ocaml_typing.Mode.mode and type 'd hint_const := 'd Ocaml_typing.Mode_intf.neg_hint_const
include Ocaml_typing.Mode_intf.Common with module Const := Ocaml_typing.Mode.Visibility.Const and type simple_error = Ocaml_typing.Mode.Visibility.Const.t Ocaml_typing.Mode_intf.simple_error with type 'd t = (Ocaml_typing.Mode.Visibility.Const.t, 'd Ocaml_typing.Allowance.neg) Ocaml_typing.Mode.mode
type error

Takes 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.

include Ocaml_typing.Allowance.Allow_disallow with type (_, _, 'd) sided = 'd Ocaml_typing.Mode.Visibility.t
type (_, _, 'd) sided = 'd Ocaml_typing.Mode.Visibility.t

Disallows on the right.

Disallows a the left.

Generalizes a right-hand-side allowed to be any allowance.

Generalizes a left-hand-side allowed to be any allowance.

val newvar : unit -> ('l * 'r) Ocaml_typing.Mode.Visibility.t

Takes 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.

Similar 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.

Similiar to submode, but crashes the compiler if errors. Use this function if the submode is guaranteed to succeed.

val print : ?verbose:bool -> unit -> Stdlib.Format.formatter -> ('l * 'r) Ocaml_typing.Mode.Visibility.t -> unit