Library
Module
Module type
Parameter
Class
Class type
type 'a decoder = t -> 'a
The type for decoder functions which turn JSON into an OCaml value
functions that are unsuccessful in decoding the JSON raise Decode_error
val null : 'a Js_of_ocaml.Js.opt decoder
Only decode a JSON null
val bool : bool decoder
Decode true
or false
val float : float decoder
Decode a JSON number
val int : int decoder
Decode a finite non-decimal JSON number
val string : string decoder
Decode a JSON string
val char : char decoder
Decode a single-character JSON string
Transform a decoder so it decodes nulls as None
and other decoded values as Some
Decode a 2-element JSON array with the given decoders
Decode a 2-element JSON array with the given decoders
Decode a 3-element JSON array with the given decoders
Decode a 4-element JSON array with the given decoders
Decode a JSON dictionary as a hash table of strings to decoded values
Decode an element of a JSON dictionary with the decoder
Follow a list of field names and decode the final element with the decoder
Catch Decode_error
, return a default value if raised
Try a list of decoders until one succeeds, raise Decode_error
if none succeed
Try two decoders, raise Decode_error
if neither succeed