package ppx_meta_conv

  1. Overview
  2. Docs

Module Error.LocalExceptionSource

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

Sourceexception Exception of A.t t
Sourceval exn : ('a -> ('b, A.t t) result) -> 'a -> 'b
Sourceval catch : ('a -> 'b) -> 'a -> ('b, A.t t) result