package ppx_meta_conv

  1. Overview
  2. Docs
include Meta_conv.Types.S with type target = Camlon.Ocaml.t
include Meta_conv.Types.Min with type target = Camlon.Ocaml.t
type target = Camlon.Ocaml.t
val format : Stdlib.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 Meta_conv.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) Meta_conv.Types.Encoder.t
type 'a decoder = ('a, target) Meta_conv.Types.Decoder.t
type 'a decoder_exn = ('a, target) Meta_conv.Types.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 Meta_conv.Error.t -> 'exn

raises Exception

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

If the argument is Error e, raises Exception e.

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

Format the error, without its trace

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

Format the error, with its full trace

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

Format host data using its encoder

module Helper : sig ... end
module Default : sig ... end
include module type of Default
val ocaml_of_int : int encoder
val ocaml_of_nativeint : nativeint encoder
val ocaml_of_unit : unit encoder
val ocaml_of_bool : bool encoder
val ocaml_of_int32 : int32 encoder
val ocaml_of_int64 : int64 encoder
val ocaml_of_float : float encoder
val ocaml_of_char : char encoder
val ocaml_of_string : string encoder
val ocaml_of_list : 'a encoder -> 'a list encoder
val ocaml_of_array : 'a encoder -> 'a array encoder
val ocaml_of_option : 'a encoder -> 'a option encoder
val ocaml_of_ref : 'a encoder -> 'a Stdlib.ref encoder
val ocaml_of_lazy_t : 'a encoder -> 'a Stdlib.Lazy.t encoder
val ocaml_of_mc_lazy_t : 'a encoder -> ('a, target) Meta_conv.Open.mc_lazy_t encoder
val ocaml_of_mc_fields : 'a encoder -> (string * 'a) list encoder
val ocaml_of_hashtbl : 'a encoder -> 'b encoder -> ('a, 'b) Stdlib.Hashtbl.t encoder
val int_of_ocaml : int decoder
val nativeint_of_ocaml : nativeint decoder
val unit_of_ocaml : unit decoder
val bool_of_ocaml : bool decoder
val int32_of_ocaml : int32 decoder
val int64_of_ocaml : int64 decoder
val float_of_ocaml : float decoder
val char_of_ocaml : char decoder
val string_of_ocaml : string decoder
val list_of_ocaml : 'a decoder -> 'a list decoder
val array_of_ocaml : 'a decoder -> 'a array decoder
val option_of_ocaml : 'a decoder -> 'a option decoder
val ref_of_ocaml : 'a decoder -> 'a Stdlib.ref decoder
val lazy_t_of_ocaml : 'a decoder -> 'a lazy_t decoder
val hashtbl_of_ocaml : 'a decoder -> 'b decoder -> ('a, 'b) Stdlib.Hashtbl.t decoder
OCaml

Innovation. Community. Security.