import { Show } from '../typeclasses/Show'; import { Setoid } from '../typeclasses/Setoid'; import { Ord } from '../typeclasses/Ord'; import { Semigroup } from '../typeclasses/Semigroup'; import { Functor } from '../typeclasses/Functor'; import { Apply } from '../typeclasses/Apply'; import { Applicative } from '../typeclasses/Applicative'; import { Alt } from '../typeclasses/Alt'; import { Chain } from '../typeclasses/Chain'; import { Monad } from '../typeclasses/Monad'; import { Foldable } from '../typeclasses/Foldable'; import { Extend } from '../typeclasses/Extend'; import { Bifunctor } from '../typeclasses/Bifunctor'; import { Unsafe } from '../typeclasses/Unsafe'; import { Maybe } from './Maybe'; export declare type Left = Either; export declare type Right = Either; export declare type EitherPatterns = { Left: (l: L) => T; Right: (r: R) => T; }; export declare class Either implements Show, Setoid>, Ord>, Semigroup>, Functor, Apply, Applicative, Alt, Chain, Monad, Foldable, Extend, Bifunctor, Unsafe { private readonly value; private readonly tag; constructor(value: L | R, tag: string); readonly of: typeof Either.of; readonly 'fantasy-land/alt': (other: Either) => Either; readonly 'fantasy-land/of': typeof Either.of; readonly 'fantasy-land/ap': (other: Either R2>) => Either; readonly 'fantasy-land/chain': (f: (value: R) => Either) => Either; readonly 'fantasy-land/reduce': (reducer: (accumulator: T, value: R) => T, initialValue: T) => T; readonly 'fantasy-land/map': (f: (value: R) => R2) => Either; readonly 'fantasy-land/lte': (other: Either) => boolean; readonly 'fantasy-land/extend': (f: (value: Either) => R2) => Either; readonly 'fantasy-land/concat': (other: Either) => Either; readonly 'fantasy-land/equals': (other: Either) => boolean; readonly 'fantasy-land/bimap': (f: (value: L) => L2, g: (value: R) => R2) => Either; private asLeft(); private asRight(); static of(value: R): Right; static lefts(list: Either[]): L[]; static rights(list: Either[]): R[]; static encase(throwsF: () => R): Either; isLeft(): boolean; isRight(): boolean; toJSON(): L | R; inspect(): string; toString(): string; bimap(f: (value: L) => L2, g: (value: R) => R2): Either; map(f: (value: R) => R2): Either; mapLeft(f: (value: L) => L2): Either; ap(other: Either R2>): Either; equals(other: Either): boolean; lte(other: Either): boolean; concat(other: Either): Either; chain(f: (value: R) => Either): Either; alt(other: Either): Either; reduce(reducer: (accumulator: T, value: R) => T, initialValue: T): T; extend(f: (value: Either) => R2): Either; unsafeCoerce(): R; caseOf(patterns: EitherPatterns): T; leftOrDefault(defaultValue: L): L; orDefault(defaultValue: R): R; ifLeft(effect: (value: L) => any): this; ifRight(effect: (value: R) => any): this; toMaybe(): Maybe; leftToMaybe(): Maybe; either(ifLeft: (value: L) => T, ifRight: (value: R) => T): T; extract(): L | R; } export declare const Left: (value: L) => Either; export declare const Right: (value: R) => Either;