Module Generic_util.Exn

module Exn: Generic_util_exn
Operations on/with exceptions.

exception Not_yet_implemented
Indicates a feature that is yet to be implemented.
exception Undefined
A function may raise Undefined outside of its domain of definition.
exception Failed
Indicates a failure. Used by Generic_util_exn.guard, Generic_util_exn.only_if, Generic_util_exn.one_of, Generic_util_option.get_some.
val guard : bool -> unit
guard x does nothing if x is true, but raises Generic_util_exn.Failed if x is false.
val only_if : ('a -> bool) -> 'a -> 'a
only_if f x returns x only if f x is true.
Raises Failed when f x is false.
val one_of : 'a Lazy.t list -> 'a
one_of xs tries each action of the list xs in turn until one succeeds (meaning that it does not raise any exception).
Raises Failed If the action list is empty or if all the actions raised an exception.