Module Base__.Either

type ('f, 's) t =
| First of 'f
| Second of 's

This type represents values with two possibilities. Either can be seen as a generic sum type, the dual of Tuple. First is neither more important nor less important than Second.

include sig ... end
val compare : ('f ‑> 'f ‑> int) ‑> ('s ‑> 's ‑> int) ‑> ('f'st ‑> ('f'st ‑> int
val hash_fold_t : (Base.Hash.state ‑> 'f ‑> Base.Hash.state) ‑> (Base.Hash.state ‑> 's ‑> Base.Hash.state) ‑> Base.Hash.state ‑> ('f'st ‑> Base.Hash.state
val t_of_sexp : (Base.Sexp.t ‑> 'f) ‑> (Base.Sexp.t ‑> 's) ‑> Base.Sexp.t ‑> ('f'st
val sexp_of_t : ('f ‑> Base.Sexp.t) ‑> ('s ‑> Base.Sexp.t) ‑> ('f'st ‑> Base.Sexp.t
include Base.Invariant.S2 with type (a, b) t := (a, b) t
type ('a, 'b) t
val swap : ('f'st ‑> ('s'ft
val value : ('a'at ‑> 'a
val iter : ('a'bt ‑> first:('a ‑> unit) ‑> second:('b ‑> unit) ‑> unit
val value_map : ('a'bt ‑> first:('a ‑> 'c) ‑> second:('b ‑> 'c) ‑> 'c
val map : ('a'bt ‑> first:('a ‑> 'c) ‑> second:('b ‑> 'd) ‑> ('c'dt
val equal : ('f ‑> 'f ‑> bool) ‑> ('s ‑> 's ‑> bool) ‑> ('f'st ‑> ('f'st ‑> bool
module First : Base.Either_intf.Focused with type ('a, 'b) t = ('a'bt
module Second : Base.Either_intf.Focused with type ('a, 'b) t = ('b'at
val is_first : (__t ‑> bool
val is_second : (__t ‑> bool
val first : 'f ‑> ('f_t

first and second are First.return and Second.return.

val second : 's ‑> (_'st
module Export : sig ... end