/** * ```ts * interface TaskEither extends Task> {} * ``` * * `TaskEither` represents an asynchronous computation that either yields a value of type `A` or fails yielding an * error of type `E`. If you want to represent an asynchronous computation that never fails, please see `Task`. * * @since 2.0.0 */ import { Alt2, Alt2C } from './Alt' import { Applicative2, Applicative2C } from './Applicative' import { Apply1, Apply2 } from './Apply' import { Bifunctor2 } from './Bifunctor' import { Chain2 } from './Chain' import { Compactable2C } from './Compactable' import * as E from './Either' import { Filterable2C } from './Filterable' import { FromEither2 } from './FromEither' import { FromIO2 } from './FromIO' import { FromTask2 } from './FromTask' import { Lazy } from './function' import { Functor2 } from './Functor' import { IO } from './IO' import { IOEither } from './IOEither' import { Monad2, Monad2C } from './Monad' import { MonadIO2 } from './MonadIO' import { MonadTask2, MonadTask2C } from './MonadTask' import { MonadThrow2, MonadThrow2C } from './MonadThrow' import { Monoid } from './Monoid' import { Option } from './Option' import { Pointed2 } from './Pointed' import { Predicate } from './Predicate' import { ReadonlyNonEmptyArray } from './ReadonlyNonEmptyArray' import { Refinement } from './Refinement' import { Semigroup } from './Semigroup' import * as T from './Task' import { TaskOption } from './TaskOption' import Either = E.Either import Task = T.Task /** * @category model * @since 2.0.0 */ export interface TaskEither extends Task> {} /** * @category constructors * @since 2.0.0 */ export declare const left: (e: E) => TaskEither /** * @category constructors * @since 2.0.0 */ export declare const right: (a: A) => TaskEither /** * @category constructors * @since 2.0.0 */ export declare const rightTask: (ma: Task) => TaskEither /** * @category constructors * @since 2.0.0 */ export declare const leftTask: (me: Task) => TaskEither /** * @category constructors * @since 2.0.0 */ export declare const rightIO: (ma: IO) => TaskEither /** * @category constructors * @since 2.0.0 */ export declare const leftIO: (me: IO) => TaskEither /** * @category conversions * @since 2.7.0 */ export declare const fromIO: (fa: IO) => TaskEither /** * @category conversions * @since 2.7.0 */ export declare const fromTask: (fa: Task) => TaskEither /** * @category conversions * @since 2.0.0 */ export declare const fromEither: (fa: Either) => TaskEither /** * @category conversions * @since 2.0.0 */ export declare const fromIOEither: (fa: IOEither) => TaskEither /** * @category conversions * @since 2.11.0 */ export declare const fromTaskOption: (onNone: Lazy) => (fa: TaskOption) => TaskEither /** * @category pattern matching * @since 2.10.0 */ export declare const match: (onLeft: (e: E) => B, onRight: (a: A) => B) => (ma: TaskEither) => Task /** * Less strict version of [`match`](#match). * * The `W` suffix (short for **W**idening) means that the handler return types will be merged. * * @category pattern matching * @since 2.10.0 */ export declare const matchW: ( onLeft: (e: E) => B, onRight: (a: A) => C ) => (ma: TaskEither) => Task /** * The `E` suffix (short for **E**ffect) means that the handlers return an effect (`Task`). * * @category pattern matching * @since 2.10.0 */ export declare const matchE: ( onLeft: (e: E) => Task, onRight: (a: A) => Task ) => (ma: TaskEither) => Task /** * Alias of [`matchE`](#matche). * * @category pattern matching * @since 2.0.0 */ export declare const fold: ( onLeft: (e: E) => T.Task, onRight: (a: A) => T.Task ) => (ma: TaskEither) => T.Task /** * Less strict version of [`matchE`](#matche). * * The `W` suffix (short for **W**idening) means that the handler return types will be merged. * * @category pattern matching * @since 2.10.0 */ export declare const matchEW: ( onLeft: (e: E) => Task, onRight: (a: A) => Task ) => (ma: TaskEither) => Task /** * Alias of [`matchEW`](#matchew). * * @category pattern matching * @since 2.10.0 */ export declare const foldW: ( onLeft: (e: E) => T.Task, onRight: (a: A) => T.Task ) => (ma: TaskEither) => T.Task /** * @category error handling * @since 2.0.0 */ export declare const getOrElse: (onLeft: (e: E) => Task) => (ma: TaskEither) => Task /** * Less strict version of [`getOrElse`](#getorelse). * * The `W` suffix (short for **W**idening) means that the handler return type will be merged. * * @category error handling * @since 2.6.0 */ export declare const getOrElseW: (onLeft: (e: E) => Task) => (ma: TaskEither) => Task /** * Transforms a `Promise` that may reject to a `Promise` that never rejects and returns an `Either` instead. * * See also [`tryCatchK`](#trycatchk). * * @example * import { left, right } from 'fp-ts/Either' * import { tryCatch } from 'fp-ts/TaskEither' * * tryCatch(() => Promise.resolve(1), String)().then(result => { * assert.deepStrictEqual(result, right(1)) * }) * tryCatch(() => Promise.reject('error'), String)().then(result => { * assert.deepStrictEqual(result, left('error')) * }) * * @category interop * @since 2.0.0 */ export declare const tryCatch: (f: Lazy>, onRejected: (reason: unknown) => E) => TaskEither /** * Converts a function returning a `Promise` to one returning a `TaskEither`. * * @category interop * @since 2.5.0 */ export declare const tryCatchK: ( f: (...a: A) => Promise, onRejected: (reason: unknown) => E ) => (...a: A) => TaskEither /** * @category conversions * @since 2.10.0 */ export declare const toUnion: (fa: TaskEither) => Task /** * @category conversions * @since 2.12.0 */ export declare const fromNullable: (e: E) => (a: A) => TaskEither> /** * @category lifting * @since 2.12.0 */ export declare const fromNullableK: ( e: E ) => , B>( f: (...a: A) => B | null | undefined ) => (...a: A) => TaskEither> /** * @category sequencing * @since 2.12.0 */ export declare const chainNullableK: ( e: E ) => (f: (a: A) => B | null | undefined) => (ma: TaskEither) => TaskEither> /** * Returns `ma` if is a `Right` or the value returned by `onLeft` otherwise. * * See also [alt](#alt). * * @example * import * as E from 'fp-ts/Either' * import { pipe } from 'fp-ts/function' * import * as TE from 'fp-ts/TaskEither' * * async function test() { * const errorHandler = TE.orElse((error: string) => TE.right(`recovering from ${error}...`)) * assert.deepStrictEqual(await pipe(TE.right('ok'), errorHandler)(), E.right('ok')) * assert.deepStrictEqual(await pipe(TE.left('ko'), errorHandler)(), E.right('recovering from ko...')) * } * * test() * * @category error handling * @since 2.0.0 */ export declare const orElse: ( onLeft: (e: E1) => TaskEither ) => (ma: TaskEither) => TaskEither /** * Less strict version of [`orElse`](#orelse). * * The `W` suffix (short for **W**idening) means that the return types will be merged. * * @category error handling * @since 2.10.0 */ export declare const orElseW: ( onLeft: (e: E1) => TaskEither ) => (ma: TaskEither) => TaskEither /** * @category error handling * @since 2.11.0 */ export declare const orElseFirst: ( onLeft: (e: E) => TaskEither ) => (ma: TaskEither) => TaskEither /** * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category error handling * @since 2.11.0 */ export declare const orElseFirstW: ( onLeft: (e: E1) => TaskEither ) => (ma: TaskEither) => TaskEither /** * @category error handling * @since 2.12.0 */ export declare const orElseFirstIOK: (onLeft: (e: E) => IO) => (ma: TaskEither) => TaskEither /** * @category error handling * @since 2.12.0 */ export declare const orElseFirstTaskK: ( onLeft: (e: E) => Task ) => (ma: TaskEither) => TaskEither /** * @category error handling * @since 2.11.0 */ export declare const orLeft: (onLeft: (e: E1) => Task) => (fa: TaskEither) => TaskEither /** * @since 2.0.0 */ export declare const swap: (ma: TaskEither) => TaskEither /** * @category lifting * @since 2.11.0 */ export declare const fromTaskOptionK: ( onNone: Lazy ) => (f: (...a: A) => TaskOption) => (...a: A) => TaskEither /** * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category sequencing * @since 2.12.3 */ export declare const chainTaskOptionKW: ( onNone: Lazy ) => (f: (a: A) => TaskOption) => (ma: TaskEither) => TaskEither /** * @category sequencing * @since 2.11.0 */ export declare const chainTaskOptionK: ( onNone: Lazy ) => (f: (a: A) => TaskOption) => (ma: TaskEither) => TaskEither /** * @category lifting * @since 2.4.0 */ export declare const fromIOEitherK: ( f: (...a: A) => IOEither ) => (...a: A) => TaskEither /** * Less strict version of [`chainIOEitherK`](#chainioeitherk). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category sequencing * @since 2.6.1 */ export declare const chainIOEitherKW: ( f: (a: A) => IOEither ) => (ma: TaskEither) => TaskEither /** * @category sequencing * @since 2.4.0 */ export declare const chainIOEitherK: ( f: (a: A) => IOEither ) => (ma: TaskEither) => TaskEither /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. * * @category mapping * @since 2.0.0 */ export declare const map: (f: (a: A) => B) => (fa: TaskEither) => TaskEither /** * Map a pair of functions over the two type arguments of the bifunctor. * * @category mapping * @since 2.0.0 */ export declare const bimap: (f: (e: E) => G, g: (a: A) => B) => (fa: TaskEither) => TaskEither /** * Map a function over the first type argument of a bifunctor. * * @category error handling * @since 2.0.0 */ export declare const mapLeft: (f: (e: E) => G) => (fa: TaskEither) => TaskEither /** * @since 2.0.0 */ export declare const ap: (fa: TaskEither) => (fab: TaskEither B>) => TaskEither /** * Less strict version of [`ap`](#ap). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @since 2.8.0 */ export declare const apW: ( fa: TaskEither ) => (fab: TaskEither B>) => TaskEither /** * Composes computations in sequence, using the return value of one computation to determine the next computation. * * @category sequencing * @since 2.0.0 */ export declare const chain: (f: (a: A) => TaskEither) => (ma: TaskEither) => TaskEither /** * Less strict version of [`chain`](#chain). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category sequencing * @since 2.6.0 */ export declare const chainW: ( f: (a: A) => TaskEither ) => (ma: TaskEither) => TaskEither /** * Less strict version of [`flatten`](#flatten). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category sequencing * @since 2.11.0 */ export declare const flattenW: (mma: TaskEither>) => TaskEither /** * @category sequencing * @since 2.0.0 */ export declare const flatten: (mma: TaskEither>) => TaskEither /** * Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to * types of kind `* -> *`. * * In case of `TaskEither` returns `fa` if is a `Right` or the value returned by `that` otherwise. * * See also [orElse](#orelse). * * @example * import * as E from 'fp-ts/Either' * import { pipe } from 'fp-ts/function' * import * as TE from 'fp-ts/TaskEither' * * async function test() { * assert.deepStrictEqual( * await pipe( * TE.right(1), * TE.alt(() => TE.right(2)) * )(), * E.right(1) * ) * assert.deepStrictEqual( * await pipe( * TE.left('a'), * TE.alt(() => TE.right(2)) * )(), * E.right(2) * ) * assert.deepStrictEqual( * await pipe( * TE.left('a'), * TE.alt(() => TE.left('b')) * )(), * E.left('b') * ) * } * * test() * * @category error handling * @since 2.0.0 */ export declare const alt: (that: Lazy>) => (fa: TaskEither) => TaskEither /** * Less strict version of [`alt`](#alt). * * The `W` suffix (short for **W**idening) means that the error and the return types will be merged. * * @category error handling * @since 2.9.0 */ export declare const altW: ( that: Lazy> ) => (fa: TaskEither) => TaskEither /** * @category constructors * @since 2.0.0 */ export declare const of: (a: A) => TaskEither /** * @since 2.7.0 */ export declare const throwError: MonadThrow2['throwError'] /** * @category type lambdas * @since 2.0.0 */ export declare const URI = 'TaskEither' /** * @category type lambdas * @since 2.0.0 */ export declare type URI = typeof URI declare module './HKT' { interface URItoKind2 { readonly [URI]: TaskEither } } /** * The default [`ApplicativePar`](#applicativepar) instance returns the first error, if you want to * get all errors you need to provide a way to concatenate them via a `Semigroup`. * * @example * import * as E from 'fp-ts/Either' * import { pipe } from 'fp-ts/function' * import * as RA from 'fp-ts/ReadonlyArray' * import * as S from 'fp-ts/Semigroup' * import * as string from 'fp-ts/string' * import * as T from 'fp-ts/Task' * import * as TE from 'fp-ts/TaskEither' * * interface User { * readonly id: string * readonly name: string * } * * const remoteDatabase: ReadonlyArray = [ * { id: 'id1', name: 'John' }, * { id: 'id2', name: 'Mary' }, * { id: 'id3', name: 'Joey' } * ] * * const fetchUser = (id: string): TE.TaskEither => * pipe( * remoteDatabase, * RA.findFirst((user) => user.id === id), * TE.fromOption(() => `${id} not found`) * ) * * async function test() { * assert.deepStrictEqual( * await pipe(['id4', 'id5'], RA.traverse(TE.ApplicativePar)(fetchUser))(), * E.left('id4 not found') // <= first error * ) * * const Applicative = TE.getApplicativeTaskValidation( * T.ApplyPar, * pipe(string.Semigroup, S.intercalate(', ')) * ) * * assert.deepStrictEqual( * await pipe(['id4', 'id5'], RA.traverse(Applicative)(fetchUser))(), * E.left('id4 not found, id5 not found') // <= all errors * ) * } * * test() * * @category error handling * @since 2.7.0 */ export declare function getApplicativeTaskValidation(A: Apply1, S: Semigroup): Applicative2C /** * The default [`Alt`](#alt) instance returns the last error, if you want to * get all errors you need to provide a way to concatenate them via a `Semigroup`. * * See [`getAltValidation`](./Either.ts.html#getaltvalidation). * * @category error handling * @since 2.7.0 */ export declare function getAltTaskValidation(S: Semigroup): Alt2C /** * @category filtering * @since 2.10.0 */ export declare const getCompactable: (M: Monoid) => Compactable2C<'TaskEither', E> /** * @category filtering * @since 2.1.0 */ export declare function getFilterable(M: Monoid): Filterable2C /** * @category instances * @since 2.7.0 */ export declare const Functor: Functor2 /** * @category mapping * @since 2.10.0 */ export declare const flap: (a: A) => (fab: TaskEither B>) => TaskEither /** * @category instances * @since 2.10.0 */ export declare const Pointed: Pointed2 /** * Runs computations in parallel. * * @category instances * @since 2.10.0 */ export declare const ApplyPar: Apply2 /** * Combine two effectful actions, keeping only the result of the first. * * @since 2.0.0 */ export declare const apFirst: (second: TaskEither) => (first: TaskEither) => TaskEither /** * Less strict version of [`apFirst`](#apfirst). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @since 2.12.0 */ export declare const apFirstW: ( second: TaskEither ) => (first: TaskEither) => TaskEither /** * Combine two effectful actions, keeping only the result of the second. * * @since 2.0.0 */ export declare const apSecond: (second: TaskEither) => (first: TaskEither) => TaskEither /** * Less strict version of [`apSecond`](#apsecond). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @since 2.12.0 */ export declare const apSecondW: ( second: TaskEither ) => (first: TaskEither) => TaskEither /** * Runs computations in parallel. * * @category instances * @since 2.7.0 */ export declare const ApplicativePar: Applicative2 /** * Runs computations sequentially. * * @category instances * @since 2.10.0 */ export declare const ApplySeq: Apply2 /** * Runs computations sequentially. * * @category instances * @since 2.7.0 */ export declare const ApplicativeSeq: Applicative2 /** * @category instances * @since 2.10.0 */ export declare const Chain: Chain2 /** * @category instances * @since 2.10.0 */ export declare const Monad: Monad2 /** * @category instances * @since 2.10.0 */ export declare const MonadIO: MonadIO2 /** * @category instances * @since 2.10.0 */ export declare const MonadTask: MonadTask2 /** * @category instances * @since 2.10.0 */ export declare const MonadThrow: MonadThrow2 /** * Composes computations in sequence, using the return value of one computation to determine the next computation and * keeping only the result of the first. * * @category sequencing * @since 2.0.0 */ export declare const chainFirst: (f: (a: A) => TaskEither) => (ma: TaskEither) => TaskEither /** * Less strict version of [`chainFirst`](#chainfirst). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category sequencing * @since 2.8.0 */ export declare const chainFirstW: ( f: (a: A) => TaskEither ) => (ma: TaskEither) => TaskEither /** * @category instances * @since 2.7.0 */ export declare const Bifunctor: Bifunctor2 /** * @category instances * @since 2.7.0 */ export declare const Alt: Alt2 /** * @category instances * @since 2.10.0 */ export declare const FromEither: FromEither2 /** * @category conversions * @since 2.0.0 */ export declare const fromOption: (onNone: Lazy) => (fa: Option) => TaskEither /** * @category lifting * @since 2.10.0 */ export declare const fromOptionK: ( onNone: Lazy ) => , B>(f: (...a: A) => Option) => (...a: A) => TaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainOptionK: ( onNone: Lazy ) => (f: (a: A) => Option) => (ma: TaskEither) => TaskEither /** * @category sequencing * @since 2.4.0 */ export declare const chainEitherK: (f: (a: A) => E.Either) => (ma: TaskEither) => TaskEither /** * Less strict version of [`chainEitherK`](#chaineitherk). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category sequencing * @since 2.6.1 */ export declare const chainEitherKW: ( f: (a: A) => Either ) => (ma: TaskEither) => TaskEither /** * @category sequencing * @since 2.12.0 */ export declare const chainFirstEitherK: ( f: (a: A) => E.Either ) => (ma: TaskEither) => TaskEither /** * Less strict version of [`chainFirstEitherK`](#chainfirsteitherk). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category sequencing * @since 2.12.0 */ export declare const chainFirstEitherKW: ( f: (a: A) => E.Either ) => (ma: TaskEither) => TaskEither /** * @category lifting * @since 2.0.0 */ export declare const fromPredicate: { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => TaskEither (predicate: Predicate, onFalse: (a: A) => E): (b: B) => TaskEither (predicate: Predicate, onFalse: (a: A) => E): (a: A) => TaskEither } /** * @category filtering * @since 2.0.0 */ export declare const filterOrElse: { (refinement: Refinement, onFalse: (a: A) => E): (ma: TaskEither) => TaskEither (predicate: Predicate, onFalse: (a: A) => E): (mb: TaskEither) => TaskEither (predicate: Predicate, onFalse: (a: A) => E): (ma: TaskEither) => TaskEither } /** * Less strict version of [`filterOrElse`](#filterorelse). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category filtering * @since 2.9.0 */ export declare const filterOrElseW: { (refinement: Refinement, onFalse: (a: A) => E2): ( ma: TaskEither ) => TaskEither (predicate: Predicate, onFalse: (a: A) => E2): ( mb: TaskEither ) => TaskEither (predicate: Predicate, onFalse: (a: A) => E2): (ma: TaskEither) => TaskEither } /** * @category lifting * @since 2.4.0 */ export declare const fromEitherK: , B>( f: (...a: A) => E.Either ) => (...a: A) => TaskEither /** * @category instances * @since 2.10.0 */ export declare const FromIO: FromIO2 /** * @category lifting * @since 2.10.0 */ export declare const fromIOK: , B>( f: (...a: A) => IO ) => (...a: A) => TaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainIOK: (f: (a: A) => IO) => (first: TaskEither) => TaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainFirstIOK: (f: (a: A) => IO) => (first: TaskEither) => TaskEither /** * @category instances * @since 2.10.0 */ export declare const FromTask: FromTask2 /** * @category lifting * @since 2.10.0 */ export declare const fromTaskK: , B>( f: (...a: A) => T.Task ) => (...a: A) => TaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainTaskK: (f: (a: A) => T.Task) => (first: TaskEither) => TaskEither /** * @category sequencing * @since 2.10.0 */ export declare const chainFirstTaskK: (f: (a: A) => T.Task) => (first: TaskEither) => TaskEither /** * Convert a node style callback function to one returning a `TaskEither` * * **Note**. If the function `f` admits multiple overloadings, `taskify` will pick last one. If you want a different * behaviour, add an explicit type annotation * * ```ts * // readFile admits multiple overloadings * * // const readFile: (a: string) => TaskEither * const readFile = taskify(fs.readFile) * * const readFile2: (filename: string, encoding: string) => TaskEither = taskify( * fs.readFile * ) * ``` * * @example * import { taskify } from 'fp-ts/TaskEither' * import * as fs from 'fs' * * // const stat: (a: string | Buffer) => TaskEither * const stat = taskify(fs.stat) * assert.strictEqual(stat.length, 0) * * @category interop * @since 2.0.0 */ export declare function taskify(f: (cb: (e: L | null | undefined, r?: R) => void) => void): () => TaskEither export declare function taskify( f: (a: A, cb: (e: L | null | undefined, r?: R) => void) => void ): (a: A) => TaskEither export declare function taskify( f: (a: A, b: B, cb: (e: L | null | undefined, r?: R) => void) => void ): (a: A, b: B) => TaskEither export declare function taskify( f: (a: A, b: B, c: C, cb: (e: L | null | undefined, r?: R) => void) => void ): (a: A, b: B, c: C) => TaskEither export declare function taskify( f: (a: A, b: B, c: C, d: D, cb: (e: L | null | undefined, r?: R) => void) => void ): (a: A, b: B, c: C, d: D) => TaskEither export declare function taskify( f: (a: A, b: B, c: C, d: D, e: E, cb: (e: L | null | undefined, r?: R) => void) => void ): (a: A, b: B, c: C, d: D, e: E) => TaskEither /** * Make sure that a resource is cleaned up in the event of an exception (\*). The release action is called regardless of * whether the body action throws (\*) or returns. * * (\*) i.e. returns a `Left` * * @since 2.0.0 */ export declare const bracket: ( acquire: TaskEither, use: (a: A) => TaskEither, release: (a: A, e: E.Either) => TaskEither ) => TaskEither /** * Less strict version of [`bracket`](#bracket). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @since 2.12.0 */ export declare const bracketW: ( acquire: TaskEither, use: (a: A) => TaskEither, release: (a: A, e: E.Either) => TaskEither ) => TaskEither /** * @category do notation * @since 2.9.0 */ export declare const Do: TaskEither /** * @category do notation * @since 2.8.0 */ export declare const bindTo: ( name: N ) => (fa: TaskEither) => TaskEither declare const let_: ( name: Exclude, f: (a: A) => B ) => (fa: TaskEither) => TaskEither export { /** * @category do notation * @since 2.13.0 */ let_ as let } /** * @category do notation * @since 2.8.0 */ export declare const bind: ( name: Exclude, f: (a: A) => TaskEither ) => (ma: TaskEither) => TaskEither /** * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category do notation * @since 2.8.0 */ export declare const bindW: ( name: Exclude, f: (a: A) => TaskEither ) => (fa: TaskEither) => TaskEither< E1 | E2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * @category do notation * @since 2.8.0 */ export declare const apS: ( name: Exclude, fb: TaskEither ) => (fa: TaskEither) => TaskEither /** * Less strict version of [`apS`](#aps). * * The `W` suffix (short for **W**idening) means that the error types will be merged. * * @category do notation * @since 2.8.0 */ export declare const apSW: ( name: Exclude, fb: TaskEither ) => (fa: TaskEither) => TaskEither< E1 | E2, { readonly [K in keyof A | N]: K extends keyof A ? A[K] : B } > /** * @since 2.11.0 */ export declare const ApT: TaskEither /** * Equivalent to `ReadonlyNonEmptyArray#traverseWithIndex(ApplicativePar)`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyNonEmptyArrayWithIndex: ( f: (index: number, a: A) => TaskEither ) => (as: ReadonlyNonEmptyArray) => TaskEither> /** * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativePar)`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyArrayWithIndex: ( f: (index: number, a: A) => TaskEither ) => (as: readonly A[]) => TaskEither /** * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativeSeq)`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyNonEmptyArrayWithIndexSeq: ( f: (index: number, a: A) => TaskEither ) => (as: ReadonlyNonEmptyArray) => TaskEither> /** * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativeSeq)`. * * @category traversing * @since 2.11.0 */ export declare const traverseReadonlyArrayWithIndexSeq: ( f: (index: number, a: A) => TaskEither ) => (as: readonly A[]) => TaskEither /** * Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`. * * @category traversing * @since 2.9.0 */ export declare const traverseArrayWithIndex: ( f: (index: number, a: A) => TaskEither ) => (as: ReadonlyArray) => TaskEither> /** * Equivalent to `ReadonlyArray#traverse(Applicative)`. * * @category traversing * @since 2.9.0 */ export declare const traverseArray: ( f: (a: A) => TaskEither ) => (as: readonly A[]) => TaskEither /** * Equivalent to `ReadonlyArray#sequence(Applicative)`. * * @category traversing * @since 2.9.0 */ export declare const sequenceArray: (arr: ReadonlyArray>) => TaskEither> /** * Equivalent to `ReadonlyArray#traverseWithIndex(ApplicativeSeq)`. * * @category traversing * @since 2.9.0 */ export declare const traverseSeqArrayWithIndex: ( f: (index: number, a: A) => TaskEither ) => (as: ReadonlyArray) => TaskEither> /** * Equivalent to `ReadonlyArray#traverse(ApplicativeSeq)`. * * @category traversing * @since 2.9.0 */ export declare const traverseSeqArray: ( f: (a: A) => TaskEither ) => (as: readonly A[]) => TaskEither /** * Equivalent to `ReadonlyArray#sequence(ApplicativeSeq)`. * * @category traversing * @since 2.9.0 */ export declare const sequenceSeqArray: (arr: ReadonlyArray>) => TaskEither> /** * This instance is deprecated, use small, specific instances instead. * For example if a function needs a `Functor` instance, pass `TE.Functor` instead of `TE.taskEither` * (where `TE` is from `import TE from 'fp-ts/TaskEither'`) * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const taskEither: Monad2 & Bifunctor2 & Alt2 & MonadTask2 & MonadThrow2 /** * This instance is deprecated, use small, specific instances instead. * For example if a function needs a `Functor` instance, pass `TE.Functor` instead of `TE.taskEitherSeq` * (where `TE` is from `import TE from 'fp-ts/TaskEither'`) * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const taskEitherSeq: typeof taskEither /** * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead. * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const getApplySemigroup: (S: Semigroup) => Semigroup> /** * Use [`getApplicativeMonoid`](./Applicative.ts.html#getapplicativemonoid) instead. * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const getApplyMonoid: (M: Monoid) => Monoid> /** * Use [`getApplySemigroup`](./Apply.ts.html#getapplysemigroup) instead. * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const getSemigroup: (S: Semigroup) => Semigroup> /** * Use [`getApplicativeTaskValidation`](#getapplicativetaskvalidation) and [`getAltTaskValidation`](#getalttaskvalidation) instead. * * @category zone of death * @since 2.0.0 * @deprecated */ export declare function getTaskValidation( SE: Semigroup ): Monad2C & Bifunctor2 & Alt2C & MonadTask2C & MonadThrow2C