Link Search Menu Expand Document

TaskThese overview

Added in v2.4.0


Table of contents


Bifunctor

bimap

Map a pair of functions over the two type arguments of the bifunctor.

Signature

export declare const bimap: <E, G, A, B>(f: (e: E) => G, g: (a: A) => B) => (fa: TaskThese<E, A>) => TaskThese<G, B>

Added in v2.4.0

mapLeft

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

Signature

export declare const mapLeft: <E, G>(f: (e: E) => G) => <A>(fa: TaskThese<E, A>) => TaskThese<G, A>

Added in v2.4.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) => <E>(fa: TaskThese<E, A>) => TaskThese<E, B>

Added in v2.4.0

Pointed

of

Signature

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

Added in v2.7.0

combinators

flap

Derivable from Functor.

Signature

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

Added in v2.10.0

fromIOK

Signature

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

Added in v2.10.0

fromOptionK

Signature

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

Added in v2.10.0

fromTaskK

Signature

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

Added in v2.10.0

swap

Signature

export declare const swap: <E, A>(fa: TaskThese<E, A>) => TaskThese<A, E>

Added in v2.4.0

constructors

both

Signature

export declare const both: <E, A>(e: E, a: A) => TaskThese<E, A>

Added in v2.4.0

fromEither

Signature

export declare const fromEither: <E, A>(e: Either<E, A>) => TaskThese<E, A>

Added in v2.10.0

fromIO

Signature

export declare const fromIO: <E, A>(fa: IO<A>) => TaskThese<E, A>

Added in v2.7.0

fromIOEither

Signature

export declare const fromIOEither: <E, A>(fa: IOEither<E, A>) => TaskThese<E, A>

Added in v2.4.0

fromOption

Signature

export declare const fromOption: <E>(onNone: Lazy<E>) => <A>(ma: Option<A>) => TaskThese<E, A>

Added in v2.10.0

fromPredicate

Signature

export declare const fromPredicate: {
  <A, B, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (a: A) => TaskThese<E, B>
  <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): (a: A) => TaskThese<E, A>
}

Added in v2.10.0

fromTask

Signature

export declare const fromTask: <E, A>(fa: T.Task<A>) => TaskThese<E, A>

Added in v2.7.0

left

Signature

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

Added in v2.4.0

leftIO

Signature

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

Added in v2.4.0

leftTask

Signature

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

Added in v2.4.0

Signature

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

Added in v2.4.0

rightIO

Signature

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

Added in v2.4.0

rightTask

Signature

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

Added in v2.4.0

destructors

fold

Alias of matchE.

Signature

export declare const fold: <E, B, A>(
  onLeft: (e: E) => T.Task<B>,
  onRight: (a: A) => T.Task<B>,
  onBoth: (e: E, a: A) => T.Task<B>
) => (fa: TaskThese<E, A>) => T.Task<B>

Added in v2.4.0

foldW

Alias of matchEW.

Signature

export declare const foldW: <E, B, A, C, D>(
  onLeft: (e: E) => T.Task<B>,
  onRight: (a: A) => T.Task<C>,
  onBoth: (e: E, a: A) => T.Task<D>
) => (fa: TaskThese<E, A>) => T.Task<B | C | D>

Added in v2.10.0

match

Signature

export declare const match: <E, B, A>(
  onLeft: (e: E) => B,
  onRight: (a: A) => B,
  onBoth: (e: E, a: A) => B
) => (fa: TaskThese<E, A>) => T.Task<B>

Added in v2.10.0

matchE

Signature

export declare const matchE: <E, B, A>(
  onLeft: (e: E) => T.Task<B>,
  onRight: (a: A) => T.Task<B>,
  onBoth: (e: E, a: A) => T.Task<B>
) => (fa: TaskThese<E, A>) => T.Task<B>

Added in v2.10.0

matchEW

Less strict version of matchE.

Signature

export declare const matchEW: <E, B, A, C, D>(
  onLeft: (e: E) => T.Task<B>,
  onRight: (a: A) => T.Task<C>,
  onBoth: (e: E, a: A) => T.Task<D>
) => (fa: TaskThese<E, A>) => T.Task<B | C | D>

Added in v2.10.0

matchW

Less strict version of match.

Signature

export declare const matchW: <E, B, A, C, D>(
  onLeft: (e: E) => B,
  onRight: (a: A) => C,
  onBoth: (e: E, a: A) => D
) => (ma: TaskThese<E, A>) => T.Task<B | C | D>

Added in v2.10.0

instances

Bifunctor

Signature

export declare const Bifunctor: Bifunctor2<'TaskThese'>

Added in v2.10.0

FromEither

Signature

export declare const FromEither: FromEither2<'TaskThese'>

Added in v2.10.0

FromIO

Signature

export declare const FromIO: FromIO2<'TaskThese'>

Added in v2.10.0

FromTask

Signature

export declare const FromTask: FromTask2<'TaskThese'>

Added in v2.10.0

Functor

Signature

export declare const Functor: Functor2<'TaskThese'>

Added in v2.10.0

Pointed

Signature

export declare const Pointed: Pointed2<'TaskThese'>

Added in v2.10.0

URI

Signature

export declare const URI: 'TaskThese'

Added in v2.4.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.4.0

getApplicative

Signature

export declare function getApplicative<E>(A: Apply1<T.URI>, S: Semigroup<E>): Applicative2C<URI, E>

Added in v2.7.0

getApply

Signature

export declare const getApply: <E>(A: Apply1<T.URI>, S: Semigroup<E>) => Apply2C<'TaskThese', E>

Added in v2.10.0

getChain

Signature

export declare function getChain<E>(S: Semigroup<E>): Chain2C<URI, E>

Added in v2.10.0

getMonad

Signature

export declare function getMonad<E>(S: Semigroup<E>): Monad2C<URI, E> & MonadTask2C<URI, E>

Added in v2.4.0

bifunctorTaskThese

Use Bifunctor instead.

Signature

export declare const bifunctorTaskThese: Bifunctor2<'TaskThese'>

Added in v2.7.0

functorTaskThese

Use Functor instead.

Signature

export declare const functorTaskThese: Functor2<'TaskThese'>

Added in v2.7.0

getSemigroup

Use getApplySemigroup instead.

Signature

export declare const getSemigroup: <E, A>(SE: Semigroup<E>, SA: Semigroup<A>) => Semigroup<TaskThese<E, A>>

Added in v2.4.0

taskThese

Use small, specific instances instead.

Signature

export declare const taskThese: Functor2<'TaskThese'> & Bifunctor2<'TaskThese'>

Added in v2.4.0

model

TaskThese (interface)

Signature

export interface TaskThese<E, A> extends Task<These<E, A>> {}

Added in v2.4.0

utils

toTuple2

Signature

export declare const toTuple2: <E, A>(e: Lazy<E>, a: Lazy<A>) => (fa: TaskThese<E, A>) => T.Task<readonly [E, A]>

Added in v2.10.0

toTuple

Use toTuple2 instead.

Signature

export declare const toTuple: <E, A>(e: E, a: A) => (fa: TaskThese<E, A>) => T.Task<[E, A]>

Added in v2.4.0