/** * @since 2.0.0 */ import { Alt4 } from './Alt' import { Applicative4 } from './Applicative' import { Apply4 } from './Apply' import { Bifunctor4 } from './Bifunctor' import { Chain4 } from './Chain' import * as E from './Either' import { Endomorphism } from './Endomorphism' import { FromEither4 } from './FromEither' import { FromIO4 } from './FromIO' import { FromReader4 } from './FromReader' import { FromState4 } from './FromState' import { FromTask4 } from './FromTask' import { Lazy } 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 { Pointed4 } from './Pointed' import { Predicate } from './Predicate' import * as R from './Reader' import { ReaderEither } from './ReaderEither' import * as RTE from './ReaderTaskEither' import { ReadonlyNonEmptyArray } from './ReadonlyNonEmptyArray' import { Refinement } from './Refinement' import { State } from './State' import { Task } from './Task' import { TaskEither } from './TaskEither' import ReaderTaskEither = RTE.ReaderTaskEither import Either = E.Either import Reader = R.Reader /** * @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 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 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 conversions * @since 2.0.0 */ export declare const fromEither: (fa: Either) => StateReaderTaskEither /** * @category conversions * @since 2.11.0 */ export declare const fromReader: (fa: Reader) => StateReaderTaskEither /** * @category conversions * @since 2.7.0 */ export declare const fromIO: (fa: IO) => StateReaderTaskEither /** * @category conversions * @since 2.7.0 */ export declare const fromTask: (fa: Task) => StateReaderTaskEither /** * @category conversions * @since 2.10.0 */ export declare const fromState: (fa: State) => StateReaderTaskEither /** * @category conversions * @since 2.0.0 */ export declare const fromTaskEither: (fa: TaskEither) => StateReaderTaskEither /** * @category conversions * @since 2.0.0 */ export declare const fromIOEither: (fa: IOEither) => StateReaderTaskEither /** * @category conversions * @since 2.0.0 */ export declare const fromReaderEither: (fa: ReaderEither) => StateReaderTaskEither /** * @category constructors * @since 2.0.0 */ export declare const fromReaderTaskEither: ( fa: ReaderTaskEither ) => StateReaderTaskEither /** * Changes the value of the local context during the execution of the action `ma` (similar to `Contravariant`'s * `contramap`). * * @since 2.11.0 */ export declare const local: ( f: (r2: R2) => R1 ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`asksStateReaderTaskEither`](#asksstatereadertaskeither). * * @category constructors * @since 2.11.0 */ export declare const asksStateReaderTaskEitherW: ( f: (r1: R1) => StateReaderTaskEither ) => StateReaderTaskEither /** * Effectfully accesses the environment. * * @category constructors * @since 2.11.0 */ export declare const asksStateReaderTaskEither: ( f: (r: R) => StateReaderTaskEither ) => StateReaderTaskEither /** * @category lifting * @since 2.4.0 */ export declare const fromIOEitherK: ( f: (...a: A) => IOEither ) => (...a: A) => StateReaderTaskEither /** * Less strict version of [`chainIOEitherK`](#chainioeitherk). * * @category sequencing * @since 2.6.1 */ export declare const chainIOEitherKW: ( f: (a: A) => IOEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.4.0 */ export declare const chainIOEitherK: ( f: (a: A) => IOEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category lifting * @since 2.4.0 */ export declare const fromTaskEitherK: ( f: (...a: A) => TaskEither ) => (...a: A) => StateReaderTaskEither /** * Less strict version of [`chainTaskEitherK`](#chaintaskeitherk). * * @category sequencing * @since 2.6.1 */ export declare const chainTaskEitherKW: ( f: (a: A) => TaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.4.0 */ export declare const chainTaskEitherK: ( f: (a: A) => TaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category lifting * @since 2.4.0 */ export declare const fromReaderTaskEitherK: ( f: (...a: A) => RTE.ReaderTaskEither ) => (...a: A) => StateReaderTaskEither /** * Less strict version of [`chainReaderTaskEitherK`](#chainreadertaskeitherk). * * @category sequencing * @since 2.6.1 */ export declare const chainReaderTaskEitherKW: ( f: (a: A) => RTE.ReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.4.0 */ export declare const chainReaderTaskEitherK: ( f: (a: A) => ReaderTaskEither ) => (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 mapping * @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 mapping * @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 error handling * @since 2.6.2 */ export declare const mapLeft: ( f: (e: E) => G ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * @since 2.0.0 */ export declare const ap: ( fa: StateReaderTaskEither ) => (fab: StateReaderTaskEither B>) => StateReaderTaskEither /** * Less strict version of [`ap`](#ap). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @since 2.8.0 */ export declare const apW: ( fa: StateReaderTaskEither ) => (fab: StateReaderTaskEither B>) => StateReaderTaskEither /** * @category constructors * @since 2.7.0 */ export declare const of: (a: A) => StateReaderTaskEither /** * Composes computations in sequence, using the return value of one computation to determine the next computation. * * @category sequencing * @since 2.0.0 */ export declare const chain: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`chain`](#chain). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category sequencing * @since 2.6.0 */ export declare const chainW: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`flatten`](#flatten). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category sequencing * @since 2.11.0 */ export declare const flattenW: ( mma: StateReaderTaskEither> ) => StateReaderTaskEither /** * @category sequencing * @since 2.0.0 */ export declare const flatten: ( mma: StateReaderTaskEither> ) => StateReaderTaskEither /** * Less strict version of [`alt`](#alt). * * The `W` suffix (short for **W**idening) means that the environment, the error and the return types will be merged. * * @category error handling * @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 error handling * @since 2.6.2 */ export declare const alt: ( that: Lazy> ) => (fa: StateReaderTaskEither) => StateReaderTaskEither /** * @since 2.7.0 */ export declare const throwError: MonadThrow4['throwError'] /** * @category type lambdas * @since 2.0.0 */ export declare const URI = 'StateReaderTaskEither' /** * @category type lambdas * @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 mapping * @since 2.10.0 */ export declare const flap: ( a: A ) => (fab: StateReaderTaskEither B>) => StateReaderTaskEither /** * @category instances * @since 2.10.0 */ export declare const Pointed: Pointed4 /** * @category instances * @since 2.10.0 */ export declare const Apply: Apply4 /** * Combine two effectful actions, keeping only the result of the first. * * @since 2.0.0 */ export declare const apFirst: ( second: StateReaderTaskEither ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`apFirst`](#apfirst). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @since 2.12.0 */ export declare const apFirstW: ( second: StateReaderTaskEither ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * Combine two effectful actions, keeping only the result of the second. * * @since 2.0.0 */ export declare const apSecond: ( second: StateReaderTaskEither ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`apSecond`](#apsecond). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @since 2.12.0 */ export declare const apSecondW: ( second: StateReaderTaskEither ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * @category instances * @since 2.7.0 */ export declare const Applicative: Applicative4 /** * @category instances * @since 2.10.0 */ export declare const Chain: Chain4 /** * @category instances * @since 2.11.0 */ export declare const FromState: FromState4 /** * 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: Endomorphism) => 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 /** * @category lifting * @since 2.11.0 */ export declare const fromStateK: , S, B>( f: (...a: A) => State ) => (...a: A) => StateReaderTaskEither /** * @category sequencing * @since 2.11.0 */ export declare const chainStateK: ( f: (a: A) => State ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category instances * @since 2.10.0 */ export declare const Monad: Monad4 /** * @category instances * @since 2.10.0 */ export declare const MonadIO: MonadIO4 /** * @category instances * @since 2.10.0 */ export declare const MonadTask: MonadTask4 /** * @category instances * @since 2.10.0 */ export declare const MonadThrow: MonadThrow4 /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. * * @category sequencing * @since 2.0.0 */ export declare const chainFirst: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`chainFirst`](#chainfirst). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category sequencing * @since 2.8.0 */ export declare const chainFirstW: ( f: (a: A) => StateReaderTaskEither ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @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.11.0 */ export declare const FromReader: FromReader4 /** * Reads the current context. * * @category constructors * @since 2.11.0 */ export declare const ask: () => StateReaderTaskEither /** * Projects a value from the global context in a `ReaderEither`. * * @category constructors * @since 2.11.0 */ export declare const asks: (f: (r: R) => A) => StateReaderTaskEither /** * @category lifting * @since 2.11.0 */ export declare const fromReaderK: , R, B>( f: (...a: A) => Reader ) => (...a: A) => StateReaderTaskEither /** * @category sequencing * @since 2.11.0 */ export declare const chainReaderK: ( f: (a: A) => Reader ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`chainReaderK`](#chainReaderK). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category sequencing * @since 2.11.0 */ export declare const chainReaderKW: ( f: (a: A) => Reader ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.11.0 */ export declare const chainFirstReaderK: ( f: (a: A) => Reader ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`chainFirstReaderK`](#chainFirstReaderK). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category sequencing * @since 2.11.0 */ export declare const chainFirstReaderKW: ( f: (a: A) => Reader ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category instances * @since 2.10.0 */ export declare const FromEither: FromEither4 /** * @category conversions * @since 2.0.0 */ export declare const fromOption: ( onNone: Lazy ) => (fa: Option) => StateReaderTaskEither /** * @category lifting * @since 2.10.0 */ export declare const fromOptionK: ( onNone: Lazy ) => , B>( f: (...a: A) => Option ) => (...a: A) => StateReaderTaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainOptionK: ( onNone: Lazy ) => ( f: (a: A) => Option ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.4.0 */ export declare const chainEitherK: ( f: (a: A) => E.Either ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`chainEitherK`](#chaineitherk). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category sequencing * @since 2.6.1 */ export declare const chainEitherKW: ( f: (a: A) => Either ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.12.0 */ export declare const chainFirstEitherK: ( f: (a: A) => E.Either ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * Less strict version of [`chainFirstEitherK`](#chainfirsteitherk). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category sequencing * @since 2.12.0 */ export declare const chainFirstEitherKW: ( f: (a: A) => Either ) => (ma: StateReaderTaskEither) => StateReaderTaskEither /** * @category lifting * @since 2.4.4 */ export declare const fromPredicate: { (refinement: Refinement, onFalse: (a: A) => E): ( a: A ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E): ( b: B ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E): (a: A) => StateReaderTaskEither } /** * @category filtering * @since 2.4.4 */ export declare const filterOrElse: { (refinement: Refinement, onFalse: (a: A) => E): ( ma: StateReaderTaskEither ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E): ( mb: StateReaderTaskEither ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E): ( ma: StateReaderTaskEither ) => StateReaderTaskEither } /** * Less strict version of [`filterOrElse`](#filterorelse). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category filtering * @since 2.9.0 */ export declare const filterOrElseW: { (refinement: Refinement, onFalse: (a: A) => E2): ( ma: StateReaderTaskEither ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E2): ( mb: StateReaderTaskEither ) => StateReaderTaskEither (predicate: Predicate, onFalse: (a: A) => E2): ( ma: StateReaderTaskEither ) => StateReaderTaskEither } /** * @category lifting * @since 2.4.0 */ export declare const fromEitherK: , B>( f: (...a: A) => E.Either ) => (...a: A) => StateReaderTaskEither /** * @category instances * @since 2.10.0 */ export declare const FromIO: FromIO4 /** * @category lifting * @since 2.10.0 */ export declare const fromIOK: , B>( f: (...a: A) => IO ) => (...a: A) => StateReaderTaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainIOK: ( f: (a: A) => IO ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainFirstIOK: ( f: (a: A) => IO ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * @category instances * @since 2.10.0 */ export declare const FromTask: FromTask4 /** * @category lifting * @since 2.10.0 */ export declare const fromTaskK: , B>( f: (...a: A) => Task ) => (...a: A) => StateReaderTaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainTaskK: ( f: (a: A) => Task ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainFirstTaskK: ( f: (a: A) => Task ) => (first: StateReaderTaskEither) => StateReaderTaskEither /** * Run a computation in the `StateReaderTaskEither` monad, discarding the final state * * @since 2.8.0 */ export declare const evaluate: ( s: S ) => (ma: StateReaderTaskEither) => ReaderTaskEither /** * Run a computation in the `StateReaderTaskEither` monad discarding the result * * @since 2.8.0 */ export declare const execute: (s: S) => (ma: StateReaderTaskEither) => ReaderTaskEither /** * @since 2.8.0 */ export declare const bindTo: ( name: N ) => (fa: StateReaderTaskEither) => StateReaderTaskEither declare const let_: ( name: Exclude, f: (a: A) => B ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither export { /** * @since 2.13.0 */ let_ as let } /** * @since 2.8.0 */ export declare const bind: ( name: Exclude, f: (a: A) => StateReaderTaskEither ) => ( ma: StateReaderTaskEither ) => StateReaderTaskEither /** * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @since 2.8.0 */ export declare const bindW: ( name: Exclude, f: (a: A) => StateReaderTaskEither ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither< S, R1 & R2, E1 | E2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * @since 2.8.0 */ export declare const apS: ( name: Exclude, fb: StateReaderTaskEither ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither /** * Less strict version of [`apS`](#aps). * * The `W` suffix (short for **W**idening) means that the environment types and the error types will be merged. * * @category do notation * @since 2.8.0 */ export declare const apSW: ( name: Exclude, fb: StateReaderTaskEither ) => ( fa: StateReaderTaskEither ) => StateReaderTaskEither< S, R1 & R2, E1 | E2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(Applicative)`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyNonEmptyArrayWithIndex: ( f: (index: number, a: A) => StateReaderTaskEither ) => (as: ReadonlyNonEmptyArray) => StateReaderTaskEither> /** * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyArrayWithIndex: ( f: (index: number, a: A) => StateReaderTaskEither ) => (as: readonly A[]) => StateReaderTaskEither /** * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`. * * @category traversing * @since 2.9.0 */ export declare const traverseArrayWithIndex: ( f: (index: number, a: A) => StateReaderTaskEither ) => (as: ReadonlyArray) => StateReaderTaskEither> /** * Equivalent to `ReadonlyArray#traverse(Applicative)`. * * @category traversing * @since 2.9.0 */ export declare const traverseArray: ( f: (a: A) => StateReaderTaskEither ) => (as: readonly A[]) => StateReaderTaskEither /** * Equivalent to `ReadonlyArray#sequence(Applicative)`. * * @category traversing * @since 2.9.0 */ export declare const sequenceArray: ( arr: ReadonlyArray> ) => StateReaderTaskEither> /** * This instance is deprecated, use small, specific instances instead. * For example if a function needs a `Functor` instance, pass `SRTE.Functor` instead of `SRTE.stateReaderTaskEither` * (where `SRTE` is from `import SRTE from 'fp-ts/StateReaderTaskEither'`) * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const stateReaderTaskEither: Monad4 & Bifunctor4 & Alt4 & MonadTask4 & MonadThrow4 /** * This instance is deprecated, use small, specific instances instead. * For example if a function needs a `Functor` instance, pass `SRTE.Functor` instead of `SRTE.stateReaderTaskEitherSeq` * (where `SRTE` is from `import SRTE from 'fp-ts/StateReaderTaskEither'`) * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const stateReaderTaskEitherSeq: typeof stateReaderTaskEither /** * Use [`evaluate`](#evaluate) instead * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const evalState: (ma: StateReaderTaskEither, s: S) => ReaderTaskEither /** * Use [`execute`](#execute) instead * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const execState: (ma: StateReaderTaskEither, s: S) => ReaderTaskEither /** * @category zone of death * @since 2.0.0 * @deprecated */ export declare function run(ma: StateReaderTaskEither, s: S, r: R): Promise>