module Type:sig..end
Datatype instead
whenever possible.type 'a t
ty, a value of type ty
t dynamically represents the type ty. Such a value is called a type
value and should be unique for each static monomorphic type.type'aty ='a t
type precedence =
| |
Basic |
(* |
Consult the Plugin Development Guide for additional details.
| *) |
| |
Call |
(* |
Consult the Plugin Development Guide for additional details.
| *) |
| |
Tuple |
|||
| |
List |
|||
| |
NoPar |
Type.par below.val par : precedence ->
precedence -> Format.formatter -> (Format.formatter -> unit) -> unitpar context myself fmt pp puts parenthesis around the verbatim
prints by pp according to the precedence myself of the verbatim and to
the precedence context of the caller of the pretty printer. fmt is the
output formatter.
The typical use is the following:
let pretty_print p_caller fmt x =
let pp fmt = Format.fprintf "..." ... x ... in
let myself = Call in
par p_caller myself fmt pp
Consult the Plugin Development Guide for additional details.
val par_ty_name : ('a t -> bool) -> 'a t -> stringpar_ty_name f ty puts parenthesis around the name of the ty iff f ty
is true.exception AlreadyExists of string
val register : ?closure:bool ->
name:string ->
ml_name:string option -> Structural_descr.t -> 'a list -> 'a tregister ?closure ~name ~ml_name descr reprs registers
a new type value. Should not be used directly. Use one of functors of
module Datatype instead.
closure is true iff the type is a function type.
name is the name of the type. Must be a valid OCaml type name (eventually
prefixed by a module path).
ml_name is the OCaml name of the registered type value.AlreadyExists if the given name is already used by another type.Invalid_argument if reprs is the empty listvalue_name is now ml_name. Must provide a
structural descriptor. Argument pp does not exist anymore.exception No_abstract_type of string
module Abstract:
val name : 'a t -> stringval structural_descr : 'a t -> Structural_descr.t
val reprs : 'a t -> 'a listval digest : 'a t -> Digest.t
val get_embedded_type_names : 'a t -> string listget_embedded_type_names (Datatype.func Datatype.unit
(Datatype.list Datatype.int)) returns "unit -> int list"; "unit"; "int
list"; "int" .val ml_name : 'a t -> string
val pp_ml_name : 'a t -> precedence -> Format.formatter -> unit
val set_ml_name : 'a t -> string option -> unit
val set_name : 'a t -> string -> unitval equal : 'a t -> 'b t -> bool
val compare : 'a t -> 'b t -> int
val hash : 'a t -> int
Functors for handling polymorphic type: one type value must be registered
for each monomorphic instance of a polymorphic type.
module type Polymorphic_input =sig..end
module type Polymorphic =sig..end
module Polymorphic:
module type Polymorphic2_input =sig..end
Type.Polymorphic_input: very same functions with one additional
argument corresponding to the second type variable.
module type Polymorphic2 =sig..end
Type.Polymorphic for polymorphic types with two type variables.
module Polymorphic2:
module Function:sig..end
Type.Polymorphic2 for functions: same signature than
Type.Polymorphic2 with possibility to specify a label for the function
parameter.
module type Polymorphic3_input =sig..end
Type.Polymorphic_input: very same functions with two additional
arguments corresponding to the second and third type variables.
module type Polymorphic3 =sig..end
Type.Polymorphic for polymorphic types with three type variables.
module Polymorphic3:
module type Polymorphic4_input =sig..end
Type.Polymorphic_input: very same functions with three additional
arguments corresponding to the additional type variables.
module type Polymorphic4 =sig..end
Type.Polymorphic for polymorphic types with four type variables.
module Polymorphic4:functor (T:Polymorphic4_input) ->Polymorphic4with type ('a, 'b, 'c, 'd) poly = ('a, 'b, 'c, 'd) T.t
These tables are safe to use but nevertheless not for casual users.
module type Heterogeneous_table =sig..end
module Make_tbl:functor (Key:siginclude Hashtbl.HashedTypeval to_string :Type.t -> stringend) ->functor (Info:sigtype'atend) ->Heterogeneous_tablewith type key = Key.t and type 'a info = 'a Info.t
module String_tbl:functor (Info:sigtype'atend) ->Heterogeneous_tablewith type key = string and type 'a info = 'a Info.t
module Ty_tbl:
module Obj_tbl:sig..end
val no_obj : unit -> unitval may_use_obj : unit -> boolval add_abstract_types : (string -> string -> unit) Pervasives.ref
val sfprintf : ('a, Format.formatter, unit, string) Pervasives.format4 -> 'a