module OASISDataNotation:sig
..end
OCaml data notation.
This module helps to translate OCaml data into a string following OCaml syntax.
typemodule_name =
string
typefield_name =
string
typevariant_name =
string
typevar_name =
string
type
t =
| |
REC of |
(* | List | *) |
| |
LST of |
(* | String | *) |
| |
STR of |
(* | Variant type constructor | *) |
| |
VRT of |
(* | Boolean | *) |
| |
BOO of |
(* | Tuple | *) |
| |
TPL of |
(* | Unit () | *) |
| |
UNT |
(* | Function application | *) |
| |
APP of |
(* | Variable | *) |
| |
VAR of |
(* | Polymorphic variant | *) |
| |
PVR of |
val of_unit : unit -> t
val of_bool : bool -> t
val of_string : string -> t
val of_option : ('a -> t) -> 'a option -> t
val of_list : ('a -> t) -> 'a list -> t
type 'a
func = {
|
func_call : |
|
func_name : |
|
func_arg : |
}
Function that can be generated using
func_call = APP(func, [], func_arg
).
val func : 'a -> string -> 'a func
Return the OCaml function corresponding to a func
.
val func_with_arg : ('a -> 'b) ->
string -> 'a -> ('a -> t) -> 'b func
Create a func with an argument
val func_with_arg_ctxt : (ctxt:'a -> 'b -> 'c) ->
string ->
'b -> ('b -> t) -> (ctxt:'a -> 'c) func
val odn_of_func : 'a func -> t
Return the t
code corresponding to a func
.
val func_call : 'a func -> 'a
Return the OCaml function corresponding to a func
.
val pp_odn : ?opened_modules:string list ->
Stdlib.Format.formatter -> t -> unit