Module ComCoercion
val try_add_new_coercion_with_target : Names.GlobRef.t -> local:bool -> poly:bool -> nonuniform:bool -> reversible:bool -> source:Coercionops.cl_typ -> target:Coercionops.cl_typ -> unit
try_add_new_coercion_with_target ref s src tg
declaresref
as a coercion fromsrc
totg
val try_add_new_coercion : Names.GlobRef.t -> local:bool -> poly:bool -> nonuniform:bool -> reversible:bool -> unit
try_add_new_coercion ref s
declaresref
, assumed to be of type(x1:T1)...(xn:Tn)src->tg
, as a coercion fromsrc
totg
val try_add_new_coercion_subclass : Coercionops.cl_typ -> local:bool -> poly:bool -> nonuniform:bool -> reversible:bool -> unit
try_add_new_coercion_subclass cst s
expects thatcst
denotes a transparent constant which unfolds to some classtg
; it declares an identity coercion fromcst
totg
, named something like"Id_cst_tg"
val try_add_new_coercion_with_source : Names.GlobRef.t -> local:bool -> poly:bool -> nonuniform:bool -> reversible:bool -> source:Coercionops.cl_typ -> unit
try_add_new_coercion_with_source ref s src
declaresref
as a coercion fromsrc
totg
where the target is inferred from the type ofref
val try_add_new_identity_coercion : Names.Id.t -> local:bool -> poly:bool -> source:Coercionops.cl_typ -> target:Coercionops.cl_typ -> unit
try_add_new_identity_coercion id s src tg
enriches the environment with a new definition of nameid
declared as an identity coercion fromsrc
totg
val add_coercion_hook : poly:bool -> nonuniform:bool -> reversible:bool -> Declare.Hook.t
val add_subclass_hook : poly:bool -> reversible:bool -> Declare.Hook.t
val class_of_global : Names.GlobRef.t -> Coercionops.cl_typ
val nonuniform : bool option Attributes.attribute
Attribute to silence warning for coercions that don't satisfy the uniform inheritance condition.
val change_reverse : Names.GlobRef.t -> reversible:bool -> unit