Module Deriving_JsonSource

Typesafe IO (based on the deriving library).

Sourcetype 'a t

The type of JSON parser/printer for value of type 'a.

Sourceval make : (Buffer.t -> 'a -> unit) -> (Deriving_Json_lexer.lexbuf -> 'a) -> 'a t
Sourceval write : 'a t -> Buffer.t -> 'a -> unit
Sourceval read : 'a t -> Deriving_Json_lexer.lexbuf -> 'a
Sourceval to_string : 'a t -> 'a -> string

to_string Json.t<ty> v marshal the v of type ty to a JSON string.

Sourceval from_string : 'a t -> string -> 'a

from_string Json.t<ty> s safely unmarshal the JSON s into an OCaml value of type ty. Throws Failure if the received value isn't the javascript representation of a value of type ty.

Sourcemodule type Json = sig ... end

The signature of the JSON class.

Deriver

Sourcemodule type Json_min = sig ... end
Sourcemodule type Json_min' = sig ... end
Sourcemodule type Json_min'' = sig ... end
Sourcemodule Defaults (J : Json_min) : Json with type a = J.a
Sourcemodule Defaults' (J : Json_min') : Json with type a = J.a
Sourcemodule Defaults'' (J : Json_min'') : Json with type a = J.a
Sourcemodule Json_char : Json with type a = char
Sourcemodule Json_bool : Json with type a = bool
Sourcemodule Json_unit : Json with type a = unit
Sourcemodule Json_int : Json with type a = int
Sourcemodule Json_int32 : Json with type a = int32
Sourcemodule Json_int64 : Json with type a = int64
Sourcemodule Json_nativeint : Json with type a = nativeint
Sourcemodule Json_float : Json with type a = float
Sourcemodule Json_string : Json with type a = string
Sourcemodule Json_list (A : Json) : Json with type a = A.a list
Sourcemodule Json_ref (A : Json) : Json with type a = A.a ref
Sourcemodule Json_option (A : Json) : Json with type a = A.a option
Sourcemodule Json_array (A : Json) : Json with type a = A.a array
Sourceval read_list : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a list
Sourceval write_list : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a list -> unit
Sourceval write_ref : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a ref -> unit
Sourceval read_option : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a option
Sourceval write_option : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a option -> unit
Sourceval read_array : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a array
Sourceval write_array : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a array -> unit