Library
Module
Module type
Parameter
Class
Class type
Types
module Index : sig ... end
type typ =
| TyEvent
| TyBool
| TyEnum of name * string list
Name, list of values
*)| TyInt of siz
| TyFloat
| TyChar
| TyArray of Index.t * typ
size, subtype
*)| TyVar of typ var
Internal use only
*)| TyArrow of typ * typ
Internal use only
*)| TyProduct of typ list
Internal use only
*)| TyRecord of name * (string * typ) list
Name, fields
*)val make_var : unit -> 'a var
val new_type_var : unit -> typ
val new_size_var : unit -> siz
val new_name_var : unit -> name
val no_type : typ
val type_int : int list -> typ
val is_event_type : typ -> bool
is_event_type t
is true
iff t=TyEvent
val ivars_of : typ -> string list
ivars_of t
returns the list of index variables occuring in type t
tycons_of t
returns the list of enum constructors occuring in type t
, with the associated type
val size_of : typ -> int
size_of t
returns the "size" of type
val is_lit_name : name -> bool
is_lit_name n
returns true
iff n=NmLit _
subst_indexes env t
substitutes all index variables listed in env
in type t
type_equal b t t'
returns true iff types t
and t'
are "equivalent". If b=true
, equivalence means structural equivalence (so that, for instance, TyInt None
is different from TyInt (Some (lo,hi)
. If b=false
, all TyInt _
are equivalents and equivalence of enumerated types means inclusion, so that, for instance, type_equal ~strict:false {On,Off} {On} = true
(but not the other way).
val type_instance : typ_scheme -> typ
val string_of_type_scheme : typ_scheme -> string
val string_of_type : ?szvars:bool -> typ -> string
val string_of_name : name -> string