decoders

Elm-inspired decoders for Ocaml
Library decoders
Module Decoders . Decode
type 'value exposed_error =
| Decoder_error of string * 'value option
| Decoder_errors of 'value exposed_error list
| Decoder_tag of string * 'value exposed_error
type ('good, 'bad) result = ( 'good, 'bad ) Decoders_util.My_result.t =
| Ok of 'good
| Error of 'bad
type ('value, 'a) exposed_decoder = {
run : 'value -> ( 'a, 'value exposed_error ) result;
}
module type S = sig ... end

User-facing Decoder interface.

Creating a Decoder implementation

The following is useful only if you are creating a new Decoder implementation.

module type Decodeable = sig ... end

Signature of things that can be decoded.

module Make (M : Decodeable) : S with type value = M.value and type 'a decoder = ( M.value, 'a ) exposed_decoder

Derive decoders for a Decodeable.value.