import { Either } from './Either'; import { Show } from '../typeclasses/Show'; import { Setoid } from '../typeclasses/Setoid'; import { Ord } from '../typeclasses/Ord'; import { Semigroup } from '../typeclasses/Semigroup'; import { Monoid } from '../typeclasses/Monoid'; import { Functor } from '../typeclasses/Functor'; import { Apply } from '../typeclasses/Apply'; import { Applicative } from '../typeclasses/Applicative'; import { Plus } from '../typeclasses/Plus'; import { Alt } from '../typeclasses/Alt'; import { Alternative } from '../typeclasses/Alternative'; import { Chain } from '../typeclasses/Chain'; import { Monad } from '../typeclasses/Monad'; import { Foldable } from '../typeclasses/Foldable'; import { Extend } from '../typeclasses/Extend'; import { Unsafe } from '../typeclasses/Unsafe'; export declare type MaybePatterns = { Just: (value: T) => U; Nothing: () => U; }; export declare class Maybe implements Show, Setoid>, Ord>, Semigroup>, Monoid>, Functor, Apply, Applicative, Alt, Plus, Alternative, Chain, Monad, Foldable, Extend, Unsafe { readonly value: T; constructor(value: T); readonly of: typeof Maybe.of; readonly zero: typeof Maybe.zero; readonly empty: typeof Maybe.empty; readonly 'fantasy-land/alt': (other: Maybe) => Maybe; readonly 'fantasy-land/of': typeof Maybe.of; readonly 'fantasy-land/ap': (maybeF: Maybe<(value: T) => U>) => Maybe; readonly 'fantasy-land/chain': (f: (value: T) => Maybe) => Maybe; readonly 'fantasy-land/reduce': (reducer: (accumulator: U, value: T) => U, initialValue: U) => U; readonly 'fantasy-land/map': (f: (value: T) => U) => Maybe; readonly 'fantasy-land/lte': (other: Maybe) => boolean; readonly 'fantasy-land/zero': typeof Maybe.zero; readonly 'fantasy-land/extend': (f: (value: Maybe) => U) => Maybe; readonly 'fantasy-land/concat': (other: Maybe) => Maybe; readonly 'fantasy-land/empty': typeof Maybe.empty; readonly 'fantasy-land/equals': (other: Maybe) => boolean; static of(value: T): Maybe; static fromNullable(value: T | undefined | null | void): Maybe; static fromFalsy(value: T | undefined | null | void): Maybe; static empty(): typeof Nothing; static zero(): typeof Nothing; static catMaybes(list: Maybe[]): T[]; static mapMaybe(f: (value: T) => Maybe): (list: T[]) => U[]; static mapMaybe(f: (value: T) => Maybe, list: T[]): U[]; static encase(throwsF: () => T): Maybe; isJust(): boolean; isNothing(): this is typeof Nothing; inspect(): string; toString(): string; toJSON(): T; equals(other: Maybe): boolean; lte(other: Maybe): boolean; concat(other: Maybe): Maybe; map(f: (value: T) => U): Maybe; ap(maybeF: Maybe<(value: T) => U>): Maybe; alt(other: Maybe): Maybe; chain(f: (value: T) => Maybe): Maybe; reduce(reducer: (accumulator: U, value: T) => U, initialValue: U): U; extend(f: (value: Maybe) => U): Maybe; unsafeCoerce(): T; caseOf(patterns: MaybePatterns): U; orDefault(defaultValue: T): T; toList(): T[]; mapOrDefault(f: (value: T) => U, defaultValue: U): U; extract(): T | null; toEither(left: L): Either; ifJust(effect: (value: T) => any): this; ifNothing(effect: () => any): this; filter(pred: (value: T) => boolean): Maybe; } export declare const Just: (value: T) => Maybe; export declare const Nothing: Maybe;