UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

208 lines 6.06 kB
/** * ResumeEither is an Either of [Resume](./Resume.ts.md) * @since 0.9.2 */ import { Alt2 } from 'fp-ts/Alt'; import { Applicative2 } from 'fp-ts/Applicative'; import { Apply2 } from 'fp-ts/Apply'; import { Bifunctor2 } from 'fp-ts/Bifunctor'; import { Chain2 } from 'fp-ts/Chain'; import { ChainRec2 } from 'fp-ts/ChainRec'; import * as E from 'fp-ts/Either'; import { Functor2 } from 'fp-ts/Functor'; import { Monad2 } from 'fp-ts/Monad'; import { Pointed2 } from 'fp-ts/Pointed'; import { Semigroup } from 'fp-ts/Semigroup'; import { MonadRec2 } from './MonadRec'; import * as R from './Resume'; /** * @since 0.9.2 * @category Model */ export declare type ResumeEither<E, A> = R.Resume<E.Either<E, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const alt: <E, A>(second: import("fp-ts/function").Lazy<R.Resume<E.Either<E, A>>>) => (first: R.Resume<E.Either<E, A>>) => R.Resume<E.Either<E, A>>; /** * @since 0.9.2 * @category Typeclass Constructor */ export declare const altValidation: <A>(semigroup: Semigroup<A>) => <A_1>(second: import("fp-ts/function").Lazy<R.Resume<E.Either<A, A_1>>>) => (first: R.Resume<E.Either<A, A_1>>) => R.Resume<E.Either<A, A_1>>; /** * @since 0.9.2 * @category Combinator */ export declare const ap: <E, A>(fa: R.Resume<E.Either<E, A>>) => <B>(fab: R.Resume<E.Either<E, (a: A) => B>>) => R.Resume<E.Either<E, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const bimap: <E, G, A, B>(f: (e: E) => G, g: (a: A) => B) => (fea: R.Resume<E.Either<E, A>>) => R.Resume<E.Either<G, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const bracket: <E, A, B>(acquire: R.Resume<E.Either<E, A>>, use: (a: A) => R.Resume<E.Either<E, B>>, release: (a: A, e: E.Either<E, B>) => R.Resume<E.Either<E, void>>) => R.Resume<E.Either<E, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const chain: <A, E, B>(f: (a: A) => R.Resume<E.Either<E, B>>) => (ma: R.Resume<E.Either<E, A>>) => R.Resume<E.Either<E, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const getOrElse: <E, A>(onLeft: (e: E) => A) => (ma: R.Resume<E.Either<E, A>>) => R.Resume<A>; /** * @since 0.9.2 * @category Combinator */ export declare const getOrElseE: <E, A>(onLeft: (e: E) => R.Resume<A>) => (ma: R.Resume<E.Either<E, A>>) => R.Resume<A>; /** * @since 0.9.2 * @category Constructor */ export declare const left: <E, A = never>(e: E) => R.Resume<E.Either<E, A>>; /** * @since 0.9.2 * @category Constructor */ export declare const fromResumeL: <E, A = never>(fe: R.Resume<E>) => R.Resume<E.Either<E, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const map: <A, B>(f: (a: A) => B) => <E>(fa: R.Resume<E.Either<E, A>>) => R.Resume<E.Either<E, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const mapLeft: <E, G>(f: (e: E) => G) => <A>(fea: R.Resume<E.Either<E, A>>) => R.Resume<E.Either<G, A>>; /** * @since 0.9.2 * @category Deconstructor */ export declare const match: <E, B, A>(onLeft: (e: E) => B, onRight: (a: A) => B) => (ma: R.Resume<E.Either<E, A>>) => R.Resume<B>; /** * @since 0.9.2 * @category Deconstructor */ export declare const matchE: <E, B, A>(onLeft: (e: E) => R.Resume<B>, onRight: (a: A) => R.Resume<B>) => (ma: R.Resume<E.Either<E, A>>) => R.Resume<B>; /** * @since 0.9.2 * @category Combinator */ export declare const orElse: <E1, E2, A>(onLeft: (e: E1) => R.Resume<E.Either<E2, A>>) => (ma: R.Resume<E.Either<E1, A>>) => R.Resume<E.Either<E2, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const orElseFirst: <E, B>(onLeft: (e: E) => R.Resume<E.Either<E, B>>) => <A>(ma: R.Resume<E.Either<E, A>>) => R.Resume<E.Either<E, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const orLeft: <E1, E2>(onLeft: (e: E1) => R.Resume<E2>) => <A>(fa: R.Resume<E.Either<E1, A>>) => R.Resume<E.Either<E2, A>>; /** * @since 0.9.2 * @category Constructor */ export declare const right: <A, E = never>(a: A) => R.Resume<E.Either<E, A>>; /** * @since 0.9.2 * @category Constructor */ export declare const fromResumeR: <A, E = never>(fa: R.Resume<A>) => R.Resume<E.Either<E, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const swap: <E, A>(ma: R.Resume<E.Either<E, A>>) => R.Resume<E.Either<A, E>>; /** * @since 0.9.2 * @category Combinator */ export declare const toUnion: <E, A>(fa: R.Resume<E.Either<E, A>>) => R.Resume<E | A>; /** * @since 0.9.2 * @category URI */ export declare const URI = "@typed/fp/ResumeEither"; /** * @since 0.9.2 * @category URI */ export declare type URI = typeof URI; declare module 'fp-ts/HKT' { interface URItoKind2<E, A> { [URI]: ResumeEither<E, A>; } } declare module './HKT' { interface URItoVariance { [URI]: V<E, Covariant>; } } /** * @since 0.9.2 * @category Instance */ export declare const Pointed: Pointed2<URI>; /** * @since 0.9.2 * @category Combinator */ export declare const of: <A, E>(a: A) => ResumeEither<E, A>; /** * @since 0.9.2 * @category Instance */ export declare const Functor: Functor2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Chain: Chain2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const ChainRec: ChainRec2<URI>; /** * @since 0.9.2 * @category Combinator */ export declare const chainRec: <A, E, B>(f: (a: A) => ResumeEither<E, E.Either<A, B>>) => (a: A) => ResumeEither<E, B>; /** * @since 0.9.2 * @category Instance */ export declare const Apply: Apply2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Applicative: Applicative2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Monad: Monad2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const MonadRec: MonadRec2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Alt: Alt2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Bifunctor: Bifunctor2<URI>; //# sourceMappingURL=ResumeEither.d.ts.map