Ppx based type_conv for various tree data formats
Module type Meta_conv . Types . S
include Min
type target
val format : Format.formatter -> target -> unit

The target must be printable.

module Constr : sig ... end
module Deconstr : sig ... end

Primitive ADT decoders. They may raise exceptions.

exception Exception of target Error.t

Exception for decoding error. We must declare here and not in a more general place, since the error contains target, and we cannot have polymorphic exceptions in OCaml.

type 'a encoder = ( 'a, target ) Encoder.t
type 'a decoder = ( 'a, target ) Decoder.t
type 'a decoder_exn = ( 'a, target ) Decoder.t_exn
module DeconstrDecoder : sig ... end

Auto generated decoders from Deconstr

val exn : 'a decoder -> 'a decoder_exn

Result monad decoder to decoder with runtime exception Exception.

val result : 'a decoder_exn -> 'a decoder

Any exception (including Exception) reported from decoder_exn is reported as Error

val throw : target Error.t -> 'exn

raises Exception

val catch : ( 'a -> 'b ) -> 'a -> ( 'b, target Error.t ) Result.t
val from_Ok : ( 'a, target Error.t ) Result.t -> 'a

If the argument is Error e, raises Exception e.

val format_error : Format.formatter -> target Error.t -> unit

Format the error, without its trace

val format_full_error : Format.formatter -> target Error.t -> unit

Format the error, with its full trace

val format_with : ( 'host -> target ) -> Format.formatter -> 'host -> unit

Format host data using its encoder

module Helper : sig ... end