Link Search Menu Expand Document

StateReaderTaskEither overview

Added in v2.0.0


Table of contents


Alt

alt

Identifies an associative operation on a type constructor. It is similar to Semigroup, except that it applies to types of kind * -> *.

Signature

export declare const alt: <S, R, E, A>(
  that: Lazy<StateReaderTaskEither<S, R, E, A>>
) => (fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.6.2

altW

Less strict version of alt.

Signature

export declare const altW: <S, R2, E2, B>(
  that: () => StateReaderTaskEither<S, R2, E2, B>
) => <R1, E1, A>(fa: StateReaderTaskEither<S, R1, E1, A>) => StateReaderTaskEither<S, R1 & R2, E2, B | A>

Added in v2.9.0

Apply

ap

Apply a function to an argument under a type constructor.

Signature

export declare const ap: <S, R, E, A>(
  fa: StateReaderTaskEither<S, R, E, A>
) => <B>(fab: StateReaderTaskEither<S, R, E, (a: A) => B>) => StateReaderTaskEither<S, R, E, B>

Added in v2.0.0

apW

Less strict version of ap.

Signature

export declare const apW: <S, R2, E2, A>(
  fa: StateReaderTaskEither<S, R2, E2, A>
) => <R1, E1, B>(fab: StateReaderTaskEither<S, R1, E1, (a: A) => B>) => StateReaderTaskEither<S, R1 & R2, E2 | E1, B>

Added in v2.8.0

Bifunctor

bimap

Map a pair of functions over the two last type arguments of the bifunctor.

Signature

export declare const bimap: <E, G, A, B>(
  f: (e: E) => G,
  g: (a: A) => B
) => <S, R>(fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, G, B>

Added in v2.6.2

mapLeft

Map a function over the third type argument of a bifunctor.

Signature

export declare const mapLeft: <E, G>(
  f: (e: E) => G
) => <S, R, A>(fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, G, A>

Added in v2.6.2

Functor

map

map can be used to turn functions (a: A) => B into functions (fa: F<A>) => F<B> whose argument and return types use the type constructor F to represent some computational context.

Signature

export declare const map: <A, B>(
  f: (a: A) => B
) => <S, R, E>(fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.0.0

Monad

chain

Composes computations in sequence, using the return value of one computation to determine the next computation.

Signature

export declare const chain: <S, R, E, A, B>(
  f: (a: A) => StateReaderTaskEither<S, R, E, B>
) => (ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.0.0

chainW

Less strict version of chain.

Signature

export declare const chainW: <S, R2, E2, A, B>(
  f: (a: A) => StateReaderTaskEither<S, R2, E2, B>
) => <R1, E1>(ma: StateReaderTaskEither<S, R1, E1, A>) => StateReaderTaskEither<S, R1 & R2, E2 | E1, B>

Added in v2.6.0

MonadThrow

throwError

Signature

export declare const throwError: <S, R, E, A>(e: E) => StateReaderTaskEither<S, R, E, A>

Added in v2.7.0

Pointed

of

Signature

export declare const of: <S, R, E = never, A = never>(a: A) => StateReaderTaskEither<S, R, E, A>

Added in v2.7.0

combinators

apFirst

Combine two effectful actions, keeping only the result of the first.

Derivable from Apply.

Signature

export declare const apFirst: <S, R, E, B>(
  second: StateReaderTaskEither<S, R, E, B>
) => <A>(first: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

apSecond

Combine two effectful actions, keeping only the result of the second.

Derivable from Apply.

Signature

export declare const apSecond: <S, R, E, B>(
  second: StateReaderTaskEither<S, R, E, B>
) => <A>(first: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.0.0

asksStateReaderTaskEither

Effectfully accesses the environment.

Signature

export declare const asksStateReaderTaskEither: <R, S, E, A>(
  f: (r: R) => StateReaderTaskEither<S, R, E, A>
) => StateReaderTaskEither<S, R, E, A>

Added in v2.11.0

asksStateReaderTaskEitherW

Less strict version of asksStateReaderTaskEither.

Signature

export declare const asksStateReaderTaskEitherW: <R1, S, R2, E, A>(
  f: (r1: R1) => StateReaderTaskEither<S, R2, E, A>
) => StateReaderTaskEither<S, R1 & R2, E, A>

Added in v2.11.0

chainEitherK

Signature

export declare const chainEitherK: <E, A, B>(
  f: (a: A) => E.Either<E, B>
) => <S, R>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

chainEitherKW

Less strict version of chainEitherK.

Signature

export declare const chainEitherKW: <E2, A, B>(
  f: (a: A) => E.Either<E2, B>
) => <S, R, E1>(ma: StateReaderTaskEither<S, R, E1, A>) => StateReaderTaskEither<S, R, E2 | E1, B>

Added in v2.6.1

chainFirst

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 Chain.

Signature

export declare const chainFirst: <S, R, E, A, B>(
  f: (a: A) => StateReaderTaskEither<S, R, E, B>
) => (ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

chainFirstIOK

Signature

export declare const chainFirstIOK: <A, B>(
  f: (a: A) => IO<B>
) => <S, R, E>(first: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.10.0

chainFirstReaderK

Signature

export declare const chainFirstReaderK: <A, R, B>(
  f: (a: A) => R.Reader<R, B>
) => <S, E = never>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.11.0

chainFirstReaderKW

Less strict version of chainFirstReaderK.

Signature

export declare const chainFirstReaderKW: <A, R1, B>(
  f: (a: A) => R.Reader<R1, B>
) => <S, R2, E = never>(ma: StateReaderTaskEither<S, R2, E, A>) => StateReaderTaskEither<S, R2, E, A>

Added in v2.11.0

chainFirstTaskK

Signature

export declare const chainFirstTaskK: <A, B>(
  f: (a: A) => Task<B>
) => <S, R, E>(first: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.10.0

chainFirstW

Less strict version of chainFirst.

Derivable from Chain.

Signature

export declare const chainFirstW: <S, R2, E2, A, B>(
  f: (a: A) => StateReaderTaskEither<S, R2, E2, B>
) => <R1, E1>(ma: StateReaderTaskEither<S, R1, E1, A>) => StateReaderTaskEither<S, R1 & R2, E2 | E1, A>

Added in v2.8.0

chainIOEitherK

Signature

export declare const chainIOEitherK: <E, A, B>(
  f: (a: A) => IOEither<E, B>
) => <S, R>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

chainIOEitherKW

Less strict version of chainIOEitherK.

Signature

export declare const chainIOEitherKW: <E2, A, B>(
  f: (a: A) => IOEither<E2, B>
) => <S, R, E1>(ma: StateReaderTaskEither<S, R, E1, A>) => StateReaderTaskEither<S, R, E2 | E1, B>

Added in v2.6.1

chainIOK

Signature

export declare const chainIOK: <A, B>(
  f: (a: A) => IO<B>
) => <S, R, E>(first: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.10.0

chainOptionK

Signature

export declare const chainOptionK: <E>(
  onNone: Lazy<E>
) => <A, B>(
  f: (a: A) => Option<B>
) => <S, R>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.10.0

chainReaderK

Signature

export declare const chainReaderK: <A, R, B>(
  f: (a: A) => R.Reader<R, B>
) => <S, E = never>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.11.0

chainReaderKW

Less strict version of chainReaderK.

Signature

export declare const chainReaderKW: <A, R1, B>(
  f: (a: A) => R.Reader<R1, B>
) => <S, R2, E = never>(ma: StateReaderTaskEither<S, R2, E, A>) => StateReaderTaskEither<S, R1 & R2, E, B>

Added in v2.11.0

chainReaderTaskEitherK

Signature

export declare const chainReaderTaskEitherK: <R, E, A, B>(
  f: (a: A) => RTE.ReaderTaskEither<R, E, B>
) => <S>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

chainReaderTaskEitherKW

Less strict version of chainReaderTaskEitherK.

Signature

export declare const chainReaderTaskEitherKW: <R, E2, A, B>(
  f: (a: A) => RTE.ReaderTaskEither<R, E2, B>
) => <S, E1>(ma: StateReaderTaskEither<S, R, E1, A>) => StateReaderTaskEither<S, R, E2 | E1, B>

Added in v2.6.1

chainStateK

Signature

export declare const chainStateK: <A, S, B>(
  f: (a: A) => State<S, B>
) => <R, E = never>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.11.0

chainTaskEitherK

Signature

export declare const chainTaskEitherK: <E, A, B>(
  f: (a: A) => TaskEither<E, B>
) => <S, R>(ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

chainTaskEitherKW

Less strict version of chainTaskEitherK.

Signature

export declare const chainTaskEitherKW: <E2, A, B>(
  f: (a: A) => TaskEither<E2, B>
) => <S, R, E1>(ma: StateReaderTaskEither<S, R, E1, A>) => StateReaderTaskEither<S, R, E2 | E1, B>

Added in v2.6.1

chainTaskK

Signature

export declare const chainTaskK: <A, B>(
  f: (a: A) => Task<B>
) => <S, R, E>(first: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>

Added in v2.10.0

filterOrElse

Signature

export declare const filterOrElse: {
  <E, A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <S, R>(
    ma: StateReaderTaskEither<S, R, E, A>
  ) => StateReaderTaskEither<S, R, E, B>
  <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R, B extends A>(
    mb: StateReaderTaskEither<S, R, E, B>
  ) => StateReaderTaskEither<S, R, E, B>
  <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R>(
    ma: StateReaderTaskEither<S, R, E, A>
  ) => StateReaderTaskEither<S, R, E, A>
}

Added in v2.4.4

filterOrElseW

Less strict version of filterOrElse.

Signature

export declare const filterOrElseW: {
  <A, B extends A, E2>(refinement: Refinement<A, B>, onFalse: (a: A) => E2): <S, R, E1>(
    ma: StateReaderTaskEither<S, R, E1, A>
  ) => StateReaderTaskEither<S, R, E2 | E1, B>
  <A, E2>(predicate: Predicate<A>, onFalse: (a: A) => E2): <S, R, E1, B extends A>(
    mb: StateReaderTaskEither<S, R, E1, B>
  ) => StateReaderTaskEither<S, R, E2 | E1, B>
  <A, E2>(predicate: Predicate<A>, onFalse: (a: A) => E2): <S, R, E1>(
    ma: StateReaderTaskEither<S, R, E1, A>
  ) => StateReaderTaskEither<S, R, E2 | E1, A>
}

Added in v2.9.0

flap

Derivable from Functor.

Signature

export declare const flap: <A>(
  a: A
) => <S, R, E, B>(fab: StateReaderTaskEither<S, R, E, (a: A) => B>) => StateReaderTaskEither<S, R, E, B>

Added in v2.10.0

flatten

Derivable from Chain.

Signature

export declare const flatten: <S, R, E, A>(
  mma: StateReaderTaskEither<S, R, E, StateReaderTaskEither<S, R, E, A>>
) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

flattenW

Less strict version of flatten.

Signature

export declare const flattenW: <S, R1, E1, R2, E2, A>(
  mma: StateReaderTaskEither<S, R1, E1, StateReaderTaskEither<S, R2, E2, A>>
) => StateReaderTaskEither<S, R1 & R2, E1 | E2, A>

Added in v2.11.0

fromEitherK

Signature

export declare const fromEitherK: <E, A extends readonly unknown[], B>(
  f: (...a: A) => E.Either<E, B>
) => <S, R>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

fromIOEitherK

Signature

export declare const fromIOEitherK: <E, A extends readonly unknown[], B>(
  f: (...a: A) => IOEither<E, B>
) => <S, R>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

fromIOK

Signature

export declare const fromIOK: <A, B>(f: (...a: A) => IO<B>) => <S, R, E>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.10.0

fromOptionK

Signature

export declare const fromOptionK: <E>(
  onNone: Lazy<E>
) => <A, B>(f: (...a: A) => Option<B>) => <S, R>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.10.0

fromReaderK

Signature

export declare const fromReaderK: <A extends readonly unknown[], R, B>(
  f: (...a: A) => R.Reader<R, B>
) => <S, E = never>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.11.0

fromReaderTaskEitherK

Signature

export declare const fromReaderTaskEitherK: <R, E, A extends readonly unknown[], B>(
  f: (...a: A) => RTE.ReaderTaskEither<R, E, B>
) => <S>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

fromStateK

Signature

export declare const fromStateK: <A extends readonly unknown[], S, B>(
  f: (...a: A) => State<S, B>
) => <R, E = never>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.11.0

fromTaskEitherK

Signature

export declare const fromTaskEitherK: <E, A extends readonly unknown[], B>(
  f: (...a: A) => TaskEither<E, B>
) => <S, R>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

fromTaskK

Signature

export declare const fromTaskK: <A, B>(
  f: (...a: A) => Task<B>
) => <S, R, E>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.10.0

local

Changes the value of the local context during the execution of the action ma (similar to Contravariant’s contramap).

Signature

export declare const local: <R2, R1>(
  f: (r2: R2) => R1
) => <S, E, A>(ma: StateReaderTaskEither<S, R1, E, A>) => StateReaderTaskEither<S, R2, E, A>

Added in v2.11.0

constructors

ask

Reads the current context.

Signature

export declare const ask: <S, R, E = never>() => StateReaderTaskEither<S, R, E, R>

Added in v2.11.0

asks

Projects a value from the global context in a ReaderEither.

Signature

export declare const asks: <S, R, A, E = never>(f: (r: R) => A) => StateReaderTaskEither<S, R, E, A>

Added in v2.11.0

fromPredicate

Signature

export declare const fromPredicate: {
  <E, A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <S, R>(
    a: A
  ) => StateReaderTaskEither<S, R, E, B>
  <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R, B extends A>(b: B) => StateReaderTaskEither<S, R, E, B>
  <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R>(a: A) => StateReaderTaskEither<S, R, E, A>
}

Added in v2.4.4

fromReaderTaskEither

Signature

export declare const fromReaderTaskEither: NaturalTransformation34<'ReaderTaskEither', 'StateReaderTaskEither'>

Added in v2.0.0

get

Get the current state

Signature

export declare const get: <S, R, E = never>() => StateReaderTaskEither<S, R, E, S>

Added in v2.0.0

gets

Get a value which depends on the current state

Signature

export declare const gets: <S, R, E = never, A = never>(f: (s: S) => A) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

left

Signature

export declare const left: <S, R, E = never, A = never>(e: E) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

leftIO

Signature

export declare function leftIO<S, R, E = never, A = never>(me: IO<E>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

leftReader

Signature

export declare function leftReader<S, R, E = never, A = never>(me: Reader<R, E>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

leftState

Signature

export declare const leftState: <S, R, E = never, A = never>(me: State<S, E>) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

leftTask

Signature

export declare function leftTask<S, R, E = never, A = never>(me: Task<E>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

modify

Modify the state by applying a function to the current state

Signature

export declare const modify: <S, R, E = never>(f: Endomorphism<S>) => StateReaderTaskEither<S, R, E, void>

Added in v2.0.0

put

Set the state

Signature

export declare const put: <S, R, E = never>(s: S) => StateReaderTaskEither<S, R, E, void>

Added in v2.0.0

Signature

export declare const right: <S, R, E = never, A = never>(a: A) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

rightIO

Signature

export declare function rightIO<S, R, E = never, A = never>(ma: IO<A>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

rightReader

Signature

export declare function rightReader<S, R, E = never, A = never>(ma: Reader<R, A>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

rightState

Signature

export declare const rightState: <S, R, E = never, A = never>(ma: State<S, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

rightTask

Signature

export declare function rightTask<S, R, E = never, A = never>(ma: Task<A>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

instances

Alt

Signature

export declare const Alt: Alt4<'StateReaderTaskEither'>

Added in v2.7.0

Applicative

Signature

export declare const Applicative: Applicative4<'StateReaderTaskEither'>

Added in v2.7.0

Apply

Signature

export declare const Apply: Apply4<'StateReaderTaskEither'>

Added in v2.10.0

Bifunctor

Signature

export declare const Bifunctor: Bifunctor4<'StateReaderTaskEither'>

Added in v2.7.0

Chain

Signature

export declare const Chain: Chain4<'StateReaderTaskEither'>

Added in v2.10.0

FromEither

Signature

export declare const FromEither: FromEither4<'StateReaderTaskEither'>

Added in v2.10.0

FromIO

Signature

export declare const FromIO: FromIO4<'StateReaderTaskEither'>

Added in v2.10.0

FromReader

Signature

export declare const FromReader: FromReader4<'StateReaderTaskEither'>

Added in v2.11.0

FromState

Signature

export declare const FromState: FromState4<'StateReaderTaskEither'>

Added in v2.11.0

FromTask

Signature

export declare const FromTask: FromTask4<'StateReaderTaskEither'>

Added in v2.10.0

Functor

Signature

export declare const Functor: Functor4<'StateReaderTaskEither'>

Added in v2.7.0

Monad

Signature

export declare const Monad: Monad4<'StateReaderTaskEither'>

Added in v2.10.0

MonadIO

Signature

export declare const MonadIO: MonadIO4<'StateReaderTaskEither'>

Added in v2.10.0

MonadTask

Signature

export declare const MonadTask: MonadTask4<'StateReaderTaskEither'>

Added in v2.10.0

MonadThrow

Signature

export declare const MonadThrow: MonadThrow4<'StateReaderTaskEither'>

Added in v2.10.0

Pointed

Signature

export declare const Pointed: Pointed4<'StateReaderTaskEither'>

Added in v2.10.0

URI

Signature

export declare const URI: 'StateReaderTaskEither'

Added in v2.0.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.0.0

stateReaderTaskEitherSeq

Use small, specific instances instead.

Signature

export declare const stateReaderTaskEitherSeq: Monad4<'StateReaderTaskEither'> &
  Bifunctor4<'StateReaderTaskEither'> &
  Alt4<'StateReaderTaskEither'> &
  MonadTask4<'StateReaderTaskEither'> &
  MonadThrow4<'StateReaderTaskEither'>

Added in v2.0.0

stateReaderTaskEither

Use small, specific instances instead.

Signature

export declare const stateReaderTaskEither: Monad4<'StateReaderTaskEither'> &
  Bifunctor4<'StateReaderTaskEither'> &
  Alt4<'StateReaderTaskEither'> &
  MonadTask4<'StateReaderTaskEither'> &
  MonadThrow4<'StateReaderTaskEither'>

Added in v2.0.0

model

StateReaderTaskEither (interface)

Signature

export interface StateReaderTaskEither<S, R, E, A> {
  (s: S): ReaderTaskEither<R, E, [A, S]>
}

Added in v2.0.0

natural transformations

fromEither

Signature

export declare const fromEither: NaturalTransformation24<'Either', 'StateReaderTaskEither'>

Added in v2.0.0

fromIO

Signature

export declare const fromIO: NaturalTransformation14<'IO', 'StateReaderTaskEither'>

Added in v2.7.0

fromIOEither

Signature

export declare const fromIOEither: NaturalTransformation24<'IOEither', 'StateReaderTaskEither'>

Added in v2.0.0

fromOption

Signature

export declare const fromOption: <E>(onNone: Lazy<E>) => NaturalTransformation14C<'Option', 'StateReaderTaskEither', E>

Added in v2.0.0

fromReader

Signature

export declare const fromReader: NaturalTransformation24R<'Reader', 'StateReaderTaskEither'>

Added in v2.11.0

fromReaderEither

Signature

export declare const fromReaderEither: NaturalTransformation34<'ReaderEither', 'StateReaderTaskEither'>

Added in v2.0.0

fromState

Signature

export declare const fromState: NaturalTransformation24S<'State', 'StateReaderTaskEither'>

Added in v2.10.0

fromTask

Signature

export declare const fromTask: NaturalTransformation14<'Task', 'StateReaderTaskEither'>

Added in v2.7.0

fromTaskEither

Signature

export declare const fromTaskEither: NaturalTransformation24<'TaskEither', 'StateReaderTaskEither'>

Added in v2.0.0

utils

apS

Signature

export declare const apS: <N, A, S, R, E, B>(
  name: Exclude<N, keyof A>,
  fb: StateReaderTaskEither<S, R, E, B>
) => (
  fa: StateReaderTaskEither<S, R, E, A>
) => StateReaderTaskEither<S, R, E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

Added in v2.8.0

apSW

Signature

export declare const apSW: <A, N extends string, S, R2, E2, B>(
  name: Exclude<N, keyof A>,
  fb: StateReaderTaskEither<S, R2, E2, B>
) => <R1, E1>(
  fa: StateReaderTaskEither<S, R1, E1, A>
) => StateReaderTaskEither<S, R1 & R2, E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

Added in v2.8.0

bind

Signature

export declare const bind: <N, A, S, R, E, B>(
  name: Exclude<N, keyof A>,
  f: (a: A) => StateReaderTaskEither<S, R, E, B>
) => (
  ma: StateReaderTaskEither<S, R, E, A>
) => StateReaderTaskEither<S, R, E, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

Added in v2.8.0

bindTo

Signature

export declare const bindTo: <N>(
  name: N
) => <S, R, E, A>(fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, { readonly [K in N]: A }>

Added in v2.8.0

bindW

Signature

export declare const bindW: <N extends string, A, S, R2, E2, B>(
  name: Exclude<N, keyof A>,
  f: (a: A) => StateReaderTaskEither<S, R2, E2, B>
) => <R1, E1>(
  fa: StateReaderTaskEither<S, R1, E1, A>
) => StateReaderTaskEither<S, R1 & R2, E2 | E1, { readonly [K in N | keyof A]: K extends keyof A ? A[K] : B }>

Added in v2.8.0

evaluate

Run a computation in the StateReaderTaskEither monad, discarding the final state

Signature

export declare const evaluate: <S>(
  s: S
) => <R, E, A>(ma: StateReaderTaskEither<S, R, E, A>) => RTE.ReaderTaskEither<R, E, A>

Added in v2.8.0

execute

Run a computation in the StateReaderTaskEither monad discarding the result

Signature

export declare const execute: <S>(
  s: S
) => <R, E, A>(ma: StateReaderTaskEither<S, R, E, A>) => RTE.ReaderTaskEither<R, E, S>

Added in v2.8.0

sequenceArray

Signature

export declare const sequenceArray: <S, R, E, A>(
  arr: readonly StateReaderTaskEither<S, R, E, A>[]
) => StateReaderTaskEither<S, R, E, readonly A[]>

Added in v2.9.0

traverseArray

Signature

export declare const traverseArray: <S, R, E, A, B>(
  f: (a: A) => StateReaderTaskEither<S, R, E, B>
) => (as: readonly A[]) => StateReaderTaskEither<S, R, E, readonly B[]>

Added in v2.9.0

traverseArrayWithIndex

Signature

export declare const traverseArrayWithIndex: <S, R, E, A, B>(
  f: (index: number, a: A) => StateReaderTaskEither<S, R, E, B>
) => (as: readonly A[]) => StateReaderTaskEither<S, R, E, readonly B[]>

Added in v2.9.0

traverseReadonlyArrayWithIndex

Equivalent to ReadonlyArray#traverseWithIndex(Applicative).

Signature

export declare const traverseReadonlyArrayWithIndex: <A, S, R, E, B>(
  f: (index: number, a: A) => StateReaderTaskEither<S, R, E, B>
) => (as: readonly A[]) => StateReaderTaskEither<S, R, E, readonly B[]>

Added in v2.11.0

traverseReadonlyNonEmptyArrayWithIndex

Equivalent to ReadonlyNonEmptyArray#traverseWithIndex(Applicative).

Signature

export declare const traverseReadonlyNonEmptyArrayWithIndex: <A, S, R, E, B>(
  f: (index: number, a: A) => StateReaderTaskEither<S, R, E, B>
) => (as: ReadonlyNonEmptyArray<A>) => StateReaderTaskEither<S, R, E, ReadonlyNonEmptyArray<B>>

Added in v2.11.0

evalState

Use evaluate instead

Signature

export declare const evalState: <S, R, E, A>(
  ma: StateReaderTaskEither<S, R, E, A>,
  s: S
) => RTE.ReaderTaskEither<R, E, A>

Added in v2.0.0

execState

Use execute instead

Signature

export declare const execState: <S, R, E, A>(
  ma: StateReaderTaskEither<S, R, E, A>,
  s: S
) => RTE.ReaderTaskEither<R, E, S>

Added in v2.0.0

run

Signature

export declare function run<S, R, E, A>(ma: StateReaderTaskEither<S, R, E, A>, s: S, r: R): Promise<Either<E, [A, S]>>

Added in v2.0.0