package decoders

  1. Overview
  2. Docs
type 'value exposed_error =
  1. | Decoder_error of string * 'value option
  2. | Decoder_errors of 'value exposed_error list
  3. | Decoder_tag of string * 'value exposed_error
type ('good, 'bad) result = ('good, 'bad) CCResult.t =
  1. | Ok of 'good
  2. | Error of 'bad
type ('value, 'a) exposed_decoder = {
  1. run : 'value -> ('a, 'value exposed_error) result;
}
module type S = sig ... end

User-facing Decoder interface.

Creating a Decoder implementation

The following are 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.

OCaml

Innovation. Community. Security.