Module Typemode
module Jkind = Btype.Jkind0type modalities = {moda_modalities : Mode.Modality.Const.t;moda_desc : Mode.Modality.atom Location.loc list;
}val transl_mode_annots : Parsetree.modes -> Mode.Alloc.Const.Option.t modesInterpret mode syntax as mode annotation, where axes can be left unspecified
val untransl_mode : _ modes -> Parsetree.modesval transl_alloc_mode : Parsetree.modes -> Mode.Alloc.Const.t modesInterpret mode syntax as alloc mode (on arrow types), where axes are set to legacy if unspecified
val transl_modalities :
maturity:Language_extension.maturity ->
Types.mutability ->
Parsetree.modalities ->
modalitiesInterpret mode syntax as modalities. Modalities occuring at different places requires different levels of maturity. Also takes the mutability and attributes on the field and insert mutable-implied modalities accordingly.
val least_modalities :
include_implied:bool ->
mut:Types.mutability ->
Mode.Modality.Const.t ->
Mode.Modality.atom listFind the minimum modality annots a user must write to express the given modality. If include_implied is false, modalities implied by other written modalities are included, even if not necessary.
val sort_dedup_modalities : Mode.Modality.atom list -> Mode.Modality.atom listval mutable_modalities : Types.mutability -> Mode.Modality.Const.tGet the default modalities implied by the mutability of a field.
val transl_modalities_with_default :
maturity:Language_extension.maturity ->
default:Mode.Modality.Const.t ->
Parsetree.modalities ->
modalitiesSimilar to transl_modalities but takes an explicit default modality instead of computing it from mutability. Used when merging explicit modalities with existing signature default modalities.
val let_mutable_modalities : Mode.Modality.Const.tval atomic_mutable_modalities : Mode.Modality.Const.tThe (default) modalities for an atomic mutable field
val untransl_modality :
Mode.Modality.atom Location.loc ->
Parsetree.modality Location.locval untransl_modalities : modalities -> Parsetree.modalitiesval transl_with_bound_modifiers :
Parsetree.modalities ->
Mode.Modality.Const.t * Jkind_axis.Externality.t optionInterpret modality syntax in with-bound context. Returns the modal modality and the externality modifier (if any).
val transl_mod_bounds :
Parsetree.modes ->
Jkind.Mod_bounds.t
* (Jkind_axis.Nullability.t Location.loc option
* Jkind_axis.Separability.t Location.loc option)Interpret a mod-bounds.
val untransl_mod_bounds :
?verbose:bool ->
Jkind.Mod_bounds.t ->
Parsetree.modesTranslate an algebraic representation of mod bounds into user syntax. If verbose is true, redundant annotations are included.
val idx_expected_modalities : mut:bool -> Mode.Modality.Const.t