/** * A Computation is a way to chain consecutive operations while collecting logs. It's * useful for guarding against unwanted input conditions, and is used in this libary for * matrix decomposition. * * @since 1.0.0 */ import * as Apl from 'fp-ts/Applicative'; import * as Ap from 'fp-ts/Apply'; import * as BiFun from 'fp-ts/Bifunctor'; import * as Chn from 'fp-ts/Chain'; import * as E from 'fp-ts/Either'; import * as IO from 'fp-ts/IO'; import * as FE from 'fp-ts/FromEither'; import * as Fun from 'fp-ts/Functor'; import * as Mon from 'fp-ts/Monad'; import * as MonThrow from 'fp-ts/MonadThrow'; import * as O from 'fp-ts/Option'; /** * @since 1.0.0 * @category Model */ export declare type Computation = readonly [E.Either, ReadonlyArray]; /** * @since 1.0.0 * @category Constructors */ export declare const of: (value: A) => Computation; /** * @since 1.1.0 * @category Destructors */ export declare const runComputation: (c: Computation) => E.Either; /** * @since 1.1.0 * @category Destructors */ export declare const runLogs: (f: (e: E) => IO.IO) => (c: Computation) => IO.IO>; /** * @since 1.1.0 * @category Destructors */ export declare const getOrThrow: (onError: (e: E) => string) => (c: Computation) => A; /** * @since 1.1.0 * @category Destructors */ export declare const getOrThrowS: (c: Computation) => A; /** * @since 1.0.0 * @category Instances */ export declare const URI = "Computation"; /** * @since 1.0.0 * @category Instances */ export declare type URI = typeof URI; declare module 'fp-ts/HKT' { interface URItoKind2 { readonly [URI]: Computation; } } /** * @since 1.0.0 * @category Instance Operations */ export declare const map: (f: (a: A) => B) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Instances */ export declare const Functor: Fun.Functor2; /** * @since 1.0.0 * @category Instance Operations */ export declare const bimap: (f: (e: E) => G, g: (a: A) => B) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Instance Operations */ export declare const mapLeft: (f: (e: E) => G) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Instances */ export declare const Bifunctor: BiFun.Bifunctor2; /** * @since 1.0.0 * @category Instance Operations */ export declare const ap: (fab: Computation B>) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Instance Operations */ export declare const Apply: Ap.Apply2; /** * @since 1.0.0 * @category Instances */ export declare const Applicative: Apl.Applicative2; /** * @since 1.0.0 * @category Instance Operations */ export declare const chainW: (f: (a: A) => Computation) => ([fa, logs]: Computation) => Computation; /** * @since 1.0.0 * @category Instance Operations */ export declare const chain: (f: (a: A) => Computation) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Instances */ export declare const Chain: Chn.Chain2; /** * @since 1.0.0 * @category Instances */ export declare const Monad: Mon.Monad2; /** * @since 1.0.0 * @category Instance Operations */ export declare const throwError: (e: E) => Computation; /** * @since 1.0.0 * @category Instances */ export declare const MonadThrow: MonThrow.MonadThrow2; /** * @since 1.0.0 * @category Instance Operations */ export declare const fromEither: FE.FromEither2['fromEither']; /** * @since 1.0.0 * @category Instances */ export declare const FromEither: FE.FromEither2; /** * @since 1.0.0 * @category Natural Transformations */ export declare const fromOption: (onNone: import("fp-ts/function").Lazy) => import("fp-ts/lib/NaturalTransformation").NaturalTransformation12C<"Option", "Computation", E>; /** * @since 1.1.0 * @category Natural Transformations */ export declare const toOption: (c: Computation) => O.Option; /** * @since 1.1.0 * @category Natural Transformations */ export declare const fromPredicate: { (refinement: import("fp-ts/lib/Refinement").Refinement, onFalse: (a: A) => E): (a: A) => Computation; (predicate: import("fp-ts/lib/Predicate").Predicate, onFalse: (a: A_1) => E_1): (b: B_1) => Computation; (predicate: import("fp-ts/lib/Predicate").Predicate, onFalse: (a: A_2) => E_2): (a: A_2) => Computation; }; /** * @since 1.0.0 * @category Refinements */ export declare const isLeft: (e: Computation) => e is readonly [E.Left, readonly E[]]; /** * @since 1.0.0 * @category Refinements */ export declare const isRight: (e: Computation) => e is readonly [E.Right, readonly E[]]; /** * @since 1.0.0 * @category Combinators */ export declare const apFirst: (second: Computation) => (first: Computation) => Computation; /** * @since 1.0.0 * @category Combinators */ export declare const apSecond: (second: Computation) => (first: Computation) => Computation; /** * @since 1.0.0 * @category Combinators */ export declare const chainFirst: (f: (a: A) => Computation) => (first: Computation) => Computation; /** * @since 1.0.0 * @category Combinators */ export declare const chainOptionK: (onNone: import("fp-ts/function").Lazy) => (f: (a: A) => O.Option) => (ma: Computation) => Computation; /** * @since 1.0.0 * @category Combinators */ export declare const chainEitherK: (f: (a: A) => E.Either) => (ma: Computation) => Computation; /** * @since 1.0.0 * @category Utilities */ export declare const tell: (message: E) => Computation; /** * @since 1.0.0 * @category Utilities */ export declare const log: (message: E) => (fa: Computation) => Computation; /** * Log one message on left, and a different on right * * @since 1.1.0 * @category Utilities */ export declare const bilog: (onLeft: () => E, onRight: () => E) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Utilities */ export declare const logOption: (getOptionalMesasge: (a: A) => O.Option) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Utilities */ export declare const filter: (predicate: (a: A) => boolean, onFalse: (a: A) => E) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Utilities */ export declare const filterOptionK: (test: (a: A) => O.Option, onFalse: (a: A) => E) => (a: A) => Computation; /** * @since 1.0.0 * @category Do Notation */ export declare const Do: Computation; /** * @since 1.0.0 * @category Do Notation */ export declare const apS: (name: Exclude, fb: Computation) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Do Notation */ export declare const bindTo: (name: N) => (fa: Computation) => Computation; /** * @since 1.0.0 * @category Do Notation */ export declare const bind: (name: Exclude, f: (a: A) => Computation) => (ma: Computation) => Computation; /** * @since 1.0.0 * @category Do Notation */ export declare const bindW: (name: Exclude, f: (a: A) => Computation) => (fa: Computation) => Computation; //# sourceMappingURL=Computation.d.ts.map