ocaml-base-compiler
-
dynlink
-
ocamlbytecomp
-
ocamlcommon
-
ocamlmiddleend
-
ocamloptcomp
-
odoc_info
-
stdlib
-
str
-
unix
Library
Module
Module type
Parameter
Class
Class type
exception Error of Location.t * error
Exception raised when a type declaration is not separable, or when its separability cannot be established.
type mode = Types.Separability.t =
val compute_decl : Env.t -> Types.type_declaration -> mode list
compute_decl env def
returns the signature required for the type definition def
in the typing environment env
-- including signatures for the current recursive block.
The Error
exception is raised if no such signature exists -- the definition will always be invalid. This only happens when the definition is marked to be unboxed.
Variant (or record) declarations that are not marked with the "@@unboxed
" annotation, including those that contain several variants (or labels), are always separable. In particular, their mode signatures do not require anything of their type parameters, which are marked Ind
.
Finally, if Config.flat_float_array
is not set, then separability is not required anymore; we just use Ind
as the mode of each parameter without any check.
type prop = Types.Separability.signature
Property interface (see Typedecl_properties
). These functions rely on compute_decl
and raise the Error
exception on error.
val property : ( prop, unit ) Typedecl_properties.property
val update_decls :
Env.t ->
(Ident.t * Typedecl_properties.decl) list ->
(Ident.t * Typedecl_properties.decl) list