Module ODN

module ODN: sig .. end
OCaml data notation.

This module helps to translate OCaml data into a string following OCaml syntax.



Types


type module_name = string 
type field_name = string 
type variant_name = string 
type var_name = string 
type t = 
| REC of module_name * (field_name * t) list (*List*)
| LST of t list (*String*)
| STR of string (*Variant type constructor*)
| VRT of variant_name * t list (*Boolean*)
| BOO of bool (*Integer*)
| INT of int (*Float*)
| FLT of float (*Tuple*)
| TPL of t list (*Unit ()*)
| UNT (*Function application*)
| APP of var_name * (var_name * t) list * t list (*Variable*)
| VAR of var_name (*Polymorphic variant*)
| PVR of variant_name * t option

Basic conversion


val of_unit : unit -> t
val of_bool : bool -> t
val of_string : string -> t
val of_int : int -> t
val of_float : float -> t
val of_option : ('a -> t) -> 'a option -> t
val of_list : ('a -> t) -> 'a list -> t
val of_tuple2 : ('a -> t) * ('b -> t) -> 'a * 'b -> t
val of_tuple3 : ('a -> t) * ('b -> t) * ('c -> t) -> 'a * 'b * 'c -> t
val of_tuple4 : ('a -> t) * ('b -> t) * ('c -> t) * ('d -> t) ->
'a * 'b * 'c * 'd -> t
val of_tuple5 : ('a -> t) * ('b -> t) * ('c -> t) * ('d -> t) * ('e -> t) ->
'a * 'b * 'c * 'd * 'e -> t

Formating


val pp_odn : ?opened_modules:string list -> Format.formatter -> t -> unit
val string_of_odn : ?opened_modules:string list -> t -> string