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

Applicative

of

Signature

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

Added in v2.7.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

apFirst

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

Signature

export declare const apFirst: <S, R, E, B>(
  fb: StateReaderTaskEither<S, R, E, B>
) => <A>(fa: 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.

Signature

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

Added in v2.0.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

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

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.

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

chainW

Less strict version of chain.

Signature

export declare const chainW: <S, R, E, A, B>(
  f: (a: A) => StateReaderTaskEither<S, R, E, B>
) => <Q, D>(ma: StateReaderTaskEither<S, Q, D, A>) => StateReaderTaskEither<S, Q & R, E | D, B>

Added in v2.6.0

flatten

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

MonadIO

fromIO

Signature

export declare const fromIO: <S, R, E, A>(fa: IO<A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.7.0

MonadTask

fromTask

Signature

export declare const fromTask: <S, R, E, A>(fa: Task<A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.7.0

MonadThrow

throwError

Signature

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

Added in v2.7.0

combinators

chainEitherK

Signature

export declare const chainEitherK: <E, A, B>(
  f: (a: A) => 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: <E, A, B>(
  f: (a: A) => Either<E, B>
) => <S, R, D>(ma: StateReaderTaskEither<S, R, D, A>) => StateReaderTaskEither<S, R, E | D, B>

Added in v2.6.1

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: <E, A, B>(
  f: (a: A) => IOEither<E, B>
) => <S, R, D>(ma: StateReaderTaskEither<S, R, D, A>) => StateReaderTaskEither<S, R, E | D, B>

Added in v2.6.1

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, E, A, B>(
  f: (a: A) => RTE.ReaderTaskEither<R, E, B>
) => <S, D>(ma: StateReaderTaskEither<S, R, D, A>) => StateReaderTaskEither<S, R, E | D, B>

Added in v2.6.1

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: <E, A, B>(
  f: (a: A) => TaskEither<E, B>
) => <S, R, D>(ma: StateReaderTaskEither<S, R, D, A>) => StateReaderTaskEither<S, R, E | D, B>

Added in v2.6.1

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>(
    ma: StateReaderTaskEither<S, R, E, A>
  ) => StateReaderTaskEither<S, R, E, A>
}

Added in v2.4.4

fromEitherK

Signature

export declare function fromEitherK<E, A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => Either<E, B>
): <S, R>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

fromIOEitherK

Signature

export declare function fromIOEitherK<E, A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => IOEither<E, B>
): <S, R>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

fromReaderTaskEitherK

Signature

export declare function fromReaderTaskEitherK<R, E, A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => ReaderTaskEither<R, E, B>
): <S>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

fromTaskEitherK

Signature

export declare function fromTaskEitherK<E, A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => TaskEither<E, B>
): <S, R>(...a: A) => StateReaderTaskEither<S, R, E, B>

Added in v2.4.0

constructors

fromEither

Signature

export declare const fromEither: <S, R, E, A>(ma: Either<E, A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

fromIOEither

Signature

export declare function fromIOEither<S, R, E, A>(ma: IOEither<E, A>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

fromOption

Signature

export declare const fromOption: <E>(onNone: Lazy<E>) => <S, R, A>(ma: Option<A>) => StateReaderTaskEither<S, R, E, A>

Added in v2.0.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>(a: A) => StateReaderTaskEither<S, R, E, A>
}

Added in v2.4.4

fromReaderEither

Signature

export declare function fromReaderEither<S, R, E, A>(ma: ReaderEither<R, E, A>): StateReaderTaskEither<S, R, E, A>

Added in v2.0.0

fromReaderTaskEither

Signature

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

Added in v2.0.0

fromTaskEither

Signature

export declare function fromTaskEither<S, R, E, A>(ma: TaskEither<E, A>): StateReaderTaskEither<S, R, E, A>

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 function 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 function 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: (s: S) => 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

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

altReaderStateTaskEither

Signature

export declare const altReaderStateTaskEither: Alt4<'StateReaderTaskEither'>

Added in v2.7.0

applicativeStateReaderTaskEither

Signature

export declare const applicativeStateReaderTaskEither: Applicative4<'StateReaderTaskEither'>

Added in v2.7.0

bifunctorStateReaderTaskEither

Signature

export declare const bifunctorStateReaderTaskEither: Bifunctor4<'StateReaderTaskEither'>

Added in v2.7.0

functorStateReaderTaskEither

Signature

export declare const functorStateReaderTaskEither: Functor4<'StateReaderTaskEither'>

Added in v2.7.0

stateReaderTaskEither

Signature

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

Added in v2.0.0

stateReaderTaskEitherSeq

Like stateReaderTaskEither but ap is sequential

Signature

export declare const stateReaderTaskEitherSeq: 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

utils

evalState

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

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

Run a computation in the StateReaderTaskEither monad discarding the result

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