/** * @since 2.0.0 */ import { Alt4 } from './Alt' import { Applicative4 } from './Applicative' import { Bifunctor4 } from './Bifunctor' import * as E from './Either' import { Lazy, Predicate, Refinement } from './function' import { Functor4 } from './Functor' import { IO } from './IO' import { IOEither } from './IOEither' import { Monad4 } from './Monad' import { MonadIO4 } from './MonadIO' import { MonadTask4 } from './MonadTask' import { MonadThrow4 } from './MonadThrow' import { Option } from './Option' import { Reader } from './Reader' import { ReaderEither } from './ReaderEither' import * as RTE from './ReaderTaskEither' import { State } from './State' import { Task } from './Task' import { TaskEither } from './TaskEither' import ReaderTaskEither = RTE.ReaderTaskEither import Either = E.Either /** * @category model * @since 2.0.0 */ export interface StateReaderTaskEither { (s: S): ReaderTaskEither } /** * @category constructors * @since 2.0.0 */ export declare const left: (e: E) => StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare const right: (a: A) => StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function rightTask(ma: Task): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function leftTask(me: Task): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function fromTaskEither(ma: TaskEither): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function rightReader(ma: Reader): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function leftReader(me: Reader): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function fromIOEither(ma: IOEither): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function fromReaderEither(ma: ReaderEither): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function rightIO(ma: IO): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare function leftIO(me: IO): StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare const rightState: (ma: State) => StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare const leftState: (me: State) => StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare const fromReaderTaskEither: ( ma: ReaderTaskEither ) => StateReaderTaskEither /** * Get the current state * * @category constructors * @since 2.0.0 */ export declare const get: () => StateReaderTaskEither /** * Set the state * * @category constructors * @since 2.0.0 */ export declare const put: (s: S) => StateReaderTaskEither /** * Modify the state by applying a function to the current state * * @category constructors * @since 2.0.0 */ export declare const modify: (f: (s: S) => S) => StateReaderTaskEither /** * Get a value which depends on the current state * * @category constructors * @since 2.0.0 */ export declare const gets: (f: (s: S) => A) => StateReaderTaskEither /** * Derivable from `MonadThrow`. * * @category constructors * @since 2.0.0 */ export declare const fromEither: (ma: Either) => StateReaderTaskEither /** * Derivable from `MonadThrow`. * * @category constructors * @since 2.0.0 */ export declare const fromOption: (onNone: Lazy) => (ma: Option) => StateReaderTaskEither /** * Derivable from `MonadThrow`. * * @category constructors * @since 2.4.4 */ export declare const fromPredicate: { (refinement: Refinement, onFalse: (a: A) => E): ( a: A ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E): (a: A) => StateReaderTaskEither } /** * @category combinators * @since 2.4.0 */ export declare function fromEitherK, B>( f: (...a: A) => Either ): (...a: A) => StateReaderTaskEither /** * Less strict version of [`chainEitherK`](#chainEitherK). * * @category combinators * @since 2.6.1 */ export declare const chainEitherKW: ( f: (a: A) => E.Either ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category combinators * @since 2.4.0 */ export declare const chainEitherK: ( f: (a: A) => Either ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category combinators * @since 2.4.0 */ export declare function fromIOEitherK, B>( f: (...a: A) => IOEither ): (...a: A) => StateReaderTaskEither /** * Less strict version of [`chainIOEitherK`](#chainIOEitherK). * * @category combinators * @since 2.6.1 */ export declare const chainIOEitherKW: ( f: (a: A) => IOEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category combinators * @since 2.4.0 */ export declare const chainIOEitherK: ( f: (a: A) => IOEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category combinators * @since 2.4.0 */ export declare function fromTaskEitherK, B>( f: (...a: A) => TaskEither ): (...a: A) => StateReaderTaskEither /** * Less strict version of [`chainTaskEitherK`](#chainTaskEitherK). * * @category combinators * @since 2.6.1 */ export declare const chainTaskEitherKW: ( f: (a: A) => TaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category combinators * @since 2.4.0 */ export declare const chainTaskEitherK: ( f: (a: A) => TaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category combinators * @since 2.4.0 */ export declare function fromReaderTaskEitherK, B>( f: (...a: A) => ReaderTaskEither ): (...a: A) => StateReaderTaskEither /** * Less strict version of [`chainReaderTaskEitherK`](#chainReaderTaskEitherK). * * @category combinators * @since 2.6.1 */ export declare const chainReaderTaskEitherKW: ( f: (a: A) => RTE.ReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category combinators * @since 2.4.0 */ export declare const chainReaderTaskEitherK: ( f: (a: A) => ReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`filterOrElse`](#filterOrElse). * * @since 2.9.0 */ export declare const filterOrElseW: { (refinement: Refinement, onFalse: (a: A) => E2): ( ma: StateReaderTaskEither ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E2): ( ma: StateReaderTaskEither ) => StateReaderTaskEither } /** * Derivable from `MonadThrow`. * * @category combinators * @since 2.4.4 */ export declare const filterOrElse: { (refinement: Refinement, onFalse: (a: A) => E): ( ma: StateReaderTaskEither ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E): ( ma: StateReaderTaskEither ) => StateReaderTaskEither } /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. * * @category Functor * @since 2.0.0 */ export declare const map: ( f: (a: A) => B ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * Map a pair of functions over the two last type arguments of the bifunctor. * * @category Bifunctor * @since 2.6.2 */ export declare const bimap: ( f: (e: E) => G, g: (a: A) => B ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * Map a function over the third type argument of a bifunctor. * * @category Bifunctor * @since 2.6.2 */ export declare const mapLeft: ( f: (e: E) => G ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`ap`](#ap). * * @category Apply * @since 2.8.0 */ export declare const apW: ( fa: StateReaderTaskEither ) => (fab: StateReaderTaskEither B>) => StateReaderTaskEither /** * Apply a function to an argument under a type constructor. * * @category Apply * @since 2.0.0 */ export declare const ap: ( fa: StateReaderTaskEither ) => (fab: StateReaderTaskEither B>) => StateReaderTaskEither /** * Combine two effectful actions, keeping only the result of the first. * * Derivable from `Apply`. * * @category combinators * @since 2.0.0 */ export declare const apFirst: ( fb: StateReaderTaskEither ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * Combine two effectful actions, keeping only the result of the second. * * Derivable from `Apply`. * * @category combinators * @since 2.0.0 */ export declare const apSecond: ( fb: StateReaderTaskEither ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * Wrap a value into the type constructor. * * @category Applicative * @since 2.7.0 */ export declare const of: Applicative4['of'] /** * Less strict version of [`chain`](#chain). * * @category Monad * @since 2.6.0 */ export declare const chainW: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Composes computations in sequence, using the return value of one computation to determine the next computation. * * @category Monad * @since 2.0.0 */ export declare const chain: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`chainFirst`](#chainFirst). * * Derivable from `Monad`. * * @category combinators * @since 2.8.0 */ export declare const chainFirstW: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. * * Derivable from `Monad`. * * @category combinators * @since 2.0.0 */ export declare const chainFirst: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Derivable from `Monad`. * * @category combinators * @since 2.0.0 */ export declare const flatten: ( mma: StateReaderTaskEither> ) => StateReaderTaskEither /** * Less strict version of [`alt`](#alt). * * @category Alt * @since 2.9.0 */ export declare const altW: ( that: () => StateReaderTaskEither ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to * types of kind `* -> *`. * * @category Alt * @since 2.6.2 */ export declare const alt: ( that: Lazy> ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * @category MonadIO * @since 2.7.0 */ export declare const fromIO: MonadIO4['fromIO'] /** * @category MonadTask * @since 2.7.0 */ export declare const fromTask: MonadTask4['fromTask'] /** * @category MonadThrow * @since 2.7.0 */ export declare const throwError: MonadThrow4['throwError'] /** * @category instances * @since 2.0.0 */ export declare const URI = 'StateReaderTaskEither' /** * @category instances * @since 2.0.0 */ export declare type URI = typeof URI declare module './HKT' { interface URItoKind4 { readonly [URI]: StateReaderTaskEither } } /** * @category instances * @since 2.7.0 */ export declare const Functor: Functor4 /** * @category instances * @since 2.7.0 */ export declare const Applicative: Applicative4 /** * @category instances * @since 2.7.0 */ export declare const Bifunctor: Bifunctor4 /** * @category instances * @since 2.7.0 */ export declare const Alt: Alt4 /** * @category instances * @since 2.0.0 */ export declare const stateReaderTaskEither: Monad4 & Bifunctor4 & Alt4 & MonadTask4 & MonadThrow4 /** * @category instances * @since 2.0.0 * @deprecated */ export declare const stateReaderTaskEitherSeq: typeof stateReaderTaskEither /** * @since 2.0.0 */ export declare function run(ma: StateReaderTaskEither, s: S, r: R): Promise> /** * Use `evaluate` instead * * @since 2.0.0 * @deprecated */ export declare const evalState: (ma: StateReaderTaskEither, s: S) => ReaderTaskEither /** * Use `execute` instead * * @since 2.0.0 * @deprecated */ export declare const execState: (ma: StateReaderTaskEither, s: S) => ReaderTaskEither /** * Run a computation in the `StateReaderTaskEither` monad, discarding the final state * * @since 2.8.0 */ export declare const evaluate: ( s: S ) => (ma: StateReaderTaskEither) => RTE.ReaderTaskEither /** * Run a computation in the `StateReaderTaskEither` monad discarding the result * * @since 2.8.0 */ export declare const execute: ( s: S ) => (ma: StateReaderTaskEither) => RTE.ReaderTaskEither /** * @since 2.8.0 */ export declare const bindTo: ( name: N ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * @since 2.8.0 */ export declare const bindW: ( name: Exclude, f: (a: A) => StateReaderTaskEither ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither /** * @since 2.8.0 */ export declare const bind: ( name: Exclude, f: (a: A) => StateReaderTaskEither ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither< S, R, E, { [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * @since 2.8.0 */ export declare const apSW: ( name: Exclude, fb: StateReaderTaskEither ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither /** * @since 2.8.0 */ export declare const apS: ( name: Exclude, fb: StateReaderTaskEither ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither< S, R, E, { [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * @since 2.9.0 */ export declare const traverseArrayWithIndex: ( f: (index: number, a: A) => StateReaderTaskEither ) => (arr: ReadonlyArray) => StateReaderTaskEither> /** * @since 2.9.0 */ export declare const traverseArray: ( f: (a: A) => StateReaderTaskEither ) => (arr: ReadonlyArray) => StateReaderTaskEither> /** * @since 2.9.0 */ export declare const sequenceArray: ( arr: ReadonlyArray> ) => StateReaderTaskEither>