type typ =
| I32
| I64
| F32
| F64
type func = {
name : string;
params : (string option * typ) list;
results : typ list;
locals : (string option * typ) list;
body : Instructions.expr;
}
type memory = {
min_pages : int;
max_pages : int option;
}
type import_desc =
| FuncImport of string * typ list * typ list
type import = {
module_name : string;
name : string;
desc : import_desc;
}
type export_desc =
| FuncExport of string
type data = {
offset : int;
value : string;
}
val string_of_typ : typ -> string
val string_of_params : (string option * typ) list -> string
val string_of_results : typ list -> string
val string_of_locals : (string option * typ) list -> string
val string_of_func : func -> string
val string_of_import : import -> string
val string_of_export : export -> string
val string_of_memory : memory -> string
val string_of_data : data -> string
val string_of_module : module_ -> string