ReaderTaskEither overview

Added in v2.0.0


Table of contents


ReaderTaskEither (interface)

Signature

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

Added in v2.0.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.0.0

URI

Signature

export const URI: "ReaderTaskEither" = ...

Added in v2.0.0

alt

Signature

<R, E, A>(that: () => ReaderTaskEither<R, E, A>) => (fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v2.0.0

ap

Signature

<R, E, A>(fa: ReaderTaskEither<R, E, A>) => <B>(fab: ReaderTaskEither<R, E, (a: A) => B>) => ReaderTaskEither<R, E, B>

Added in v2.0.0

apFirst

Signature

<R, E, B>(fb: ReaderTaskEither<R, E, B>) => <A>(fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v2.0.0

apSecond

Signature

<R, E, B>(fb: ReaderTaskEither<R, E, B>) => <A>(fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v2.0.0

ask

Signature

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

Added in v2.0.0

asks

Signature

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

Added in v2.0.0

bimap

Signature

<E, G, A, B>(f: (e: E) => G, g: (a: A) => B) => <R>(fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, G, B>

Added in v2.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 function bracket<R, E, A, B>(
  aquire: ReaderTaskEither<R, E, A>,
  use: (a: A) => ReaderTaskEither<R, E, B>,
  release: (a: A, e: Either<E, B>) => ReaderTaskEither<R, E, void>
): ReaderTaskEither<R, E, B> { ... }

Added in v2.0.4

chain

Signature

<R, E, A, B>(f: (a: A) => ReaderTaskEither<R, E, B>) => (ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v2.0.0

chainEitherK

Signature

export function chainEitherK<E, A, B>(
  f: (a: A) => Either<E, B>
): <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B> { ... }

Added in v2.4.0

chainFirst

Signature

<R, E, A, B>(f: (a: A) => ReaderTaskEither<R, E, B>) => (ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>

Added in v2.0.0

chainIOEitherK

Signature

export function chainIOEitherK<E, A, B>(
  f: (a: A) => IOEither<E, B>
): <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B> { ... }

Added in v2.4.0

chainTaskEitherK

Signature

export function chainTaskEitherK<E, A, B>(
  f: (a: A) => TaskEither<E, B>
): <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B> { ... }

Added in v2.4.0

filterOrElse

Signature

{ <E, A, B>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>; <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>; }

Added in v2.0.0

flatten

Signature

<R, E, A>(mma: ReaderTaskEither<R, E, ReaderTaskEither<R, E, A>>) => ReaderTaskEither<R, E, A>

Added in v2.0.0

fold

Signature

export function fold<R, E, A, B>(
  onLeft: (e: E) => ReaderTask<R, B>,
  onRight: (a: A) => ReaderTask<R, B>
): (ma: ReaderTaskEither<R, E, A>) => ReaderTask<R, B> { ... }

Added in v2.0.0

fromEither

Signature

<R, E, A>(ma: Either<E, A>) => ReaderTaskEither<R, E, A>

Added in v2.0.0

fromEitherK

Signature

export function fromEitherK<E, A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => Either<E, B>
): <R>(...a: A) => ReaderTaskEither<R, E, B> { ... }

Added in v2.4.0

fromIOEither

Signature

export function fromIOEither<R, E, A>(ma: IOEither<E, A>): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

fromIOEitherK

Signature

export function fromIOEitherK<E, A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => IOEither<E, B>
): <R>(...a: A) => ReaderTaskEither<R, E, B> { ... }

Added in v2.4.0

fromOption

Signature

<E>(onNone: () => E) => <R, A>(ma: Option<A>) => ReaderTaskEither<R, E, A>

Added in v2.0.0

fromPredicate

Signature

{ <E, A, B>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <U>(a: A) => ReaderTaskEither<U, E, B>; <E, A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(a: A) => ReaderTaskEither<R, E, A>; }

Added in v2.0.0

fromReaderEither

Signature

export function fromReaderEither<R, E, A>(ma: ReaderEither<R, E, A>): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

fromTaskEither

Signature

export const fromTaskEither: <R, E, A>(ma: TaskEither<E, A>) => ReaderTaskEither<R, E, A> = ...

Added in v2.0.0

fromTaskEitherK

Signature

export function fromTaskEitherK<E, A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => TaskEither<E, B>
): <R>(...a: A) => ReaderTaskEither<R, E, B> { ... }

Added in v2.4.0

getApplyMonoid

Signature

export function getApplyMonoid<R, E, A>(M: Monoid<A>): Monoid<ReaderTaskEither<R, E, A>> { ... }

Added in v2.0.0

getApplySemigroup

Signature

export function getApplySemigroup<R, E, A>(S: Semigroup<A>): Semigroup<ReaderTaskEither<R, E, A>> { ... }

Added in v2.0.0

getOrElse

Signature

export function getOrElse<R, E, A>(
  onLeft: (e: E) => ReaderTask<R, A>
): (ma: ReaderTaskEither<R, E, A>) => ReaderTask<R, A> { ... }

Added in v2.0.0

getReaderTaskValidation

Signature

export function getReaderTaskValidation<E>(
  S: Semigroup<E>
): Monad3C<URI, E> & Bifunctor3<URI> & Alt3C<URI, E> & MonadTask3C<URI, E> & MonadThrow3C<URI, E> { ... }

Added in v2.3.0

getSemigroup

Signature

export function getSemigroup<R, E, A>(S: Semigroup<A>): Semigroup<ReaderTaskEither<R, E, A>> { ... }

Added in v2.0.0

left

Signature

export function left<R, E = never, A = never>(e: E): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

leftIO

Signature

export function leftIO<R, E = never, A = never>(me: IO<E>): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

leftReader

Signature

export function leftReader<R, E = never, A = never>(me: Reader<R, E>): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

leftReaderTask

Signature

export function leftReaderTask<R, E = never, A = never>(me: ReaderTask<R, E>): ReaderTaskEither<R, E, A> { ... }

Added in v2.5.0

leftTask

Signature

export function leftTask<R, E = never, A = never>(me: Task<E>): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

local

Signature

export function local<Q, R>(f: (f: Q) => R): <E, A>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<Q, E, A> { ... }

Added in v2.0.0

map

Signature

<A, B>(f: (a: A) => B) => <R, E>(fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>

Added in v2.0.0

mapLeft

Signature

<E, G>(f: (e: E) => G) => <R, A>(fa: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, G, A>

Added in v2.0.0

orElse

Signature

export function orElse<R, E, A, M>(
  onLeft: (e: E) => ReaderTaskEither<R, M, A>
): (ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, M, A> { ... }

Added in v2.0.0

readerTaskEither

Signature

export const readerTaskEither: Monad3<URI> & Bifunctor3<URI> & Alt3<URI> & MonadTask3<URI> & MonadThrow3<URI> = ...

Added in v2.0.0

readerTaskEitherSeq

Like readerTaskEither but ap is sequential

Signature

export const readerTaskEitherSeq: typeof readerTaskEither = ...

Added in v2.0.0

right

Signature

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

Added in v2.0.0

rightIO

Signature

export function rightIO<R, E = never, A = never>(ma: IO<A>): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

rightReader

Signature

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

Added in v2.0.0

rightReaderTask

Signature

export function rightReaderTask<R, E = never, A = never>(ma: ReaderTask<R, A>): ReaderTaskEither<R, E, A> { ... }

Added in v2.5.0

rightTask

Signature

export function rightTask<R, E = never, A = never>(ma: Task<A>): ReaderTaskEither<R, E, A> { ... }

Added in v2.0.0

run

Signature

export function run<R, E, A>(ma: ReaderTaskEither<R, E, A>, r: R): Promise<Either<E, A>> { ... }

Added in v2.0.0

swap

Signature

export function swap<R, E, A>(ma: ReaderTaskEither<R, E, A>): ReaderTaskEither<R, A, E> { ... }

Added in v2.0.0