module Value: sig
.. end
Dynamic values
type
t =
| |
Unit |
| |
Int of int64 |
| |
Bool of bool |
| |
Float of float |
| |
String of string |
| |
Enum of t list |
| |
Tuple of t list |
| |
Dict of (string * t) list |
| |
Sum of string * t list |
| |
Null |
| |
Value of t |
| |
Arrow of string |
| |
Rec of (string * int64) * t |
| |
Var of (string * int64) |
| |
Ext of (string * int64) * t |
Utility functions
val free_vars : t -> (string * int64) list
free_vars v
returns the free variables inside v
. If v
is obtained using value_of_t
then this
list should be empty
val equal : t -> t -> bool
Checks whether two values are equal (this looks for equivalence modulo eta-conversion on variable indices)
val to_string : t -> string
to_string v
pretty-prints the value v
exception Parse_error of string
val of_string : string -> t
of_string str
returns the value which had been pretty-printed to
str
. Raises
Value.Parse_error
if
str
has
not a valid format.