import * as O from "../../../Option"; import * as Sy from "../../../Sync"; import type { FiberId } from "../../Fiber/FiberId"; import type { Cause } from "./model"; /** * @internal */ export declare const findSafe_: ( cause: Cause, f: (cause: Cause) => O.Option ) => Sy.Sync>; /** * ```haskell * find :: (Cause c, Option m) => (c e -> m a) -> c e -> m a * ``` * * Finds the first result matching f * * @category Combinators * @since 1.0.0 */ export declare const find: (f: (cause: Cause) => O.Option) => (cause: Cause) => O.Option; /** * @internal */ export declare const foldSafe_: ( cause: Cause, onEmpty: () => A, onFail: (reason: E) => A, onDie: (reason: unknown) => A, onInterrupt: (id: FiberId) => A, onThen: (l: A, r: A) => A, onBoth: (l: A, r: A) => A ) => Sy.IO; /** * ```haskell * fold :: ( * (() -> a), * (e -> a), * (_ -> a), * (FiberId -> a), * ((a, a) -> a), * ((a, a) -> a) * ) -> Cause e -> a * ``` * * Folds over a cause * * @category Destructors * @since 1.0.0 */ export declare const fold: ( onEmpty: () => A, onFail: (reason: E) => A, onDie: (reason: unknown) => A, onInterrupt: (id: FiberId) => A, onThen: (l: A, r: A) => A, onBoth: (l: A, r: A) => A ) => (cause: Cause) => A; /** * @internal */ export declare const foldlSafe_: (cause: Cause, b: B, f: (b: B, cause: Cause) => O.Option) => Sy.IO; /** * ```haskell * foldl_ :: (Cause c) => (c e, a, ((a, c e) -> Option a)) -> a * ``` * * Accumulates a state over a Cause * * @category Destructors * @since 1.0.0 */ export declare const foldl_: (cause: Cause, a: A, f: (a: A, cause: Cause) => O.Option) => A; /** * ```haskell * foldl :: (Cause c) => (a, ((a, c e) -> Option a)) -> c e -> a * ``` * * Accumulates a state over a Cause * * @category Destructors * @since 1.0.0 */ export declare const foldl: (a: A, f: (a: A, cause: Cause) => O.Option) => (cause: Cause) => A; /** * ```haskell * interruptOption :: Cause e -> Option FiberId * ``` * * Returns the `FiberID` associated with the first `Interrupt` in this `Cause` if one * exists. */ export declare const interruptOption: (cause: Cause) => O.Option; /** * ```haskell * failureOption :: Cause e -> Option e * ``` * * Returns the `E` associated with the first `Fail` in this `Cause` if one * exists. */ export declare const failureOption: (cause: Cause) => O.Option; /** * ```haskell * dieOption :: Cause e -> Option _ * ``` * * Returns the `Error` associated with the first `Die` in this `Cause` if * one exists. */ export declare const dieOption: (cause: Cause) => O.Option; //# sourceMappingURL=destructors.d.ts.map