Skip to main content

TaskThese

Instances

Constructors

Conversions

Error handling

Lifting

Mapping

Model

Pattern matching

Traversing

Type lambdas

Utilities

Instances

Bifunctor

Signature

export declare const Bifunctor: Bifunctor2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

FromEither

Signature

export declare const FromEither: FromEither2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

FromIO

Signature

export declare const FromIO: FromIO2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

FromTask

Signature

export declare const FromTask: FromTask2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

FromThese

Signature

export declare const FromThese: FromThese2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Functor

Signature

export declare const Functor: Functor2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Pointed

Signature

export declare const Pointed: Pointed2<URI>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

getApplicative

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

getApply

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

getChain

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

getMonad

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Constructors

both

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

left

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

leftIO

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

leftTask

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

of

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

rightIO

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

rightTask

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Conversions

fromEither

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromIO

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromIOEither

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromOption

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromTask

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromThese

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Error handling

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Lifting

fromIOK

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromOptionK

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromPredicate

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromTaskK

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

fromTheseK

Signature

export declare const fromTheseK: <A extends ReadonlyArray<unknown>, E, B>(
f: (...a: A) => TH.These<E, B>,
) => (...a: A) => TaskThese<E, B>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Mapping

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

flap

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Model

TaskThese

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Pattern matching

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

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>) => Task<B>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

matchE

The E suffix (short for Effect) means that the handlers return an effect (Task).

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

matchEW

Less strict version of matchE.

The W suffix (short for Widening) means that the handler return types will be merged.

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

matchW

Less strict version of match.

The W suffix (short for Widening) means that the handler return types will be merged.

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>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Traversing

traverseReadonlyArrayWithIndex

Equivalent to ReadonlyArray#traverseWithIndex(getApplicative(T.ApplicativePar, S)).

Signature

export declare const traverseReadonlyArrayWithIndex: <E>(
S: Semigroup<E>,
) => <A, B>(f: (index: number, a: A) => TaskThese<E, B>) => (as: readonly A[]) => TaskThese<E, readonly B[]>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

traverseReadonlyArrayWithIndexSeq

Equivalent to ReadonlyArray#traverseWithIndex(getApplicative(T.ApplicativeSeq, S)).

Signature

export declare const traverseReadonlyArrayWithIndexSeq: <E>(
S: Semigroup<E>,
) => <A, B>(f: (index: number, a: A) => TaskThese<E, B>) => (as: readonly A[]) => TaskThese<E, readonly B[]>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

traverseReadonlyNonEmptyArrayWithIndex

Equivalent to ReadonlyNonEmptyArray#traverseWithIndex(getApplicative(T.ApplicativePar, S)).

Signature

export declare const traverseReadonlyNonEmptyArrayWithIndex: <E>(
S: Semigroup<E>,
) => <A, B>(
f: (index: number, a: A) => TaskThese<E, B>,
) => (as: ReadonlyNonEmptyArray<A>) => TaskThese<E, ReadonlyNonEmptyArray<B>>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

traverseReadonlyNonEmptyArrayWithIndexSeq

Equivalent to ReadonlyNonEmptyArray#traverseWithIndex(getApplicative(T.ApplicativeSeq, S)).

Signature

export declare const traverseReadonlyNonEmptyArrayWithIndexSeq: <E>(
S: Semigroup<E>,
) => <A, B>(
f: (index: number, a: A) => TaskThese<E, B>,
) => (as: ReadonlyNonEmptyArray<A>) => TaskThese<E, ReadonlyNonEmptyArray<B>>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Type lambdas

URI

Signature

export type URI = typeof URI

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

URI

Signature

export declare const URI = 'TaskThese'

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

Utilities

ApT

Signature

export declare const ApT: TaskThese<never, readonly []>

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

bifunctorTaskThese

Use Bifunctor instead.

Signature

export declare const bifunctorTaskThese: Bifunctor2<URI>

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

functorTaskThese

Use Functor instead.

Signature

export declare const functorTaskThese: Functor2<URI>

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

getSemigroup

Use getApplySemigroup instead.

Signature

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

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

swap

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti

taskThese

This instance is deprecated, use small, specific instances instead. For example if a function needs a Functor instance, pass TT.Functor instead of TT.taskThese (where TT is from import TT from 'fp-ts/TaskThese')

Signature

export declare const taskThese: Functor2<URI> & Bifunctor2<URI>

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

toTuple

Use toTuple2 instead.

Signature

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

Details

  • Added in 0.1.0
  • Deprecated

License

  • MIT – Copyright (c) 2017-present Giulio Canti

toTuple2

Signature

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

Details

  • Added in 0.1.0

License

  • MIT – Copyright (c) 2017-present Giulio Canti