← Back

Source

task

Monad1<URI> & MonadIO1<URI> & MonadTask1<URI>

Added in v1.0.0 (instance)

taskSeq

typeof task

Added in v1.10.0 (instance)

Like task but ap is sequential

Task

constructor(readonly run: Lazy<Promise<A>>) {}

Added in v1.0.0 (data)

Task<A> represents an asynchronous computation that yields a value of type A and never fails. If you want to represent an asynchronous computation that may fail, please see TaskEither.

ap

<B>(fab: Task<(a: A) => B>): Task<B>

Added in v1.0.0 (method)

ap_

<B, C>(this: Task<(b: B) => C>, fb: Task<B>): Task<C>

Added in v1.0.0 (method)

Flipped version of ap

applyFirst

<B>(fb: Task<B>): Task<A>

Added in v1.6.0 (method)

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

applySecond

<B>(fb: Task<B>): Task<B>

Added in v1.5.0 (method)

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

chain

<B>(f: (a: A) => Task<B>): Task<B>

Added in v1.0.0 (method)

inspect

(): string

Added in v1.0.0 (method)

map

<B>(f: (a: A) => B): Task<B>

Added in v1.0.0 (method)

toString

(): string

Added in v1.0.0 (method)

delay

<A>(millis: number, a: A): Task<A>

Added in v1.7.0 (function)

fromIO

<A>(io: IO<A>): Task<A>

Added in v1.0.0 (function)

Lifts an IO action into a Task

getMonoid

<A>(M: Monoid<A>): Monoid<Task<A>>

Added in v1.0.0 (function)

getRaceMonoid

<A = never>(): Monoid<Task<A>>

Added in v1.0.0 (function)

getSemigroup

<A>(S: Semigroup<A>): Semigroup<Task<A>>

Added in v1.0.0 (function)

tryCatch

<L, A>(f: Lazy<Promise<A>>, onrejected: (reason: {}) => L): Task<Either<L, A>>

Added in v1.0.0 (function)