Module Cow.Json

JSON (JavaScript Object Notation) library

include module type of Ezjsonm
type value = [
  1. | `A of value list
  2. | `Bool of bool
  3. | `Float of float
  4. | `Null
  5. | `O of (string * value) list
  6. | `String of string
]
type t = [
  1. | `A of value list
  2. | `O of (string * value) list
]
val value : t -> value
val wrap : value -> [> t ]
val unwrap : t -> value
val from_channel : Stdlib.in_channel -> [> t ]
val from_string : string -> [> t ]
val from_src : Jsonm.src -> [> t ]
val to_channel : ?minify:bool -> Stdlib.out_channel -> t -> unit
val to_dst : ?minify:bool -> Jsonm.dst -> t -> unit
val unit : unit -> value
val bool : bool -> value
val string : string -> value
val strings : string list -> [> t ]
val int : int -> value
val int32 : int32 -> value
val int64 : int64 -> value
val float : float -> value
val list : ('a -> value) -> 'a list -> [> t ]
val option : ('a -> value) -> 'a option -> value
val dict : (string * value) list -> [> t ]
val pair : ('a -> value) -> ('b -> value) -> ('a * 'b) -> [> t ]
val triple : ('a -> value) -> ('b -> value) -> ('c -> value) -> ('a * 'b * 'c) -> [> t ]
exception Parse_error of value * string
val get_unit : value -> unit
val get_bool : value -> bool
val get_string : value -> string
val get_strings : value -> string list
val get_int : value -> int
val get_int32 : value -> int32
val get_int64 : value -> int64
val get_float : value -> float
val get_list : (value -> 'a) -> value -> 'a list
val get_option : (value -> 'a) -> value -> 'a option
val get_dict : value -> (string * value) list
val get_pair : (value -> 'a) -> (value -> 'b) -> value -> 'a * 'b
val get_triple : (value -> 'a) -> (value -> 'b) -> (value -> 'c) -> value -> 'a * 'b * 'c
val mem : value -> string list -> bool
val find : value -> string list -> value
val update : value -> string list -> value option -> value
val map : (value -> value option) -> value -> string list -> value
val encode_string : string -> value
val decode_string : value -> string option
val decode_string_exn : value -> string
val to_sexp : value -> Sexplib.Type.t
val sexp_of_value : value -> Sexplib.Type.t
val sexp_of_t : t -> Sexplib.Type.t
val of_sexp : Sexplib.Type.t -> value
val value_of_sexp : Sexplib.Type.t -> value
val t_of_sexp : Sexplib.Type.t -> t
val parse_error : value -> ('a, unit, string, 'b) Stdlib.format4 -> 'a
val to_buffer : value -> Stdlib.Buffer.t -> unit
val to_string : value -> string
val to_buffer_hum : value -> Stdlib.Buffer.t -> unit
val to_string_hum : value -> string
val of_string : string -> value
exception Runtime_error of string * value