package ppx_repr

  1. Overview
  2. Docs

Parameters

module M : Monad.S

Signature

module M = M
val encode : ('a, 'b) Typ.t -> subderive:('a -> ('b, 'e) M.t) -> lib:string option -> type_name:string -> 'a list -> (Ppxlib.expression, 'e) M.t

Build the functional encoding of a composite type. Combine the various elements necessary for a functional encoding of a composite type ('a, 'b) {!typ}, in terms its components of type 'a list and the name of the composite type type_name.

This requires a function subderive for deriving the type representation of the subcomponents, which may run in a monadic context M.t.

OCaml

Innovation. Community. Security.