module These:sig
..end
Values of two non-exclusive variants
type ('l, 'r)
t =
| |
Left of |
| |
Right of |
| |
Both of |
val _Left : 'a -> ('a, 'b) t
val _Right : 'a -> ('b, 'a) t
val _Both : 'a -> 'b -> ('a, 'b) t
module Make:
Monad instance requires Semigroup to combine Left values
val bimap : ('a -> 'b) -> ('c -> 'd) -> ('a, 'c) t -> ('b, 'd) t
val fold : ('a -> 'b) -> ('c -> 'b) -> ('a -> 'c -> 'b) -> ('a, 'c) t -> 'b
val swap : ('a, 'b) t -> ('b, 'a) t
val maybe_left : ('a, 'b) t -> 'a option
val maybe_right : ('a, 'b) t -> 'b option
val maybe_both : ('a, 'b) t -> ('a * 'b) option