package ppx_meta_conv

  1. Overview
  2. Docs

You should not open this module, unless you are writing decoders/encoders for a new target data type.

Tools used by generated code
val field_assoc_exn : string -> string -> (string * 'target) list -> ('target Error.t -> 'host) -> ('host, 'target) Types.Decoder.t_exn -> ('host, 'target) Types.Decoder.t_exn
val field_assoc_optional_exn : string -> string -> (string * 'target) list -> ('host, 'target) Types.Decoder.t_exn -> ('host option, 'target) Types.Decoder.t_exn
val filter_fields : string list -> (string * 'target) list -> (string * 'target) list * (string * 'target) list
val embeded_decoding_helper : (string * 'target) list -> 'target -> ('host, 'target Error.t) Result.t -> ('host * (string * 'target) list, 'target Error.t) Result.t

helper function for embded record field

Error decoders

They are decoders but just fail

val tuple_arity_error : int -> int -> ('host, 'target) Types.Decoder.t
val variant_arity_error : string -> string -> int -> int -> ('host, 'target) Types.Decoder.t
val variant_unknown_tag_error : string -> string -> ('host, 'target) Types.Decoder.t
val primitive_decoding_failure : string -> ('host, 'target) Types.Decoder.t
val sub_decoders_failed_for_one_of : string -> ('host, 'target) Types.Decoder.t
Misc functions
val list_filter_map : ('a -> 'b option) -> 'a list -> 'b list

List.map + List.filter

val list_mapi : (int -> 'a -> 'b) -> 'a list -> 'b list
val (~?) : 'a list option -> 'a list
OCaml

Innovation. Community. Security.