UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

199 lines 6.94 kB
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 S from './Stream'; /** * @since 0.9.2 * @category Model */ export interface StreamEither<E, A> extends S.Stream<E.Either<E, A>> { } /** * @since 0.9.2 * @category Combinator */ export declare const alt: <E, A>(second: import("fp-ts/function").Lazy<import("@most/types").Stream<E.Either<E, A>>>) => (first: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E.Either<E, A>>; /** * @since 0.9.2 * @category Typecalss Constructor */ export declare const altValidation: <A>(semigroup: Semigroup<A>) => <A_1>(second: import("fp-ts/function").Lazy<import("@most/types").Stream<E.Either<A, A_1>>>) => (first: import("@most/types").Stream<E.Either<A, A_1>>) => import("@most/types").Stream<E.Either<A, A_1>>; /** * @since 0.9.2 * @category Combinator */ export declare const ap: <E, A>(fa: import("@most/types").Stream<E.Either<E, A>>) => <B>(fab: import("@most/types").Stream<E.Either<E, (a: A) => B>>) => import("@most/types").Stream<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: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E.Either<G, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const bracket: <E, A, B>(acquire: import("@most/types").Stream<E.Either<E, A>>, use: (a: A) => import("@most/types").Stream<E.Either<E, B>>, release: (a: A, e: E.Either<E, B>) => import("@most/types").Stream<E.Either<E, void>>) => import("@most/types").Stream<E.Either<E, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const chain: <A, E, B>(f: (a: A) => import("@most/types").Stream<E.Either<E, B>>) => (ma: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E.Either<E, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const getOrElse: <E, A>(onLeft: (e: E) => A) => (ma: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<A>; /** * @since 0.9.2 * @category Combinator */ export declare const getOrElseE: <E, A>(onLeft: (e: E) => import("@most/types").Stream<A>) => (ma: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<A>; /** * @since 0.9.2 * @category Constructor */ export declare const left: <E, A = never>(e: E) => import("@most/types").Stream<E.Either<E, A>>; /** * @since 0.9.2 * @category Constructor */ export declare const fromStreamL: <E, A = never>(fe: import("@most/types").Stream<E>) => import("@most/types").Stream<E.Either<E, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const map: <A, B>(f: (a: A) => B) => <E>(fa: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E.Either<E, B>>; /** * @since 0.9.2 * @category Combinator */ export declare const mapLeft: <E, G>(f: (e: E) => G) => <A>(fea: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E.Either<G, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const match: <E, B, A>(onLeft: (e: E) => B, onRight: (a: A) => B) => (ma: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<B>; /** * @since 0.9.2 * @category Combinator */ export declare const matchE: <E, B, A>(onLeft: (e: E) => import("@most/types").Stream<B>, onRight: (a: A) => import("@most/types").Stream<B>) => (ma: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<B>; /** * @since 0.9.2 * @category Combinator */ export declare const orElse: <E1, E2, A>(onLeft: (e: E1) => import("@most/types").Stream<E.Either<E2, A>>) => (ma: import("@most/types").Stream<E.Either<E1, A>>) => import("@most/types").Stream<E.Either<E2, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const orElseFirst: <E, B>(onLeft: (e: E) => import("@most/types").Stream<E.Either<E, B>>) => <A>(ma: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E.Either<E, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const orLeft: <E1, E2>(onLeft: (e: E1) => import("@most/types").Stream<E2>) => <A>(fa: import("@most/types").Stream<E.Either<E1, A>>) => import("@most/types").Stream<E.Either<E2, A>>; /** * @since 0.9.2 * @category Constructor */ export declare const right: <A, E = never>(a: A) => import("@most/types").Stream<E.Either<E, A>>; /** * @since 0.9.2 * @category Constructor */ export declare const fromStream: <A, E = never>(fa: import("@most/types").Stream<A>) => import("@most/types").Stream<E.Either<E, A>>; /** * @since 0.9.2 * @category Combinator */ export declare const swap: <E, A>(ma: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E.Either<A, E>>; /** * @since 0.9.2 * @category Combinator */ export declare const toUnion: <E, A>(fa: import("@most/types").Stream<E.Either<E, A>>) => import("@most/types").Stream<E | A>; /** * @since 0.9.2 * @category URI */ export declare const URI = "@typed/fp/StreamEither"; /** * @since 0.9.2 * @category URI */ export declare type URI = typeof URI; declare module 'fp-ts/HKT' { interface URItoKind2<E, A> { [URI]: StreamEither<E, A>; } } declare module './HKT' { interface URItoVariance { [URI]: V<E, Covariant>; } } /** * @since 0.9.2 * @category Constructor */ export declare const of: <A, E = never>(a: A) => import("@most/types").Stream<E.Either<E, A>>; /** * @since 0.9.2 * @category Instance */ export declare const Pointed: Pointed2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Functor: Functor2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Bifunctor: Bifunctor2<URI>; /** * @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 Chain: Chain2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const Monad: Monad2<URI>; /** * @since 0.9.2 * @category Combinator */ export declare const chainRec: <A, E, B>(f: (value: A) => StreamEither<E, E.Either<A, B>>) => (a: A) => StreamEither<E, B>; /** * @since 0.9.2 * @category Instance */ export declare const ChainRec: ChainRec2<URI>; /** * @since 0.9.2 * @category Instance */ export declare const MonadRec: MonadRec2<URI>; //# sourceMappingURL=StreamEither.d.ts.map