Liquidsoap_lang.LangValues and types of the liquidsoap language.
type t = Type.tThe type of a value.
type scheme = Type.schemetype regexp = Builtins_regexp.regexpmodule Custom = Liquidsoap_lang.Value.Custommodule Methods = Term.Methodstype in_value = Value.in_valuetype env = Value.envtype value = Value.tval error_module : module_nameMultiapply a value to arguments. The argument t is the type of the result of the application.
val add_builtin :
category:Doc.Value.category ->
descr:string ->
?flags:Doc.Value.flag list ->
?meth:value meth list ->
?examples:string list ->
?base:module_name ->
string ->
proto ->
t ->
(env -> value) ->
module_nameAdd a builtin to the language, high-level version for functions.
val add_builtin_value :
category:Doc.Value.category ->
descr:string ->
?flags:Doc.Value.flag list ->
?base:module_name ->
string ->
value ->
t ->
module_nameAdd a builtin value to the language
val add_builtin_base :
category:Doc.Value.category ->
descr:string ->
?flags:Doc.Value.flag list ->
?base:module_name ->
string ->
Value.in_value ->
t ->
module_nameAdd a builtin to the language, more rudimentary version.
val add_module : ?base:module_name -> string -> module_nameDeclare a new module.
val module_name : module_name -> stringval to_unit : value -> unitval to_bool : value -> boolval to_bool_getter : value -> unit -> boolval to_string : value -> stringval to_string_getter : value -> unit -> stringval to_float : value -> floatval to_float_getter : value -> unit -> floatval to_error : value -> Runtime_error.runtime_errorval to_int : value -> intval to_int_getter : value -> unit -> intval to_num : value -> [ `Int of int | `Float of float ]val to_string_list : value -> string listval to_int_list : value -> int listassoc x n l returns the n-th y such that (x,y) is in the list l. This is useful for retrieving arguments of a function.
val int_t : tval unit_t : tval float_t : tval bool_t : tval string_t : tval regexp_t : tval error_t : tval error_meths_t : tfun_t args r is the type of a function taking args as parameters and returning values of type r. The elements of r are of the form (b,l,t) where b indicates if the argument is optional, l is the label of the argument ("" means no label) and t is the type of the argument.
val univ_t : ?constraints:Type.constr list -> unit -> tval unit : valueval int : int -> valueval octal_int : int -> valueval hex_int : int -> valueval bool : bool -> valueval float : float -> valueval string : string -> valueval null : valueval error : Runtime_error.runtime_error -> valueBuild a function from an OCaml function. Items in the prototype indicate the label and optional values. Second string value is used when renaming argument name, e.g. `fun (foo=_, ...) -> `
Build a function from a term.
Build a constant function. It is slightly less opaque and allows the printing of the closure when the constant is ground.
val raise_error :
?bt:Stdlib.Printexc.raw_backtrace ->
?message:string ->
pos:Pos.List.t ->
string ->
'aRaise an error.
val runtime_error_of_exception :
bt:Stdlib.Printexc.raw_backtrace ->
kind:string ->
exn ->
Runtime_error.runtime_errorConvert an exception into a runtime error.
Re-raise an error as a runtime error.
val descr_of_regexp : regexp -> stringReturn an unescaped string description of a regexp, i.e. ^foo/bla$
val string_of_regexp : regexp -> stringReturn a string description of a regexp value i.e. r/^foo\/bla$/g
val type_term :
?name:string ->
?cache:bool ->
?trim:bool ->
?deprecated:bool ->
?ty:t ->
stdlib:stdlib ->
parsed_term:Parsed_term.t ->
Term.t ->
Term.tType a term, possibly returning the cached term instead.