package liquidsoap-lang

  1. Overview
  2. Docs
val debug : bool Stdlib.ref

Show debugging information.

val debug_levels : bool Stdlib.ref

Show variables levels.

val debug_variance : bool Stdlib.ref

Types

type variance = [
  1. | `Covariant
  2. | `Invariant
]
type descr = ..

Type description

type t = {
  1. pos : Pos.Option.t;
  2. descr : descr;
}

A type

type constr_t = ..

Constraint type

type constr_t +=
  1. | Num
  2. | Ord
type constr = {
  1. t : constr_t;
  2. constr_descr : string;
  3. univ_descr : string option;
  4. satisfied : subtype:(t -> t -> unit) -> satisfies:(t -> unit) -> t -> unit;
}
module Constraints : sig ... end
type constructed = {
  1. constructor : string;
  2. params : (variance * t) list;
}

A type constructor applied to arguments (e.g. source).

type var = {
  1. name : int;
  2. mutable level : int;
  3. mutable constraints : Constraints.t;
}

Contents of a variable.

type invar =
  1. | Free of var
    (*

    the variable is free

    *)
type scheme = var list * t

A type scheme (i.e. a type with universally quantified variables).

type meth = {
  1. meth : string;
    (*

    name of the method

    *)
  2. optional : bool;
    (*

    is the method optional?

    *)
  3. scheme : scheme;
    (*

    type scheme

    *)
  4. doc : string;
    (*

    documentation

    *)
  5. json_name : string option;
    (*

    name when represented as JSON

    *)
}

A method.

type repr_t = {
  1. t : t;
  2. json_repr : [ `Tuple | `Object ];
}
module DS : sig ... end

Sets of type descriptions.

val string_of_constr : constr -> string
module Subst : sig ... end

Substitutions.

module R : sig ... end
type custom = ..
type custom_handler = {
  1. typ : custom;
  2. copy_with : (t -> t) -> custom -> custom;
  3. occur_check : (t -> unit) -> custom -> unit;
  4. filter_vars : (var list -> t -> var list) -> var list -> custom -> var list;
  5. repr : (var list -> t -> R.t) -> var list -> custom -> R.t;
  6. subtype : (t -> t -> unit) -> custom -> custom -> unit;
  7. sup : (t -> t -> t) -> custom -> custom -> custom;
  8. to_string : custom -> string;
}
type descr +=
  1. | Custom of custom_handler
  2. | Constr of constructed
  3. | Getter of t
    (*

    a getter: something that is either a t or () -> t

    *)
  4. | List of repr_t
  5. | Tuple of t list
  6. | Nullable of t
    (*

    something that is either t or null

    *)
  7. | Meth of meth * t
    (*

    t with a method added

    *)
  8. | Arrow of (bool * string * t) list * t
    (*

    a function

    *)
  9. | Var of invar Stdlib.ref
    (*

    a type variable

    *)
exception NotImplemented
exception Exists of Pos.Option.t * string
exception Unsatisfied_constraint
val unit : descr
module Var : sig ... end

Operations on variables.

module Vars : sig ... end

Sets of variables.

val make : ?pos:(Stdlib.Lexing.position * Stdlib.Lexing.position) -> descr -> t

Create a type from its value.

val deref : t -> t

Dereferencing gives you the meaning of a term, going through links created by instantiations. One should (almost) never work on a non-dereferenced type.

val demeth : t -> t

Remove methods. This function also removes links.

val deep_demeth : t -> t
val filter_meths : t -> (meth -> bool) -> t
val remeth : t -> t -> t

Put the methods of the first type around the second type.

val invoke : t -> string -> scheme

Type of a method in a type.

val has_meth : t -> string -> bool

Do we have a method with given label?

val invokes : t -> string list -> var list * t

Type of a submethod in a type.

val meth : ?pos:(Stdlib.Lexing.position * Stdlib.Lexing.position) -> ?json_name:string -> ?optional:bool -> string -> scheme -> ?doc:string -> t -> t

Add a method to a type.

val meths : ?pos:(Stdlib.Lexing.position * Stdlib.Lexing.position) -> string list -> scheme -> t -> t

Add a submethod to a type.

val split_meths : t -> meth list * t

Split the methods from the type.

val var : ?constraints:Constraints.elt list -> ?level:int -> ?pos:(Stdlib.Lexing.position * Stdlib.Lexing.position) -> unit -> t

Create a fresh variable.

val to_string_fun : (?generalized:var list -> t -> string) Stdlib.ref
val to_string : ?generalized:var list -> t -> string

String representation of a type.

val string_of_scheme : (var list * t) -> string
val is_fun : t -> bool
val is_source : t -> bool
val custom_types : (string, unit -> t) Stdlib.Hashtbl.t
val register_type : string -> (unit -> t) -> unit
val find_type_opt : string -> (unit -> t) option
val mk_invariant : t -> unit
OCaml

Innovation. Community. Security.