import Traversable from "../../specifications/Traversable"; import Bifunctor from "../../specifications/Bifunctor"; import Monad from "../../specifications/Monad"; import { Applicative, ApplicativeTypeRep } from "../../specifications/Applicative"; import { FNA1 } from "../../specifications/Function"; export default abstract class Either implements Monad, Bifunctor, Traversable { protected constructor(); abstract map(fn: (a: R) => R2): Either; abstract ap(other: Either): R extends FNA1 ? Either : Either; abstract chain(fn: (right: R) => Either): Either; static of(right: R): Either; abstract bimap(fnLeft: (left: L) => L2, fnRight: (right: R) => R2): Either; abstract mapLeft(fn: (left: L) => L2): Either; abstract reduce(reducer: (accumulator: R2, value: R) => R2, initial: R2): R2; abstract traverse(TypeRep: ApplicativeTypeRep>, fn: (a: R) => Applicative): Applicative>; abstract get(): L | R; abstract getOrElse(other: R): R; static right(right: R): Right; static left(left: L): Left; abstract swap(): Either; get isRight(): Boolean; get isLeft(): Boolean; abstract inspect(): string; } declare class Left extends Either { private readonly value; constructor(value: L); map(fn: (a: R) => R2): Left; ap(other: Either): R extends FNA1 ? Either : Either; chain(fn: (right: R) => Either): Either; bimap(fnLeft: (left: L) => L2, fnRight: (right: R) => R2): Left; reduce(reducer: (accumulator: R2, value: R) => R2, initial: R2): R2; traverse(TypeRep: ApplicativeTypeRep>, fn: (a: R) => Applicative): Applicative>; mapLeft(fn: (left: L) => L2): Left; join(): Either; get(): L; getOrElse(other: R): R; swap(): Either; get isLeft(): Boolean; inspect(): string; } declare class Right extends Either { private readonly value; constructor(value: R); map(fn: (a: R) => R2): Either; ap(other: Either): R extends FNA1 ? Either : Either; chain(fn: (right: R) => Either): Either; bimap(fnLeft: (left: L) => L2, fnRight: (right: R) => R2): Right; mapLeft(fn: (left: L) => L2): Either; reduce(reducer: (accumulator: R2, value: R) => R2, initial: R2): R2; traverse(TypeRep: ApplicativeTypeRep>, fn: (a: R) => Applicative): Applicative>; join(): Either; get(): R; getOrElse(other: R): R; swap(): Either; get isRight(): Boolean; inspect(): string; } export {};