package b0

  1. Overview
  2. Docs
Software construction care

Install

Dune Dependency

Authors

Maintainers

Sources

b0-0.0.0.tbz
sha256=dadde8cfa62be9dabd805fc190b415427b4699ffe3458c153e2f3f9cc5c9b9b4
md5=f96ac96fb0182f2b97dbe9ded452544b

doc/b0.care/B0_web/Jsonq/index.html

Module B0_web.Jsonq

JSON value queries.

Queries

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 a float JSON value and truncates 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 named 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 named name with q.

val obj : 'a -> 'a t

obj v queries an object and returns v.

val json : Json.t t

json queries any JSON value.

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 query : 'a t -> Json.t -> ('a, string) result

query q j queries a JSON value j with q.

OCaml

Innovation. Community. Security.