Liquidsoap_lang.Term_baseTerms and values in the Liquidsoap language.
include module type of struct include Runtime_term endmodule Vars = Runtime_term.VarsSets of variables.
module Methods = Runtime_term.Methodstype custom = Runtime_term.customval hash_fold_custom :
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
custom ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.stateval hash_custom :
custom ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.hash_valueval hash_fold_custom_handler :
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
custom_handler ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.stateval hash_custom_handler :
custom_handler ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.hash_valueval hash_fold_custom_term :
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
custom_term ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.stateval hash_custom_term :
custom_term ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.hash_valuetype 'a term = 'a Runtime_term.term = {t : Type.t;term : 'a;flags : Flags.flags;methods : 'a term Methods.t;}val has_flag : 'a term -> Flags.flag -> booltype ('a, 'b) func_argument = ('a, 'b) Runtime_term.func_argument = {label : string;as_variable : string option;default : 'a option;typ : 'b;pos : Pos.t option;}val hash_fold_func_argument :
'a 'b. (Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
'a ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state) ->
(Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
'b ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state) ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
('a, 'b) func_argument ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.statetype ('a, 'b) func = ('a, 'b) Runtime_term.func = {mutable free_vars : Vars.t option;name : string option;arguments : ('a, 'b) func_argument list;body : 'a;}val hash_fold_cast :
'a 'b. (Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
'a ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state) ->
(Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
'b ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state) ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
('a, 'b) cast ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.statetype ('a, 'b) common_ast = [ | `Custom of custom_term| `Tuple of 'a list| `Null| `Cast of ('a, 'b) cast| `Open of 'a * 'a| `Var of string| `Seq of 'a * 'a ]val hash_fold_common_ast :
'a 'b. (Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
'a ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state) ->
(Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
'b ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state) ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.state ->
('a, 'b) common_ast ->
Liquidsoap_lang.Term_hash.Ppx_hash_lib.Std.Hash.statetype 'a let_t = 'a Runtime_term.let_t = {doc : Doc.Value.t option;replace : bool;pat : pattern;mutable gen : Type.var list;def : 'a;body : 'a;}type 'a runtime_ast = [ | `Int of int| `Cache_env of cached_env Stdlib.ref| `Float of float| `String of string| `Bool of bool| `Let of 'a let_t| `List of 'a list| `App of 'a * (string * 'a) list| `Invoke of 'a invoke| `Hide of 'a * string list| `Encoder of
string * 'a {encoder_params}1/shadowed/(c41aab6629503086fca000827bdd87e9)| `Fun of ('a, Type.t) func ]type encoder = t Runtime_term.encodertype encoder_params = t Runtime_term.encoder_paramsexception Internal_error of Pos.t list * stringAn internal error. Those should not happen in theory...
exception Parse_error of parsed_pos * stringA parsing error.
exception Unsupported_encoder of Pos.t option * stringUnsupported encoder
module Custom = Term_customval is_ground :
[> `Bool of 'b
| `Float of 'c
| `Int of 'd
| `List of 'a list
| `Null
| `String of 'e
| `Tuple of 'a list ]
term as 'a ->
boolString representation of terms, (almost) assuming they are in normal form.
val to_string : t -> stringval free_term_vars :
[< `App of 'a term * ('b * 'a term) list
| `Bool of 'c
| `Cache_env of 'd
| `Cast of ('a term, 'e) cast
| `Custom of 'f
| `Encoder of
('h
* [< `Anonymous of 'i | `Encoder of 'g | `Labelled of 'j * 'a term ] list) as 'g
| `Float of 'k
| `Fun of ('a term, 'l) func
| `Hide of 'a term * string list
| `Int of 'm
| `Invoke of 'a term invoke
| `Let of 'a term let_t
| `List of 'a term list
| `Null
| `Open of 'a term * 'a term
| `Seq of 'a term * 'a term
| `String of 'n
| `Tuple of 'a term list
| `Var of Vars.elt ] as 'a
term ->
Vars.tval free_fun_vars :
([< `App of 'b * ('d * 'b) list
| `Bool of 'e
| `Cache_env of 'f
| `Cast of ('b, 'g) cast
| `Custom of 'h
| `Encoder of
('j * [< `Anonymous of 'k | `Encoder of 'i | `Labelled of 'l * 'b ] list) as 'i
| `Float of 'm
| `Fun of 'a
| `Hide of 'c term * string list
| `Int of 'n
| `Invoke of 'b invoke
| `Let of 'b let_t
| `List of 'b list
| `Null
| `Open of 'b * 'b
| `Seq of 'b * 'b
| `String of 'o
| `Tuple of 'b list
| `Var of Vars.elt ] as 'c
term as 'b,
'p)
func as 'a ->
Vars.tval free_vars :
?bound:string list ->
[< `App of 'a * ('c * 'a) list
| `Bool of 'd
| `Cache_env of 'e
| `Cast of ('a, 'f) cast
| `Custom of 'g
| `Encoder of
('i * [< `Anonymous of 'j | `Encoder of 'h | `Labelled of 'k * 'a ] list) as 'h
| `Float of 'l
| `Fun of ('a, 'm) func
| `Hide of 'b term * string list
| `Int of 'n
| `Invoke of 'a invoke
| `Let of 'a let_t
| `List of 'a list
| `Null
| `Open of 'a * 'a
| `Seq of 'a * 'a
| `String of 'o
| `Tuple of 'a list
| `Var of Vars.elt ] as 'b
term as 'a ->
Vars.tval can_ignore : Type.t -> boolValues which can be ignored (and will thus not raise a warning if ignored).
exception Unbound of Pos.Option.t * stringTrying to use an unbound variable.
exception Ignored of tSilently discarding a meaningful value.
No_label (f,lbl,first,x) indicates that the parameter x could not be passed to the function f because the latter has no label lbl. The first information tells whether lbl=x is the first parameter with label lbl in the considered application, which makes the message a bit more helpful.
exception Duplicate_label of Pos.Option.t * stringA function defines multiple arguments with the same label.
exception Missing_arguments of Pos.Option.t * (string * Type.t) listSome mandatory arguments with given label and typed were not passed to the function during an application.
exception Unused_variable of string * Pos.tCheck that all let-bound variables are used. No check is performed for variable arguments. This cannot be done at parse-time (as for the computation of the free variables of functions) because we need types, as well as the ability to distinguish toplevel and inner let-in terms.
exception Deprecated of string * Pos.tval check_unused :
throw:(bt:Stdlib.Printexc.raw_backtrace -> exn -> unit) ->
lib:bool ->
[< `App of 'a * ('c * 'a) list
| `Bool of 'd
| `Cache_env of 'e
| `Cast of ('a, 'f) cast
| `Custom of 'g
| `Encoder of
('i * [< `Anonymous of 'j | `Encoder of 'h | `Labelled of 'k * 'a ] list) as 'h
| `Float of 'l
| `Fun of ('a, 'm) func
| `Hide of 'b term * string list
| `Int of 'n
| `Invoke of 'a invoke
| `Let of 'a let_t
| `List of 'a list
| `Null
| `Open of 'a * 'a
| `Seq of 'a * 'a
| `String of 'o
| `Tuple of 'a list
| `Var of Vars.elt ] as 'b
term as 'a ->
unitmodule type Custom = sig ... endmodule type CustomDef = sig ... endval make :
?pos:Pos.t ->
?t:Type.t ->
?flags:Flags.flags ->
?methods:ast term Methods.t ->
ast ->
ast termCreate a new value.
val fresh :
handler:Type.Fresh.mapper ->
[< `App of 'a * ('c * 'a) list
| `Bool of 'd
| `Cache_env of 'e
| `Cast of ('a, Type_base.t) cast
| `Custom of 'f
| `Encoder of
('h * [ `Anonymous of 'i | `Encoder of 'g | `Labelled of 'j * 'a ] list) as 'g
| `Float of 'k
| `Fun of ('a, Type_base.t) func
| `Hide of 'a * 'l
| `Int of 'm
| `Invoke of 'a invoke
| `Let of 'a let_t
| `List of 'a list
| `Null
| `Open of 'a * 'a
| `Seq of 'a * 'a
| `String of 'n
| `Tuple of 'a list
| `Var of 'o App Cast Encoder Fun Hide Invoke Let List Null Open Seq Tuple Var ] as 'b
term as 'a ->
'a