Extension methods for haxe's built-in Either type

Static methods

staticap<A, B, C>(fn:Either<A, B ‑> C>, e:Either<A, B>):Either<A, C>

staticinlineasLeft<A, B>(a:A):Either<A, B>

staticinlineasRight<A, B>(b:B):Either<A, B>

staticbiMap<A, B, X, Y>(e:Either<A, B>, whenLeft:A ‑> X, whenRight:B ‑> Y):Either<X, Y>

staticflatMap<A, B, C>(e:Either<A, B>, fn:B ‑> Either<A, C>):Either<A, C>

staticlefts<A, B>(es:Iterable<Either<A, B>>):Iterable<A>

staticmap<A, B, C>(e:Either<A, B>, f:B ‑> C):Either<A, C>

staticmatch<A, B, C>(e:Either<A, B>, whenLeft:A ‑> C, whenRight:B ‑> C):C

staticmutate<A, B>(e:Either<A, B>, whenLeft:A ‑> Void, whenRight:B ‑> Void):Either<A, B>

staticmutate_<A, B>(e:Either<A, B>, whenRight:B ‑> Void):Either<A, B>

staticrights<A, B>(es:Iterable<Either<A, B>>):Iterable<B>

statictoNullable<A, B>(e:Either<A, B>):Null<B>

statictoOption<A, B>(e:Either<A, B>):Option<B>

statictoOutcome<A, B>(e:Either<A, B>, ?pos:Null<PosInfos>):Outcome<B>

staticzip<X, A, B>(eA:Either<X, A>, eB:Either<X, B>):Either<X, Pair<A, B>>

staticzipWith<X, A, B, C>(eA:Either<X, A>, eB:Either<X, B>, fn:(A, B) ‑> C):Either<X, C>