ReaderTask overview

Added in v2.3.0


Table of contents


Applicative

of

Signature

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

Added in v2.3.0

Apply

ap

Apply a function to an argument under a type constructor.

Signature

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

Added in v2.3.0

apFirst

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

Signature

export declare const apFirst: <R, B>(fb: ReaderTask<R, B>) => <A>(fa: ReaderTask<R, A>) => ReaderTask<R, A>

Added in v2.3.0

apSecond

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

Signature

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

Added in v2.3.0

Functor

map

Signature

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

Added in v2.3.0

Monad

chain

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

Signature

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

Added in v2.3.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: <A, R, B>(f: (a: A) => ReaderTask<R, B>) => (ma: ReaderTask<R, A>) => ReaderTask<R, A>

Added in v2.3.0

chainW

Less strict version of chain.

Signature

export declare const chainW: <R, A, B>(
  f: (a: A) => ReaderTask<R, B>
) => <Q>(ma: ReaderTask<Q, A>) => ReaderTask<Q & R, B>

Added in v2.6.7

flatten

Signature

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

Added in v2.3.0

combinators

chainIOK

Signature

export declare const chainIOK: <A, B>(f: (a: A) => IO<B>) => <R>(ma: ReaderTask<R, A>) => ReaderTask<R, B>

Added in v2.4.0

chainTaskK

Signature

export declare const chainTaskK: <A, B>(f: (a: A) => T.Task<B>) => <R>(ma: ReaderTask<R, A>) => ReaderTask<R, B>

Added in v2.4.0

fromIOK

Signature

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

Added in v2.4.0

fromTaskK

Signature

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

Added in v2.4.0

local

Signature

export declare const local: <Q, R>(f: (f: Q) => R) => <A>(ma: ReaderTask<R, A>) => ReaderTask<Q, A>

Added in v2.3.0

constructors

ask

Signature

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

Added in v2.3.0

asks

Signature

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

Added in v2.3.0

fromIO

Signature

export declare const fromIO: <R, A>(ma: IO<A>) => ReaderTask<R, A>

Added in v2.3.0

fromReader

Signature

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

Added in v2.3.0

fromTask

Signature

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

Added in v2.3.0

instances

URI

Signature

export declare const URI: 'ReaderTask'

Added in v2.3.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.3.0

applicativeReaderTaskPar

Signature

export declare const applicativeReaderTaskPar: Applicative2<'ReaderTask'>

Added in v2.7.0

applicativeReaderTaskSeq

Signature

export declare const applicativeReaderTaskSeq: Applicative2<'ReaderTask'>

Added in v2.7.0

functorReaderTask

Signature

export declare const functorReaderTask: Functor2<'ReaderTask'>

Added in v2.7.0

getMonoid

Signature

export declare function getMonoid<R, A>(M: Monoid<A>): Monoid<ReaderTask<R, A>>

Added in v2.3.0

getSemigroup

Signature

export declare function getSemigroup<R, A>(S: Semigroup<A>): Semigroup<ReaderTask<R, A>>

Added in v2.3.0

readerTask

Signature

export declare const readerTask: MonadTask2<'ReaderTask'>

Added in v2.3.0

readerTaskSeq

Like readerTask but ap is sequential

Signature

export declare const readerTaskSeq: MonadTask2<'ReaderTask'>

Added in v2.3.0

model

ReaderTask (interface)

Signature

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

Added in v2.3.0

utils

run

Signature

export declare function run<R, A>(ma: ReaderTask<R, A>, r: R): Promise<A>

Added in v2.4.0