package ppx_meta_conv

  1. Overview
  2. Docs

LocalException functor to have exception with target type

Typical usage: avoid Result monad bind chain, using local an exception.

let f decoder = let module E = LocalException(struct type t = target) in E.catch begin ... E.exn decoder ... ... end

Parameters

module A : sig ... end

Signature

exception Exception of A.t t
val exn : ('a -> ('b, A.t t) result) -> 'a -> 'b
val catch : ('a -> 'b) -> 'a -> ('b, A.t t) result
OCaml

Innovation. Community. Security.