import * as C from "../Cause/core.js"; import { FiberFailure } from "../Cause/errors.js"; import * as Tp from "../Collections/Immutable/Tuple/index.js"; import * as E from "../Either/index.js"; import type { FiberID } from "../Fiber/id.js"; import * as O from "../Option/index.js"; import type { Exit } from "./exit.js"; import { Failure, Success } from "./exit.js"; export { Exit, Failure, Success } from "./exit.js"; /** * Applicative's ap */ export declare function ap_(fa: Exit, fab: Exit B>): Exit; /** * Applicative's ap * * @ets_data_first ap_ */ export declare function ap(fa: Exit): (fab: Exit B>) => Exit; /** * Replaces the success value with the one provided. */ export declare function as_(exit: Exit, b: B): Exit; /** * Replaces the success value with the one provided. * * @ets_data_first as_ */ export declare function as(b: B): (exit: Exit) => Exit; /** * Maps over both the error and value type. */ export declare function bimap_(exit: Exit, f: (e: E) => E1, g: (a: A) => A1): Exit; /** * Maps over both the error and value type. * * @ets_data_first bimap_ */ export declare function bimap(f: (e: E) => E1, g: (a: A) => A1): (exit: Exit) => Exit; /** * Flat maps over the value type. */ export declare function chain_(exit: Exit, f: (a: A) => Exit): Exit; /** * Flat maps over the value type. * * @ets_data_first chain_ */ export declare function chain(f: (a: A) => Exit): (exit: Exit) => Exit; /** * Collects all the success states and merges sequentially the causes */ export declare function collectAll(...exits: readonly Exit[]): O.Option>; /** * Zips this together with the specified result using the combination functions. */ export declare function zipWith_(exit: Exit, that: Exit, f: (a: A, b: B) => C, g: (e: C.Cause, e1: C.Cause) => C.Cause): Exit; /** * Zips this together with the specified result using the combination functions. * * @ets_data_first zipWith_ */ export declare function zipWith(that: Exit, f: (a: A, b: B) => C, g: (e: C.Cause, e1: C.Cause) => C.Cause): (exit: Exit) => Exit; /** * Collects all the success states and merges the causes in parallel */ export declare function collectAllPar(...exits: readonly Exit[]): O.Option>; /** * Construct an Exit with an unchecked cause containing the specified error */ export declare function die(error: unknown): Exit; /** * Returns f(a) if the exit is successful */ export declare function exists_(exit: Exit, f: (a: A) => boolean): boolean; /** * Returns f(a) if the exit is successful * * @ets_data_first exists_ */ export declare function exists(f: (a: A) => boolean): (exit: Exit) => boolean; /** * Constructs a failed exit with the specified checked error */ export declare function fail(e: E): Exit; /** * Constructs a failed exit with the specified cause */ export declare function failCause(cause: C.Cause): Exit; /** * Flatten nested Exits */ export declare function flatten(exit: Exit>): Exit; /** * Folds over the value or cause. */ export declare function fold_(exit: Exit, failed: (e: C.Cause) => Z1, succeed: (a: A) => Z2): Z1 | Z2; /** * Folds over the value or cause. * * @ets_data_first fold_ */ export declare function fold(failed: (e: C.Cause) => Z1, succeed: (a: A) => Z2): (exit: Exit) => Z1 | Z2; /** * Embeds Either's Error & Success in an Exit */ export declare function fromEither(e: E.Either): Exit; /** * Embeds an option result into an Exit with the specified error using onNone */ export declare function fromOption(onNone: () => E): (a: O.Option) => Exit; /** * Get successful result falling back to orElse result in case of failure */ export declare function getOrElse_(exit: Exit, orElse: (_: C.Cause) => A1): A | A1; /** * Get successful result falling back to orElse result in case of failure * * @ets_data_first getOrElse_ */ export declare function getOrElse(orElse: (_: C.Cause) => A1): (exit: Exit) => A1 | A; /** * Constructs a failed exit with the specified cause */ export declare function halt(cause: C.Cause): Exit; /** * Constructs an exit with the specified interruption state */ export declare function interrupt(id: FiberID): Exit; /** * Returns if Exit contains an interruption state */ export declare function interrupted(exit: Exit): exit is Failure; /** * Maps over the value type. */ export declare function map_(exit: Exit, f: (a: A) => A1): Exit; /** * Maps over the value type. * * @ets_data_first map_ */ export declare function map(f: (a: A) => A1): (exit: Exit) => Exit; /** * Maps over the error type. */ export declare function mapError_(exit: Exit, f: (e: E) => E1): Exit; /** * Maps over the error type. * * @ets_data_first mapError_ */ export declare function mapError(f: (e: E) => E1): (exit: Exit) => Exit; /** * Maps over the cause type. */ export declare function mapErrorCause_(exit: Exit, f: (e: C.Cause) => C.Cause): Exit; /** * Maps over the cause type. * * @ets_data_first mapErrorCause_ */ export declare function mapErrorCause(f: (e: C.Cause) => C.Cause): (exit: Exit) => Exit; /** * Replaces the error value with the one provided. */ export declare function orElseFail_(exit: Exit, e: E1): Exit; /** * Replaces the error value with the one provided. * * @ets_data_first orElseFail_ */ export declare function orElseFail(e: E1): (exit: Exit) => Exit; /** * Construct a succeeded exit with the specified value */ export declare function succeed(a: A): Exit; /** * Returns if an exit is succeeded */ export declare function succeeded(exit: Exit): exit is Success; /** * Converts the `Exit` to an `Either`, by wrapping the * cause in `FiberFailure` (if the result is failed). */ export declare function toEither(exit: Exit): E.Either, A>; /** * Discards the value. */ export declare const unit: Exit; /** * Sequentially zips the this result with the specified result or else returns the failed `Cause[E1]` */ export declare function zip_(exit: Exit, that: Exit): Exit>; /** * Sequentially zips the this result with the specified result or else returns the failed `Cause[E1]` * * @ets_data_first zip_ */ export declare function zip(that: Exit): (exit: Exit) => Exit>; /** * Sequentially zips the this result with the specified result discarding the second element of the tuple or else returns the failed `Cause[E1]` */ export declare function zipLeft_(exit: Exit, that: Exit): Exit; /** * Sequentially zips the this result with the specified result discarding the second element of the tuple or else returns the failed `Cause[E1]` * * @ets_data_first zipLeft_ */ export declare function zipLeft(that: Exit): (exit: Exit) => Exit; /** * Parallelly zips the this result with the specified result or else returns the failed `Cause[E1]` */ export declare function zipPar_(exit: Exit, that: Exit): Exit>; /** * Parallelly zips the this result with the specified result or else returns the failed `Cause[E1]` * * @ets_data_first zipPar_ */ export declare function zipPar(that: Exit): (exit: Exit) => Exit>; /** * Parallelly zips the this result with the specified result discarding the second element of the tuple or else returns the failed `Cause[E1]` */ export declare function zipParLeft_(exit: Exit, that: Exit): Exit; /** * Parallelly zips the this result with the specified result discarding the second element of the tuple or else returns the failed `Cause[E1]` * * @ets_data_first zipParLeft_ */ export declare function zipParLeft(that: Exit): (exit: Exit) => Exit; /** * Parallelly zips the this result with the specified result discarding the first element of the tuple or else returns the failed `Cause[E1]` */ export declare function zipParRight_(exit: Exit, that: Exit): Exit; /** * Parallelly zips the this result with the specified result discarding the first element of the tuple or else returns the failed `Cause[E1]` * * @ets_data_first zipParRight_ */ export declare function zipParRight(that: Exit): (exit: Exit) => Exit; /** * Sequentially zips the this result with the specified result discarding the first element of the tuple or else returns the failed `Cause[E1]` */ export declare function zipRight_(exit: Exit, that: Exit): Exit; /** * Sequentially zips the this result with the specified result discarding the first element of the tuple or else returns the failed `Cause[E1]` * * @ets_data_first zipRight_ */ export declare function zipRight(that: Exit): (exit: Exit) => Exit; /** * Returns an untraced exit value. */ export declare function untraced(self: Exit): Exit; /** * Asserts an exit is a failure */ export declare function assertsFailure(exit: Exit): asserts exit is Failure; /** * Maps over both the error and value type. */ export declare function mapBoth_(self: Exit, f: (e: E) => E1, g: (a: A) => A1): Exit; /** * Maps over both the error and value type. * * @ets_data_first mapBoth_ */ export declare function mapBoth(f: (e: E) => E1, g: (a: A) => A1): (self: Exit) => Exit; //# sourceMappingURL=core.d.ts.map