Extension methods for the thx.Either type.

Static methods

staticap<L, RIn, ROut> (either:Either<L, RIn>, fa:Either<L, RIn ‑> ROut>):Either<L, ROut>

ap transforms a value contained in Either<E, RIn> to Either<E, ROut> using a callback wrapped in the right side of another Either.

staticbimap<L, R, A, B> (either:Either<L, R>, l:L ‑> A, r:R ‑> B):Either<A, B>

staticcata<L, R, A> (either:Either<L, R>, l:L ‑> A, r:R ‑> A):A

staticeach<L, R> (either:Either<L, R>, f:R ‑> Void):Void

staticeachLeft<L, R> (either:Either<L, R>, f:L ‑> Void):Void

staticensure<L, R> (either:Either<L, R>, p:R ‑> Bool, error:L):Either<L, R>

staticflatMap<L, RIn, ROut> (either:Either<L, RIn>, f:RIn ‑> Either<L, ROut>):Either<L, ROut>

Maps an Either to and Either.

staticfoldLeft<L, R, A> (either:Either<L, R>, a:A, f:A ‑> R ‑> A):A

staticfoldMap<L, R, A> (either:Either<L, R>, f:R ‑> A, m:Monoid<A>):A

Fold by mapping the contained value into some monoidal type and reducing with that monoid.

staticisLeft<L, R> (either:Either<L, R>):Bool

Indicates if the either has a Left value

staticisRight<L, R> (either:Either<L, R>):Bool

Indicates if the either has a Right value

staticleftMap<LIn, LOut, R> (either:Either<LIn, R>, f:LIn ‑> LOut):Either<LOut, R>

staticmap<L, RIn, ROut> (either:Either<L, RIn>, f:RIn ‑> ROut):Either<L, ROut>

staticorElse<L, R> (e0:Either<L, R>, e1:Either<L, R>):Either<L, R>

staticorThrow<L, R> (either:Either<L, R>, message:String):R

statictoLeft<L, R> (either:Either<L, R>):Option<L>

Converts the Either to an Option containing the Left value if Left, or None if Right.

statictoLeftUnsafe<L, R> (either:Either<L, R>):Null<L>

Extracts the left value if Left, or null if Right.

statictoRight<L, R> (either:Either<L, R>):Option<R>

Converts the Either to an Option containing the Right value if Right, or None if Left.

statictoRightUnsafe<L, R> (either:Either<L, R>):Null<R>

Extracts the right value if Right, or null if Left.

statictoVNel<E, T> (either:Either<E, T>):VNel<E, T>

statictoValidation<E, T> (either:Either<E, T>):Validation<E, T>