Module Deriving_Json
Typesafe IO (based on the deriving library).
- see https://github.com/ocsigen/deriving
the source code of deriving
- see http://code.google.com/p/deriving/
the documentation of the original deriving library by Jeremy Yallop.
val make : (Stdlib.Buffer.t -> 'a -> unit) -> (Deriving_Json_lexer.lexbuf -> 'a) -> 'a t
val write : 'a t -> Stdlib.Buffer.t -> 'a -> unit
val read : 'a t -> Deriving_Json_lexer.lexbuf -> 'a
val to_string : 'a t -> 'a -> string
to_string Json.t<ty> v
marshal thev
of typety
to a JSON string.
val from_string : 'a t -> string -> 'a
from_string Json.t<ty> s
safely unmarshal the JSONs
into an OCaml value of typety
. ThrowsFailure
if the received value isn't the javascript representation of a value of typety
.
module type Json = sig ... end
The signature of the JSON class.
module type Json_min = sig ... end
module type Json_min' = sig ... end
module type Json_min'' = sig ... end
module Defaults'' : functor (J : Json_min'') -> Json with type a = J.a
module Json_int32 : Json with type a = int32
module Json_int64 : Json with type a = int64
module Json_nativeint : Json with type a = nativeint
module Json_float : Json with type a = float
module Json_string : Json with type a = string
val read_list : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a list
val write_list : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a list -> unit
val read_ref : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a Stdlib.ref
val write_ref : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a Stdlib.ref -> unit
val read_option : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a option
val write_option : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a option -> unit
val read_array : (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a array
val write_array : (Stdlib.Buffer.t -> 'a -> unit) -> Stdlib.Buffer.t -> 'a array -> unit