Skip to content

Latest commit

 

History

History
1881 lines (1262 loc) · 35.4 KB

File metadata and controls

1881 lines (1262 loc) · 35.4 KB
title ReaderTaskEither.ts
nav_order 76
parent Modules

ReaderTaskEither overview

Added in v3.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: <R, E, A>(
  second: Lazy<ReaderTaskEither<R, E, A>>
) => (first: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

altW

Less strict version of alt.

Signature

export declare const altW: <R2, E2, B>(
  second: () => ReaderTaskEither<R2, E2, B>
) => <R1, E1, A>(first: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2, B | A>

Added in v3.0.0

Apply

ap

Apply a function to an argument under a type constructor.

Signature

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

Added in v3.0.0

apW

Less strict version of ap.

Signature

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

Added in v3.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
) => <R>(fea: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, G, B>

Added in v3.0.0

mapLeft

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

Signature

export declare const mapLeft: <E, G>(
  f: (e: E) => G
) => <R, A>(fea: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, G, A>

Added in v3.0.0

Chain

chain

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

Signature

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

Added in v3.0.0

chainW

Less strict version of chain.

Signature

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

Added in v3.0.0

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) => <R, E>(fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v3.0.0

Pointed

of

Signature

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

Added in v3.0.0

combinators

apFirstW

Less strict version of apFirst.

Signature

export declare const apFirstW: <R2, E2, B>(
  second: ReaderTaskEither<R2, E2, B>
) => <R1, E1, A>(first: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2 | E1, A>

Added in v3.0.0

apSecondW

Less strict version of apSecond.

Signature

export declare const apSecondW: <R2, E2, B>(
  second: ReaderTaskEither<R2, E2, B>
) => <R1, E1, A>(first: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2 | E1, B>

Added in v3.0.0

chainEitherK

Signature

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

Added in v3.0.0

chainEitherKW

Less strict version of chainEitherK.

Signature

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

Added in v3.0.0

chainFirstEitherK

Signature

export declare const chainFirstEitherK: <A, E, B>(
  f: (a: A) => E.Either<E, B>
) => <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

chainFirstEitherKW

Less strict version of chainFirstEitherK.

Signature

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

Added in v3.0.0

chainFirstIOK

Signature

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

Added in v3.0.0

chainFirstReaderEitherK

Signature

export declare const chainFirstReaderEitherK: <A, R, E, B>(
  f: (a: A) => ReaderEither<R, E, B>
) => (ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

chainFirstReaderEitherKW

Less strict version of chainFirstReaderEitherK.

Signature

export declare const chainFirstReaderEitherKW: <A, R2, E2, B>(
  f: (a: A) => ReaderEither<R2, E2, B>
) => <R1, E1>(ma: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2 | E1, A>

Added in v3.0.0

chainFirstReaderK

Signature

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

Added in v3.0.0

chainFirstReaderKW

Less strict version of chainFirstReaderK.

Signature

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

Added in v3.0.0

chainFirstReaderTaskK

Signature

export declare const chainFirstReaderTaskK: <A, R, B>(
  f: (a: A) => RT.ReaderTask<R, B>
) => <E = never>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

chainFirstReaderTaskKW

Less strict version of chainFirstReaderTaskK.

Signature

export declare const chainFirstReaderTaskKW: <A, R2, B>(
  f: (a: A) => RT.ReaderTask<R2, B>
) => <R1, E = never>(ma: ReaderTaskEither<R1, E, A>) => ReaderTaskEither<R1 & R2, E, A>

Added in v3.0.0

chainFirstTaskEitherK

Signature

export declare const chainFirstTaskEitherK: <A, E, B>(
  f: (a: A) => TE.TaskEither<E, B>
) => <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

chainFirstTaskEitherKW

Less strict version of chainFirstTaskEitherK.

Signature

export declare const chainFirstTaskEitherKW: <A, E2, B>(
  f: (a: A) => TE.TaskEither<E2, B>
) => <R, E1>(ma: ReaderTaskEither<R, E1, A>) => ReaderTaskEither<R, E2 | E1, A>

Added in v3.0.0

chainFirstTaskK

Signature

export declare const chainFirstTaskK: <A, B>(
  f: (a: A) => T.Task<B>
) => <R, E>(first: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

chainFirstW

Less strict version of chainFirst.

Signature

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

Added in v3.0.0

chainIOEitherK

Signature

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

Added in v3.0.0

chainIOEitherKW

Less strict version of chainIOEitherK.

Signature

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

Added in v3.0.0

chainIOK

Signature

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

Added in v3.0.0

chainOptionK

Signature

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

Added in v3.0.0

chainReaderEitherK

Signature

export declare const chainReaderEitherK: <A, R, E, B>(
  f: (a: A) => ReaderEither<R, E, B>
) => (ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v3.0.0

chainReaderEitherKW

Less strict version of chainReaderEitherK.

Signature

export declare const chainReaderEitherKW: <A, R2, E2, B>(
  f: (a: A) => ReaderEither<R2, E2, B>
) => <R1, E1>(ma: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2 | E1, B>

Added in v3.0.0

chainReaderK

Signature

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

Added in v3.0.0

chainReaderKW

Less strict version of chainReaderK.

Signature

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

Added in v3.0.0

chainReaderTaskK

Signature

export declare const chainReaderTaskK: <A, R, B>(
  f: (a: A) => RT.ReaderTask<R, B>
) => <E = never>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v3.0.0

chainReaderTaskKW

Less strict version of chainReaderTaskK.

Signature

export declare const chainReaderTaskKW: <A, R2, B>(
  f: (a: A) => RT.ReaderTask<R2, B>
) => <R1, E = never>(ma: ReaderTaskEither<R1, E, A>) => ReaderTaskEither<R1 & R2, E, B>

Added in v3.0.0

chainTaskEitherK

Signature

export declare const chainTaskEitherK: <A, E, B>(
  f: (a: A) => TE.TaskEither<E, B>
) => <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v3.0.0

chainTaskEitherKW

Less strict version of chainTaskEitherK.

Signature

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

Added in v3.0.0

chainTaskK

Signature

export declare const chainTaskK: <A, B>(
  f: (a: A) => T.Task<B>
) => <R, E>(first: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v3.0.0

filterOrElse

Signature

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

Added in v3.0.0

filterOrElseW

Less strict version of filterOrElse.

Signature

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

Added in v3.0.0

flap

Derivable from Functor.

Signature

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

Added in v3.0.0

flattenW

Less strict version of flatten.

Signature

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

Added in v3.0.0

fromEitherK

Signature

export declare const fromEitherK: <A, E, B>(f: (...a: A) => E.Either<E, B>) => <R>(...a: A) => ReaderTaskEither<R, E, B>

Added in v3.0.0

fromIOEitherK

Signature

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

Added in v3.0.0

fromIOK

Signature

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

Added in v3.0.0

fromOptionK

Signature

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

Added in v3.0.0

fromReaderEitherK

Signature

export declare const fromReaderEitherK: <A extends readonly unknown[], R, E, B>(
  f: (...a: A) => ReaderEither<R, E, B>
) => (...a: A) => ReaderTaskEither<R, E, B>

Added in v3.0.0

fromReaderK

Signature

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

Added in v3.0.0

fromReaderTaskK

Signature

export declare const fromReaderTaskK: <A extends readonly unknown[], R, B>(
  f: (...a: A) => RT.ReaderTask<R, B>
) => <E = never>(...a: A) => ReaderTaskEither<R, E, B>

Added in v3.0.0

fromTaskEitherK

Signature

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

Added in v3.0.0

fromTaskK

Signature

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

Added in v3.0.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: <R1, R2 = R1>(
  f: (r2: R2) => R1
) => <E, A>(ma: ReaderTaskEither<R1, E, A>) => ReaderTaskEither<R2, E, A>

Added in v3.0.0

orElse

Signature

export declare const orElse: <E1, R, E2, A>(
  onLeft: (e: E1) => ReaderTaskEither<R, E2, A>
) => (ma: ReaderTaskEither<R, E1, A>) => ReaderTaskEither<R, E2, A>

Added in v3.0.0

orElseFirst

Signature

export declare const orElseFirst: <E, R, B>(
  onLeft: (e: E) => ReaderTaskEither<R, E, B>
) => <A>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

orElseFirstW

Signature

export declare const orElseFirstW: <E1, R1, E2, B>(
  onLeft: (e: E1) => ReaderTaskEither<R1, E2, B>
) => <R2, A>(ma: ReaderTaskEither<R2, E1, A>) => ReaderTaskEither<R1 & R2, E1 | E2, A>

Added in v3.0.0

orElseW

Less strict version of orElse.

Signature

export declare const orElseW: <E1, R1, E2, B>(
  onLeft: (e: E1) => ReaderTaskEither<R1, E2, B>
) => <R2, A>(ma: ReaderTaskEither<R2, E1, A>) => ReaderTaskEither<R1 & R2, E2, B | A>

Added in v3.0.0

orLeft

Signature

export declare const orLeft: <E1, R, E2>(
  onLeft: (e: E1) => RT.ReaderTask<R, E2>
) => <A>(fa: ReaderTaskEither<R, E1, A>) => ReaderTaskEither<R, E2, A>

Added in v3.0.0

swap

Signature

export declare const swap: <R, E, A>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, A, E>

Added in v3.0.0

constructors

ask

Reads the current context.

Signature

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

Added in v3.0.0

asks

Projects a value from the global context in a ReaderEither.

Signature

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

Added in v3.0.0

asksReaderTaskEither

Signature

export declare const asksReaderTaskEither: <R, E, A>(
  f: (r: R) => ReaderTaskEither<R, E, A>
) => ReaderTaskEither<R, E, A>

Added in v3.0.0

asksReaderTaskEitherW

Less strict version of asksReaderTaskEitherK.

Signature

export declare const asksReaderTaskEitherW: <R1, R2, E, A>(
  f: (r1: R1) => ReaderTaskEither<R2, E, A>
) => ReaderTaskEither<R1 & R2, E, A>

Added in v3.0.0

fromPredicate

Derivable from FromEither.

Signature

export declare const fromPredicate: {
  <A, B>(refinement: Refinement<A, B>): <R>(a: A) => ReaderTaskEither<R, A, B>
  <A>(predicate: Predicate<A>): <B, R>(b: B) => ReaderTaskEither<R, B, B>
  <A>(predicate: Predicate<A>): <R>(a: A) => ReaderTaskEither<R, A, A>
}

Added in v3.0.0

fromReaderEither

Signature

export declare const fromReaderEither: NaturalTransformation33<'ReaderEither', 'ReaderTaskEither'>

Added in v3.0.0

left

Signature

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

Added in v3.0.0

leftIO

Signature

export declare const leftIO: <E, R, A = never>(me: IO<E>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

leftReader

Signature

export declare const leftReader: <R, E, A = never>(me: R.Reader<R, E>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

leftReaderTask

Signature

export declare const leftReaderTask: <R, E, A = never>(me: RT.ReaderTask<R, E>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

leftTask

Signature

export declare const leftTask: <E, R, A = never>(me: T.Task<E>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

right

Signature

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

Added in v3.0.0

rightIO

Signature

export declare const rightIO: <A, R, E = never>(ma: IO<A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

rightReader

Signature

export declare const rightReader: <R, A, E = never>(ma: R.Reader<R, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

rightReaderTask

Signature

export declare const rightReaderTask: <R, A, E = never>(ma: RT.ReaderTask<R, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

rightTask

Signature

export declare const rightTask: <A, R, E = never>(ma: T.Task<A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

derivable combinators

apFirst

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

Derivable from Apply.

Signature

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

Added in v3.0.0

apSecond

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

Derivable from Apply.

Signature

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

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

Derivable from Chain.

Signature

export declare const chainFirst: <A, R, E, B>(
  f: (a: A) => ReaderTaskEither<R, E, B>
) => (first: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v3.0.0

flatten

Derivable from Chain.

Signature

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

Added in v3.0.0

destructors

getOrElse

Signature

export declare const getOrElse: <E, A>(onLeft: (e: E) => A) => <R>(ma: ReaderTaskEither<R, E, A>) => RT.ReaderTask<R, A>

Added in v3.0.0

getOrElseE

Signature

export declare const getOrElseE: <E, R, A>(
  onLeft: (e: E) => RT.ReaderTask<R, A>
) => (ma: ReaderTaskEither<R, E, A>) => RT.ReaderTask<R, A>

Added in v3.0.0

getOrElseEW

Less strict version of getOrElseE.

Signature

export declare const getOrElseEW: <E, R2, B>(
  onLeft: (e: E) => RT.ReaderTask<R2, B>
) => <R1, A>(ma: ReaderTaskEither<R1, E, A>) => RT.ReaderTask<R1 & R2, B | A>

Added in v3.0.0

getOrElseW

Less strict version of getOrElse.

Signature

export declare const getOrElseW: <E, B>(
  onLeft: (e: E) => B
) => <R, A>(ma: ReaderTaskEither<R, E, A>) => RT.ReaderTask<R, B | A>

Added in v3.0.0

match

Signature

export declare const match: <E, B, A>(
  onLeft: (e: E) => B,
  onRight: (a: A) => B
) => <R>(ma: ReaderTaskEither<R, E, A>) => RT.ReaderTask<R, B>

Added in v3.0.0

matchE

Signature

export declare const matchE: <E, R, B, A>(
  onLeft: (e: E) => RT.ReaderTask<R, B>,
  onRight: (a: A) => RT.ReaderTask<R, B>
) => (ma: ReaderTaskEither<R, E, A>) => RT.ReaderTask<R, B>

Added in v3.0.0

matchEW

Less strict version of matchE.

Signature

export declare const matchEW: <E, R2, B, A, R3, C>(
  onLeft: (e: E) => RT.ReaderTask<R2, B>,
  onRight: (a: A) => RT.ReaderTask<R3, C>
) => <R1>(ma: ReaderTaskEither<R1, E, A>) => RT.ReaderTask<R1 & R2 & R3, B | C>

Added in v3.0.0

matchW

Less strict version of match.

Signature

export declare const matchW: <E, B, A, C>(
  onLeft: (e: E) => B,
  onRight: (a: A) => C
) => <R>(ma: ReaderTaskEither<R, E, A>) => RT.ReaderTask<R, B | C>

Added in v3.0.0

instances

Alt

Signature

export declare const Alt: Alt3<'ReaderTaskEither'>

Added in v3.0.0

ApplicativePar

Signature

export declare const ApplicativePar: Applicative3<'ReaderTaskEither'>

Added in v3.0.0

ApplicativeSeq

Signature

export declare const ApplicativeSeq: Applicative3<'ReaderTaskEither'>

Added in v3.0.0

ApplyPar

Signature

export declare const ApplyPar: Apply3<'ReaderTaskEither'>

Added in v3.0.0

ApplySeq

Signature

export declare const ApplySeq: Apply3<'ReaderTaskEither'>

Added in v3.0.0

Bifunctor

Signature

export declare const Bifunctor: Bifunctor3<'ReaderTaskEither'>

Added in v3.0.0

Chain

Signature

export declare const Chain: Chain3<'ReaderTaskEither'>

Added in v3.0.0

FromEither

Signature

export declare const FromEither: FromEither3<'ReaderTaskEither'>

Added in v3.0.0

FromIO

Signature

export declare const FromIO: FromIO3<'ReaderTaskEither'>

Added in v3.0.0

FromReader

Signature

export declare const FromReader: FromReader3<'ReaderTaskEither'>

Added in v3.0.0

FromTask

Signature

export declare const FromTask: FromTask3<'ReaderTaskEither'>

Added in v3.0.0

Functor

Signature

export declare const Functor: Functor3<'ReaderTaskEither'>

Added in v3.0.0

Monad

Signature

export declare const Monad: Monad3<'ReaderTaskEither'>

Added in v3.0.0

Pointed

Signature

export declare const Pointed: Pointed3<'ReaderTaskEither'>

Added in v3.0.0

URI (type alias)

Signature

export type URI = 'ReaderTaskEither'

Added in v3.0.0

getAltReaderTaskValidation

The default Alt instance returns the last error, if you want to get all errors you need to provide an way to concatenate them via a Semigroup.

See getAltValidation.

Signature

export declare const getAltReaderTaskValidation: <E>(S: Semigroup<E>) => Alt3C<'ReaderTaskEither', E>

Added in v3.0.0

getApplicativeReaderTaskValidation

The default ApplicativePar instance returns the first error, if you want to get all errors you need to provide an way to concatenate them via a Semigroup.

See getApplicativeValidation.

Signature

export declare const getApplicativeReaderTaskValidation: <E>(
  A: Apply1<T.URI>,
  S: Semigroup<E>
) => Applicative3C<'ReaderTaskEither', E>

Added in v3.0.0

getCompactable

Signature

export declare const getCompactable: <E>(M: Monoid<E>) => Compactable3C<'ReaderTaskEither', E>

Added in v3.0.0

getFilterable

Signature

export declare const getFilterable: <E>(M: Monoid<E>) => Filterable3C<'ReaderTaskEither', E>

Added in v3.0.0

interop

chainNullableK

Signature

export declare const chainNullableK: <E>(
  e: E
) => <A, B>(
  f: (a: A) => B | null | undefined
) => <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, NonNullable<B>>

Added in v3.0.0

fromNullable

Signature

export declare const fromNullable: <E>(e: E) => <A, R>(a: A) => ReaderTaskEither<R, E, NonNullable<A>>

Added in v3.0.0

fromNullableK

Signature

export declare const fromNullableK: <E>(
  e: E
) => <A extends readonly unknown[], B>(
  f: (...a: A) => B | null | undefined
) => <R>(...a: A) => ReaderTaskEither<R, E, NonNullable<B>>

Added in v3.0.0

toUnion

Signature

export declare const toUnion: <R, E, A>(fa: ReaderTaskEither<R, E, A>) => RT.ReaderTask<R, E | A>

Added in v3.0.0

model

ReaderTaskEither (interface)

Signature

export interface ReaderTaskEither<R, E, A> {
  (r: R): TaskEither<E, A>
}

Added in v3.0.0

natural transformations

fromEither

Signature

export declare const fromEither: NaturalTransformation23<'Either', 'ReaderTaskEither'>

Added in v3.0.0

fromIO

Signature

export declare const fromIO: NaturalTransformation13<'IO', 'ReaderTaskEither'>

Added in v3.0.0

fromIOEither

Signature

export declare const fromIOEither: NaturalTransformation23<'IOEither', 'ReaderTaskEither'>

Added in v3.0.0

fromOption

Derivable from FromEither.

Signature

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

Added in v3.0.0

fromReader

Signature

export declare const fromReader: NaturalTransformation23R<'Reader', 'ReaderTaskEither'>

Added in v3.0.0

fromTask

Signature

export declare const fromTask: NaturalTransformation13<'Task', 'ReaderTaskEither'>

Added in v3.0.0

fromTaskEither

Signature

export declare const fromTaskEither: NaturalTransformation23<'TaskEither', 'ReaderTaskEither'>

Added in v3.0.0

utils

ApT

Signature

export declare const ApT: ReaderTaskEither<unknown, never, readonly []>

Added in v3.0.0

Do

Signature

export declare const Do: ReaderTaskEither<unknown, never, {}>

Added in v3.0.0

apS

Signature

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

Added in v3.0.0

apSW

Less strict version of apS.

Signature

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

Added in v3.0.0

apT

Signature

export declare const apT: <R, E, B>(
  fb: ReaderTaskEither<R, E, B>
) => <A>(fas: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, readonly [...A, B]>

Added in v3.0.0

apTW

Less strict version of apT.

Signature

export declare const apTW: <R2, E2, B>(
  fb: ReaderTaskEither<R2, E2, B>
) => <R1, E1, A extends readonly unknown[]>(
  fas: ReaderTaskEither<R1, E1, A>
) => ReaderTaskEither<R1 & R2, E2 | E1, readonly [...A, B]>

Added in v3.0.0

bind

Signature

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

Added in v3.0.0

bindTo

Signature

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

Added in v3.0.0

bindW

Less strict version of bind.

Signature

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

Added in v3.0.0

bracket

Make sure that a resource is cleaned up in the event of an exception (*). The release action is called regardless of whether the body action throws (*) or returns.

(*) i.e. returns a Left

Signature

export declare const bracket: <R, E, A, B>(
  aquire: ReaderTaskEither<R, E, A>,
  use: (a: A) => ReaderTaskEither<R, E, B>,
  release: (a: A, e: E.Either<E, B>) => ReaderTaskEither<R, E, void>
) => ReaderTaskEither<R, E, B>

Added in v3.0.0

bracketW

Less strict version of bracket.

Signature

export declare const bracketW: <R1, E1, A, R2, E2, B, R3, E3>(
  acquire: ReaderTaskEither<R1, E1, A>,
  use: (a: A) => ReaderTaskEither<R2, E2, B>,
  release: (a: A, e: E.Either<E2, B>) => ReaderTaskEither<R3, E3, void>
) => ReaderTaskEither<R1 & R2 & R3, E1 | E2 | E3, B>

Added in v3.0.0

traverseReadonlyArrayWithIndex

Equivalent to ReadonlyArray#traverseWithIndex(ApplicativePar).

Signature

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

Added in v3.0.0

traverseReadonlyArrayWithIndexSeq

Equivalent to ReadonlyArray#traverseWithIndex(ApplicativeSeq).

Signature

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

Added in v3.0.0

traverseReadonlyNonEmptyArrayWithIndex

Equivalent to ReadonlyNonEmptyArray#traverseWithIndex(ApplicativePar).

Signature

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

Added in v3.0.0

traverseReadonlyNonEmptyArrayWithIndexSeq

Equivalent to ReadonlyNonEmptyArray#traverseWithIndex(ApplicativeSeq).

Signature

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

Added in v3.0.0

tupled

Signature

export declare const tupled: <R, E, A>(fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, readonly [A]>

Added in v3.0.0