import type * as Tp from "../Collections/Immutable/Tuple/index.js"; import type { Either } from "../Either/core.js"; import type { _A, _E, _R, HasUnify } from "../Utils/index.js"; import * as X from "../XPure/index.js"; export interface Sync extends X.XPure, HasUnify { } export interface UIO extends Sync { } export interface RIO extends Sync { } export interface IO extends Sync { } /** * Extends this computation with another computation that depends on the * result of this computation by running the first computation, using its * result to generate a second computation, and running that computation. * * @ets_data_first chain_ */ export declare const chain: (f: (a: A) => Sync) => (self: Sync) => Sync; /** * Extends this computation with another computation that depends on the * result of this computation by running the first computation, using its * result to generate a second computation, and running that computation. */ export declare const chain_: (self: Sync, f: (a: A) => Sync) => Sync; /** * Returns a computation that effectfully "peeks" at the success of this one. * * @ets_data_first tap_ */ export declare const tap: (f: (a: A) => Sync) => (self: Sync) => Sync; /** * Returns a computation that effectfully "peeks" at the success of this one. */ export declare const tap_: (self: Sync, f: (a: A) => Sync) => Sync; /** * Constructs a computation that always succeeds with the specified value, * passing the state through unchanged. */ export declare const succeed: (a: A) => Sync; /** * Constructs a computation that always succeeds with the specified value, * passing the state through unchanged. */ export declare const fail: (a: E) => Sync; /** * Extends this computation with another computation that depends on the * result of this computation by running the first computation, using its * result to generate a second computation, and running that computation. */ export declare const map_: (self: Sync, f: (a: A) => B) => Sync; /** * Extends this computation with another computation that depends on the * result of this computation by running the first computation, using its * result to generate a second computation, and running that computation. * * @ets_data_first map_ */ export declare const map: (f: (a: A) => B) => (self: Sync) => Sync; /** * Recovers from errors by accepting one computation to execute for the case * of an error, and one computation to execute for the case of success. */ export declare const foldM_: (self: Sync, failure: (e: E) => Sync, success: (a: A) => Sync) => Sync; /** * Recovers from errors by accepting one computation to execute for the case * of an error, and one computation to execute for the case of success. * * @ets_data_first foldM_ */ export declare const foldM: (failure: (e: E) => Sync, success: (a: A) => Sync) => (self: Sync) => Sync; /** * Folds over the failed or successful results of this computation to yield * a computation that does not fail, but succeeds with the value of the left * or righr function passed to `fold`. * * @ets_data_first fold_ */ export declare const fold: (failure: (e: E) => B, success: (a: A) => C) => (self: Sync) => Sync; /** * Folds over the failed or successful results of this computation to yield * a computation that does not fail, but succeeds with the value of the left * or righr function passed to `fold`. */ export declare const fold_: (self: Sync, failure: (e: E) => B, success: (a: A) => C) => Sync; /** * Recovers from all errors. * * @ets_data_first catchAll_ */ export declare const catchAll: (failure: (e: E) => Sync) => (self: Sync) => Sync; /** * Recovers from all errors. */ export declare const catchAll_: (self: Sync, failure: (e: E) => Sync) => Sync; /** * Returns a computation whose error and success channels have been mapped * by the specified functions, `f` and `g`. * * @ets_data_first bimap_ */ export declare const bimap: (f: (e: E) => E1, g: (a: A) => A1) => (self: Sync) => Sync; /** * Returns a computation whose error and success channels have been mapped * by the specified functions, `f` and `g`. */ export declare const bimap_: (self: Sync, f: (e: E) => E1, g: (a: A) => A1) => Sync; /** * Transforms the error type of this computation with the specified * function. * * @ets_data_first mapError_ */ export declare const mapError: (f: (e: E) => E1) => (self: Sync) => Sync; /** * Transforms the error type of this computation with the specified * function. */ export declare const mapError_: (self: Sync, f: (e: E) => E1) => Sync; /** * Constructs a computation that always returns the `Unit` value, passing the * state through unchanged. */ export declare const unit: Sync; /** * Transforms the initial state of this computation` with the specified * function. */ export declare const provideSome: (f: (s: R0) => R1) => (self: Sync) => Sync; /** * Provides some of the environment required to run this effect, * leaving the remainder `R0` and combining it automatically using spread. */ export declare const provide: (r: R) => (next: Sync) => Sync; /** * Provides this computation with its required environment. * * @ets_data_first provideAll_ */ export declare const provideAll: (r: R) => (self: Sync) => Sync; /** * Provides this computation with its required environment. */ export declare const provideAll_: (self: Sync, r: R) => Sync; /** * Access the environment monadically */ export declare const accessM: (f: (_: R) => Sync) => Sync; /** * Access the environment with the function f */ export declare const access: (f: (_: R) => A) => Sync; /** * Access the environment */ export declare const environment: () => Sync; /** * Returns a computation whose failure and success have been lifted into an * `Either`. The resulting computation cannot fail, because the failure case * has been exposed as part of the `Either` success case. */ export declare const either: (self: Sync) => Sync>; /** * Executes this computation and returns its value, if it succeeds, but * otherwise executes the specified computation. * * @ets_data_first orElseEither_ */ export declare const orElseEither: (that: () => Sync) => (self: Sync) => Sync>; /** * Executes this computation and returns its value, if it succeeds, but * otherwise executes the specified computation. */ export declare const orElseEither_: (self: Sync, that: () => Sync) => Sync>; /** * Combines this computation with the specified computation, passing the * updated state from this computation to that computation and combining the * results of both using the specified function. * * @ets_data_first zipWith_ */ export declare const zipWith: (that: Sync, f: (a: A, b: B) => C) => (self: Sync) => Sync; /** * Combines this computation with the specified computation, passing the * updated state from this computation to that computation and combining the * results of both using the specified function. */ export declare const zipWith_: (self: Sync, that: Sync, f: (a: A, b: B) => C) => Sync; /** * Combines this computation with the specified computation, passing the * updated state from this computation to that computation and combining the * results of both into a tuple. * * @ets_data_first zip_ */ export declare const zip: (that: Sync) => (self: Sync) => Sync>; /** * Combines this computation with the specified computation, passing the * updated state from this computation to that computation and combining the * results of both into a tuple. */ export declare const zip_: (self: Sync, that: Sync) => Sync>; /** * Suspend a computation, useful in recursion */ export declare const suspend: (f: () => Sync) => Sync; /** * Lift a sync (non failable) computation */ export declare const succeedWith: (f: () => A) => Sync; /** * Lift a sync (non failable) computation */ export declare const tryCatch: (onThrow: (u: unknown) => E) => (f: () => A) => Sync; /** * Runs this computation returning either an error of type E or a success of type A */ export declare const runEither: (self: Sync) => Either; /** * Runs this computation returning either an error of type E or a success of type A */ export declare const runEitherEnv: (r: R) => (self: Sync) => Either; /** * Runs this non failable computation returning a success of type A */ export declare const run: (self: Sync) => A; /** * Compact the union produced by the result of f * * @ets_optimize identity */ export declare function unionFn>(_: (...args: ARGS) => Ret): (...args: ARGS) => Sync<_R, _E, _A>; /** * Compact the union * * @ets_optimize identity */ export declare function union>(_: Ret): Sync<_R, _E, _A>; //# sourceMappingURL=core.d.ts.map