/** * Utility functions to accommodate `fp-ts/TaskEither`. * * @since 0.12.0 */ import type { Show } from "fp-ts/Show"; import type { TaskEither } from "fp-ts/TaskEither"; /** * Unwrap the promise from within a `TaskEither`, rejecting with the inner * value of `Left` if `Left`. * * @example * import { unsafeUnwrap } from 'fp-ts-std/TaskEither' * import * as TE from 'fp-ts/TaskEither' * * unsafeUnwrap(TE.right(5)).then((x) => { * assert.strictEqual(x, 5) * }) * * @category 3 Functions * @since 0.12.0 */ export declare const unsafeUnwrap: (x: TaskEither) => Promise; /** * Unwrap the promise from within a `TaskEither`, throwing the inner value of * `Right` if `Right`. * * @example * import { unsafeUnwrapLeft } from 'fp-ts-std/TaskEither' * import * as TE from 'fp-ts/TaskEither' * * unsafeUnwrapLeft(TE.left(5)).then((x) => { * assert.strictEqual(x, 5) * }) * * @category 3 Functions * @since 0.12.0 */ export declare const unsafeUnwrapLeft: (x: TaskEither) => Promise; /** * Unwrap the promise from within a `TaskEither`, rejecting with the inner * value of `Left` via `Show` if `Left`. * * @example * import { unsafeExpect } from 'fp-ts-std/TaskEither' * import * as TE from 'fp-ts/TaskEither' * import * as Str from 'fp-ts/string' * * assert.rejects( * unsafeExpect(Str.Show)(TE.left('foo')), * Error('Unwrapped `Left`', { cause: 'foo' }), * ) * * @category 3 Functions * @since 0.16.0 */ export declare const unsafeExpect: (S: Show) => (x: TaskEither) => Promise; /** * Unwrap the promise from within a `TaskEither`, rejecting with the inner * value of `Right` via `Show` if `Right`. * * @example * import { unsafeExpectLeft } from 'fp-ts-std/TaskEither' * import * as TE from 'fp-ts/TaskEither' * import * as Str from 'fp-ts/string' * * assert.rejects( * unsafeExpectLeft(Str.Show)(TE.right('foo')), * Error('Unwrapped `Right`', { cause: '"foo"' }), * ) * * @category 3 Functions * @since 0.16.0 */ export declare const unsafeExpectLeft: (S: Show) => (x: TaskEither) => Promise; /** * Sequence an array of fallible tasks, ignoring the results. * * @category 2 Typeclass Methods * @since 0.15.0 */ export declare const sequenceArray_: (xs: ReadonlyArray>) => TaskEither; /** * Sequentially sequence an array of fallible tasks, ignoring the results. * * @category 2 Typeclass Methods * @since 0.15.0 */ export declare const sequenceSeqArray_: (xs: ReadonlyArray>) => TaskEither; /** * Map to and sequence an array of fallible tasks, ignoring the results. * * @category 2 Typeclass Methods * @since 0.15.0 */ export declare const traverseArray_: (f: (x: A) => TaskEither) => (xs: ReadonlyArray) => TaskEither; /** * Sequentially map to and sequence an array of fallible tasks, ignoring the * results. * * @category 2 Typeclass Methods * @since 0.15.0 */ export declare const traverseSeqArray_: (f: (x: A) => TaskEither) => (xs: ReadonlyArray) => TaskEither; /** * Convenient alias for `TE.of(undefined)`. * * @example * import { flow, pipe, constant } from 'fp-ts/function' * import * as Fn from 'fp-ts-std/Function' * import * as O from 'fp-ts/Option' * import Option = O.Option * import * as TE from 'fp-ts/TaskEither' * import TaskEither = TE.TaskEither * import { pass } from 'fp-ts-std/TaskEither' * import { log } from 'fp-ts/Console' * * const mcount: Option = O.some(123) * const tryAsyncLog: (x: A) => TaskEither = flow(log, TE.fromIO) * * const logCount: TaskEither = pipe( * mcount, * O.match( * constant(pass), * tryAsyncLog, * ), * ) * * @category 2 Typeclass Methods * @since 0.17.0 */ export declare const pass: TaskEither; //# sourceMappingURL=TaskEither.d.ts.map