Module B0_json.Q

module Q: sig .. end
JSON value queries.


Queries


type json = B0_json.t 
The type generic json representations.
type 'a t 
The type for a query on a JSON value returning values of type 'a.
val null : unit t
null queries a null JSON value.
val nullable : 'a t -> 'a option t
nullable q queries either a null JSON value or with q.
val bool : bool t
bool queries a boolean JSON value.
val int : int t
int queries an float JSON value and truncate's it.
val float : float t
float queries a float JSON value.
val string : string t
string queries a string JSON value.
val array : 'a t -> 'a list t
array q queries the elements of a JSON array with q.
val mem : string -> 'a t -> ('a -> 'b) t -> 'b t
mem name q o queries a JSON object o's member name with q.
val mem_opt : string -> 'a t -> ('a option -> 'b) t -> 'b t
mem_opt name q queries a JSON object o's optional member name with q.
val obj : 'a -> 'a t
obj v queries an object and returns v.
val get : 'a -> 'a
get is the identity function
val sel : string -> 'a t -> 'a t
sel name q is obj get |> mem name q
val json : json t
json queries any JSON value.
val query : 'a t -> json -> 'a B0.result
query q j queries a JSON value j with q.