import { Applicative } from "./applicative";
export declare enum EitherTag {
Left = 0,
Right = 1,
}
export declare type EitherMatch = {
left: (a: A) => K;
right: (b: B) => K;
};
export declare abstract class Either implements Applicative {
tag: EitherTag;
val: A | B;
abstract match(m: EitherMatch): K;
abstract map(f: (b: B) => C): Either;
abstract mapTo(c: C): Either;
static of(b: B): Either;
of(b: B): Either;
ap(a: Either C>): Either;
lift(f: (t: T1) => R, m: Either): Either;
lift(f: (t: T1, u: T2) => R, m1: Either, m2: Either): Either;
lift(f: (t1: T1, t2: T2, t3: T3) => R, m1: Either, m2: Either, m3: Either): Either;
}
export declare class Left extends Either {
val: A;
tag: EitherTag;
constructor(a: A);
match(m: EitherMatch): K;
map(f: (b: B) => C): Either;
mapTo(c: C): Either;
}
export declare class Right extends Either {
val: B;
tag: EitherTag;
constructor(b: B);
match(m: EitherMatch): K;
map(f: (b: B) => C): Either;
mapTo(c: C): Either;
}
export declare function left(a: A): Either;
export declare function right(b: B): Either;
export declare function isLeft(a: Either): boolean;
export declare function isRight(a: Either): boolean;
export declare function fromEither(e: Either): A | B;