12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879(** A type that 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].
Many functions in [Either] focus on just one constructor. The [Focused] signature
abstracts over which constructor is the focus. To use these functions, use the
[First] or [Second] modules in [S]. *)open!ImportmoduletypeFocused=sigtype(+'focus,+'other)tincludeMonad.S2withtype('a,'b)t:=('a,'b)tincludeApplicative.S2withtype('a,'b)t:=('a,'b)tvalvalue:('a,_)t->default:'a->'avalto_option:('a,_)t->'aoptionvalwith_return:('aWith_return.return->'b)->('a,'b)tvalcombine:('a,'d)t->('b,'d)t->f:('a->'b->'c)->other:('d->'d->'d)->('c,'d)tvalcombine_all:('a,'b)tlist->f:('b->'b->'b)->('alist,'b)tvalcombine_all_unit:(unit,'b)tlist->f:('b->'b->'b)->(unit,'b)tendmoduletypeEither=sigtype('f,'s)t=('f,'s)Either0.t=|Firstof'f|Secondof's[@@deriving_inlinecompare,hash,sexp,sexp_grammar]includePpx_compare_lib.Comparable.S2withtype('f,'s)t:=('f,'s)tincludePpx_hash_lib.Hashable.S2withtype('f,'s)t:=('f,'s)tincludeSexplib0.Sexpable.S2withtype('f,'s)t:=('f,'s)tvalt_sexp_grammar:'fSexplib0.Sexp_grammar.t->'sSexplib0.Sexp_grammar.t->('f,'s)tSexplib0.Sexp_grammar.t[@@@end]includeInvariant.S2withtype('a,'b)t:=('a,'b)tvalswap:('f,'s)t->('s,'f)tvalvalue:('a,'a)t->'avaliter:('a,'b)t->first:('a->unit)->second:('b->unit)->unitvalvalue_map:('a,'b)t->first:('a->'c)->second:('b->'c)->'cvalmap:('a,'b)t->first:('a->'c)->second:('b->'d)->('c,'d)tvalequal:('f->'f->bool)->('s->'s->bool)->('f,'s)t->('f,'s)t->boolmoduletypeFocused=FocusedmoduleFirst:Focusedwithtype('a,'b)t=('a,'b)tmoduleSecond:Focusedwithtype('a,'b)t=('b,'a)tvalis_first:(_,_)t->boolvalis_second:(_,_)t->bool(** [first] and [second] are [First.return] and [Second.return]. *)valfirst:'f->('f,_)tvalsecond:'s->(_,'s)t(**/**)moduleExport:sigtype('f,'s)_either=('f,'s)t=|Firstof'f|Secondof'sendend