package liquidsoap-lang

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Liquidsoap_lang.Lang_coreSource

include module type of struct include Value end
Sourcetype env = (string * Value.t) list

We derive a hash of the environment to invalidate the cache when the builtin env change. We mostly keep name and methods.

Sourceand dynamic_methods = Value.dynamic_methods = {
  1. hidden_methods : string list;
  2. methods : string -> Value.t option;
}
Sourceval hash_fold_env : Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state -> env -> Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state
Sourceval hash_fold_dynamic_methods : Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state -> dynamic_methods -> Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state
Sourceval hash_fold_t : Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state -> Value.t -> Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state
Sourceval hash_env : env -> Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.hash_value
Sourceval hash_dynamic_methods : dynamic_methods -> Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.hash_value
Sourceval hash : Value.t -> Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.hash_value
Sourcetype fun_v = Value.fun_v = {
  1. fun_args : (string * string * Value.t option) list;
  2. fun_env : env;
  3. fun_body : Term.t;
}
Sourcetype ffi = Value.ffi = {
  1. ffi_args : (string * string * Value.t option) list;
  2. ffi_fn : env -> Value.t;
}
Sourcetype in_value = [
  1. | `Int of int
  2. | `Float of float
  3. | `String of string
  4. | `Bool of bool
  5. | `Null
  6. | `Custom of Liquidsoap_lang.Term.Custom.t
  7. | `List of Value.t list
  8. | `Tuple of Value.t list
  9. | `Fun of fun_v
  10. | `FFI of ffi
]
Sourceval set_pos : Value.t -> Pos.Option.t -> Value.t
Sourceval has_flag : Value.t -> Flags.flag -> bool
Sourceval add_flag : Value.t -> Flags.flag -> unit
Sourceval is_unit : Value.t -> bool
Sourceval fun_id : int Atomic.t
Sourceval string_of_int_value : flags:Flags.flags -> int -> string
Sourceval invoke : Value.t -> string -> Value.t

Find a method in a value.

Sourceval invokes : Value.t -> string list -> Value.t

Perform a sequence of invokes: invokes x l1;l2;l3;... is x.l1.l2.l3...

Sourceval demeth : Value.t -> Value.t
Sourceval remeth : Value.t -> Value.t -> Value.t
Sourceval split_meths : Value.t -> (string * Value.t) list * Value.t
Sourceval compare : Value.t -> Value.t -> int
Sourcemodule type Custom = Value.Custom
Sourcemodule type CustomDef = Value.CustomDef
Sourcemodule MkCustomFromTerm = Value.MkCustomFromTerm
Sourcemodule MkCustom = Value.MkCustom
Sourcemodule RuntimeType = Value.RuntimeType
module Methods = Term.Methods
Sourcetype t = Type.t
Sourcetype module_name = string
Sourcetype scheme = Type.scheme
Sourcetype value = Value.t

Type construction

Sourceval int_t : Type.t
Sourceval unit_t : Type.t
Sourceval float_t : Type.t
Sourceval bool_t : Type.t
Sourceval string_t : Type.t
Sourceval tuple_t : Type.t list -> Type.t
Sourceval product_t : Type.t -> Type.t -> Type.t
Sourceval record_t : (string * Type.t) list -> Type.t
Sourceval optional_record_t : (string * Type.t) list -> Type.t
Sourceval method_t : Type.t -> (string * Type.scheme * string) list -> Type.t
Sourceval optional_method_t : Type.t -> (string * Type.scheme * string) list -> Type.t
Sourceval of_tuple_t : Type.t -> Type.t list
Sourceval of_product_t : Type.t -> Type.t * Type.t
Sourceval list_t : Type.t -> Type.t
Sourceval of_list_t : Type.t -> Type.t
Sourceval nullable_t : Type.t -> Type.t
Sourceval univ_t : ?constraints:Type.constr list -> unit -> Type.t
Sourceval getter_t : Type.t -> Type.t
Sourceval ref_t : Type.t -> Type.t

Value construction

Sourceval unit : Value.t
Sourceval int : int -> Value.t
Sourceval octal_int : int -> Value.t
Sourceval hex_int : int -> Value.t
Sourceval bool : bool -> Value.t
Sourceval float : float -> Value.t
Sourceval string : string -> Value.t
Sourceval tuple : Value.t list -> Value.t
Sourceval product : Value.t -> Value.t -> Value.t
Sourceval list : Value.t list -> Value.t
Sourceval null : Value.t
Sourceval meth : Value.t -> (string * Value.t) list -> Value.t
Sourceval record : (string * Value.t) list -> Value.t
Sourceval val_fun : (string * string * Value.t option) list -> (env -> Value.t) -> Value.t
Sourceval term_fun : (string * string * Value.t option) list -> Term.t -> Value.t
Sourceval val_cst_fun : (string * Value.t option) list -> Value.t -> Value.t
Sourceval reference : (unit -> Value.t) -> (Value.t -> 'a) -> Value.t

Helpers for defining builtin functions.

Sourcetype proto = (string * t * value option * string option) list
Sourceval builtin_type : (string * Type.t * 'a option * 'b) list -> Type.t -> Type.t
Sourceval meth_fun : Value.t -> (string * Value.t) list -> Value.t
Sourceval mk_module_name : ?base:string -> string -> string
Sourcetype 'a meth = {
  1. name : string;
  2. scheme : scheme;
  3. descr : string;
  4. value : 'a;
}
Sourceval add_builtin : category:Doc.Value.category -> descr:string -> ?flags:Doc.Value.flag list -> ?meth:Value.t meth list -> ?examples:string list -> ?base:string -> string -> (string * Type_base.t * Value.t option * string option) list -> Type.t -> (env -> Value.t) -> string
Sourceval add_builtin_value : category:Doc.Value.category -> descr:string -> ?flags:Doc.Value.flag list -> ?base:string -> string -> Value.t -> Type.t -> string
Sourceval add_builtin_base : category:Doc.Value.category -> descr:string -> ?flags:Doc.Value.flag list -> ?base:string -> string -> in_value -> Type.t -> string
Sourceval add_module : ?base:string -> string -> string
Sourceval module_name : 'a -> 'a
Sourceval apply_fun : (?pos:Pos.t list -> value -> env -> value) ref
Sourceval apply : ?pos:Pos.t list -> value -> env -> value

High-level manipulation of values

Sourceval to_unit : Value.t -> unit
Sourceval to_bool : Value.t -> bool
Sourceval to_bool_getter : Value.t -> unit -> bool
Sourceval to_fun : value -> env -> value
Sourceval to_string : Value.t -> string
Sourceval to_string_getter : Value.t -> unit -> string
Sourceval to_float : Value.t -> float
Sourceval to_float_getter : Value.t -> unit -> float
Sourceval to_int : Value.t -> int
Sourceval to_int_getter : Value.t -> unit -> int
Sourceval to_num : Value.t -> [> `Float of float | `Int of int ]
Sourceval to_list : Value.t -> Value.t list
Sourceval to_tuple : Value.t -> Value.t list
Sourceval to_option : Value.t -> Value.t option
Sourceval to_valued_option : (Value.t -> 'a) -> Value.t -> 'a option
Sourceval to_default_option : default:'a -> (Value.t -> 'a) -> Value.t -> 'a
Sourceval to_product : Value.t -> Value.t * Value.t
Sourceval to_string_list : Value.t -> string list
Sourceval to_int_list : Value.t -> int list
Sourceval to_getter : Value.t -> unit -> value
Sourceval to_ref : Value.t -> (unit -> value) * (Value.t -> unit)
Sourceval to_valued_ref : (value -> 'a) -> ('b -> Value.t) -> Value.t -> (unit -> 'a) * ('b -> unit)
Sourceval assoc : 'a -> int -> ('a * 'b) list -> 'b

assoc lbl n l returns the nth element in l of which the first component is lbl.

Sourceval raise_error : ?bt:Printexc.raw_backtrace -> ?message:string -> pos:Pos.t list -> string -> 'a
Sourceval runtime_error_of_exception : bt:Printexc.raw_backtrace -> kind:string -> exn -> Runtime_error.runtime_error
Sourceval raise_as_runtime : bt:Printexc.raw_backtrace -> kind:string -> exn -> 'a
Sourceval environment : unit -> (string * string) list
Sourcemodule Position : sig ... end
Sourcemodule Stacktrace : sig ... end
Sourceval pos_var : string
Sourceval pos : (string * Value.t) list -> Pos.t list