ReaderTask overview

Added in v2.3.0


Table of contents


ReaderTask (interface)

Signature

export interface ReaderTask<R, A> {
  (r: R): Task<A>
}

Added in v2.3.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.3.0

URI

Signature

export const URI: "ReaderTask" = ...

Added in v2.3.0

ap

Signature

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

Added in v2.3.0

apFirst

Signature

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

Added in v2.3.0

apSecond

Signature

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

Added in v2.3.0

ask

Signature

export const ask: <R>() => ReaderTask<R, R> = ...

Added in v2.3.0

asks

Signature

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

Added in v2.3.0

chain

Signature

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

Added in v2.3.0

chainFirst

Signature

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

Added in v2.3.0

chainIOK

Signature

export function chainIOK<A, B>(f: (a: A) => IO<B>): <R>(ma: ReaderTask<R, A>) => ReaderTask<R, B> { ... }

Added in v2.4.0

chainTaskK

Signature

export function chainTaskK<A, B>(f: (a: A) => Task<B>): <R>(ma: ReaderTask<R, A>) => ReaderTask<R, B> { ... }

Added in v2.4.0

flatten

Signature

<E, A>(mma: ReaderTask<E, ReaderTask<E, A>>) => ReaderTask<E, A>

Added in v2.3.0

fromIO

Signature

export function fromIO<R, A>(ma: IO<A>): ReaderTask<R, A> { ... }

Added in v2.3.0

fromIOK

Signature

export function fromIOK<A extends ReadonlyArray<unknown>, B>(f: (...a: A) => IO<B>): <R>(...a: A) => ReaderTask<R, B> { ... }

Added in v2.4.0

fromReader

Signature

export const fromReader: <R, A = never>(ma: Reader<R, A>) => ReaderTask<R, A> = ...

Added in v2.3.0

fromTask

Signature

export const fromTask: <R, A>(ma: Task<A>) => ReaderTask<R, A> = ...

Added in v2.3.0

fromTaskK

Signature

export function fromTaskK<A extends ReadonlyArray<unknown>, B>(
  f: (...a: A) => Task<B>
): <R>(...a: A) => ReaderTask<R, B> { ... }

Added in v2.4.0

getMonoid

Signature

export function getMonoid<R, A>(M: Monoid<A>): Monoid<ReaderTask<R, A>> { ... }

Added in v2.3.0

getSemigroup

Signature

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

Added in v2.3.0

local

Signature

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

Added in v2.3.0

map

Signature

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

Added in v2.3.0

of

Signature

export const of: <R, A>(a: A) => ReaderTask<R, A> = ...

Added in v2.3.0

readerTask

Signature

export const readerTask: Monad2<URI> & MonadTask2<URI> = ...

Added in v2.3.0

readerTaskSeq

Like readerTask but ap is sequential

Signature

export const readerTaskSeq: typeof readerTask = ...

Added in v2.3.0

run

Signature

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

Added in v2.4.0