Liquidsoap_lang_types.TypeTypes and their constructors.
type custom = Type_base.customtype custom_handler = Type_base.custom_handler = {typ : custom;serialize : custom -> string;copy_with : (t -> t) -> custom -> custom;occur_check : (t -> unit) -> custom -> unit;filter_vars : (Type_base.var list -> t -> Type_base.var list) ->
Type_base.var list ->
custom ->
Type_base.var list;repr : (Type_base.var list -> t -> Type_base.constr Type_base.R.t) ->
Type_base.var list ->
custom ->
Type_base.constr Type_base.R.t;subtype : (t -> t -> unit) -> custom -> custom -> unit;sup : (t -> t -> t) -> custom -> custom -> custom;}type custom_handler_state = Type_base.custom_handler_state = | Resolved of custom_handler| Dumped of {payload_id : int;payload : string;types : t list;}type custom_instance = Type_base.custom_instance = {custom_name : string;mutable handler_state : custom_handler_state;}val custom_handler : custom_instance -> custom_handlerWhat a custom type carries here. Raises Failure for one that a dump brought in, which carries nothing.
type descr = Type_base.descr = | String| Int| Float| Bool| Never| Custom of custom_instance| Constr of Type_base.constructed| Getter of ta getter: something that is either a t or () -> t
*)| List of Type_base.repr_t| Tuple of t list| Nullable of tsomething that is either t or null
*)| Meth of Type_base.meth * tt with a method added
*)| Arrow of t Type_base.argument list * ta function
*)| Var of var_ta type variable
*)type constr = private Type_base.constr = {constr_name : string;constr_descr : string;univ_descr : string option;satisfied : subtype:(t -> t -> unit) -> satisfies:(t -> unit) -> t -> unit;}module Constraints = Type_base.Constraintsval constr :
?univ_descr:string ->
name:string ->
descr:string ->
(subtype:(t -> t -> unit) -> satisfies:(t -> unit) -> t -> unit) ->
constrBuilds a constraint and records it under name, which is how a dump carries it: a reader resolves that name to its own constraint, or, having none, to one that prints the same and accepts everything.
val registered_constraint : string -> constr optionval string_of_constr : constr -> stringval record_constr : constrval num_constr : constrval ord_constr : constrmodule R = Type_base.Rval unit : descrmodule Var = Type_base.Varmodule Vars = Type_base.Varsmodule Fresh : sig ... endGenerate fresh types from existing types.
val make : ?pos:Liquidsoap_lang_prelude.Pos.t -> descr -> tval has_meth : t -> string -> boolval meth :
?pos:Liquidsoap_lang_prelude.Pos.t ->
?json_name:string ->
?category:[ `Method | `Callback | `Composition ] ->
?optional:bool ->
string ->
scheme ->
?doc:string ->
t ->
tval reference : ?pos:Liquidsoap_lang_prelude.Pos.t -> t -> tType of references on a given type.
val meths :
?invoke:(t -> string -> scheme) ->
?pos:Liquidsoap_lang_prelude.Pos.t ->
string list ->
scheme ->
t ->
tinvoke is used to raise proper exception in Typechecking.
val var :
?constraints:constr list ->
?level:int ->
?pos:Liquidsoap_lang_prelude.Pos.t ->
unit ->
tval mk_invariant : t -> unitval string_of_scheme : scheme -> stringval is_fun : t -> boolval is_source : t -> boolmodule Custom = Type_customval register_type : string -> (unit -> t) -> unitval find_opt_typ : string -> (unit -> t) option