jon.recoil.org

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 : (Stdlib.Buffer.t -> 'a -> unit) -> (Deriving_Json_lexer.lexbuf -> 'a) -> 'a Deriving_Json.t
Sourceval write : 'a Deriving_Json.t -> Stdlib.Buffer.t -> 'a -> unit
Sourceval to_string : 'a Deriving_Json.t -> 'a -> string

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

Sourceval from_string : 'a Deriving_Json.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 Json_char : Deriving_Json.Json with type a = char
Sourcemodule Json_bool : Deriving_Json.Json with type a = bool
Sourcemodule Json_unit : Deriving_Json.Json with type a = unit
Sourcemodule Json_int : Deriving_Json.Json with type a = int
Sourcemodule Json_int32 : Deriving_Json.Json with type a = int32
Sourcemodule Json_int64 : Deriving_Json.Json with type a = int64
Sourcemodule Json_nativeint : Deriving_Json.Json with type a = nativeint
Sourcemodule Json_float : Deriving_Json.Json with type a = float
Sourcemodule Json_string : Deriving_Json.Json with type a = string
Sourceval read_list : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a list
Sourceval write_list : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a list -> unit
Sourceval write_ref : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a Stdlib.ref -> unit
Sourceval read_option : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a option
Sourceval write_option : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a option -> unit
Sourceval read_array : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a array
Sourceval write_array : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a array -> unit