/** * The `FromEither` type class represents those data types which support errors. * * @since 2.10.0 */ import { Chain, Chain1, Chain2, Chain2C, Chain3, Chain3C, Chain4 } from './Chain.js'; import { Either } from './Either.js'; import { LazyArg } from './function.js'; import { HKT2, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT.js'; import { Option } from './Option.js'; import { Predicate } from './Predicate.js'; import { Refinement } from './Refinement.js'; /** * @category model * @since 2.10.0 */ export interface FromEither { readonly URI: F; readonly fromEither: (e: Either) => HKT2; } /** * @category model * @since 2.11.0 */ export interface FromEither1 { readonly URI: F; readonly fromEither: (fa: Either) => Kind; } /** * @category model * @since 2.10.0 */ export interface FromEither2 { readonly URI: F; readonly fromEither: (fa: Either) => Kind2; } /** * @category model * @since 2.10.0 */ export interface FromEither2C { readonly URI: F; readonly _E: E; readonly fromEither: (fa: Either) => Kind2; } /** * @category model * @since 2.10.0 */ export interface FromEither3 { readonly URI: F; readonly fromEither: (fa: Either) => Kind3; } /** * @category model * @since 2.10.0 */ export interface FromEither3C { readonly URI: F; readonly _E: E; readonly fromEither: (fa: Either) => Kind3; } /** * @category model * @since 2.10.0 */ export interface FromEither4 { readonly URI: F; readonly fromEither: (fa: Either) => Kind4; } /** * @category constructors * @since 2.10.0 */ export declare function fromOption(F: FromEither4): (onNone: LazyArg) => (fa: Option) => Kind4; export declare function fromOption(F: FromEither3): (onNone: LazyArg) => (fa: Option) => Kind3; export declare function fromOption(F: FromEither3C): (onNone: LazyArg) => (fa: Option) => Kind3; export declare function fromOption(F: FromEither2): (onNone: LazyArg) => (fa: Option) => Kind2; export declare function fromOption(F: FromEither2C): (onNone: LazyArg) => (fa: Option) => Kind2; export declare function fromOption(F: FromEither): (onNone: LazyArg) => (ma: Option) => HKT2; /** * @category lifting * @since 2.10.0 */ export declare function fromPredicate(F: FromEither4): { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => Kind4; (predicate: Predicate, onFalse: (a: A) => E): (b: B) => Kind4; (predicate: Predicate, onFalse: (a: A) => E): (a: A) => Kind4; }; export declare function fromPredicate(F: FromEither3): { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (b: B) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (a: A) => Kind3; }; export declare function fromPredicate(F: FromEither3C): { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (b: B) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (a: A) => Kind3; }; export declare function fromPredicate(F: FromEither2): { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (b: B) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (a: A) => Kind2; }; export declare function fromPredicate(F: FromEither2C): { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (b: B) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (a: A) => Kind2; }; export declare function fromPredicate(F: FromEither): { (refinement: Refinement, onFalse: (a: A) => E): (a: A) => HKT2; (predicate: Predicate, onFalse: (a: A) => E): (b: B) => HKT2; (predicate: Predicate, onFalse: (a: A) => E): (a: A) => HKT2; }; /** * @since 2.10.0 */ export declare function fromOptionK(F: FromEither4): (onNone: LazyArg) => , B>(f: (...a: A) => Option) => (...a: A) => Kind4; export declare function fromOptionK(F: FromEither3): (onNone: LazyArg) => , B>(f: (...a: A) => Option) => (...a: A) => Kind3; export declare function fromOptionK(F: FromEither3C): (onNone: LazyArg) => , B>(f: (...a: A) => Option) => (...a: A) => Kind3; export declare function fromOptionK(F: FromEither2): (onNone: LazyArg) => , B>(f: (...a: A) => Option) => (...a: A) => Kind2; export declare function fromOptionK(F: FromEither2C): (onNone: LazyArg) => , B>(f: (...a: A) => Option) => (...a: A) => Kind2; export declare function fromOptionK(F: FromEither): (onNone: LazyArg) => , B>(f: (...a: A) => Option) => (...a: A) => HKT2; /** * @since 2.10.0 */ export declare function chainOptionK(F: FromEither4, M: Chain4): (onNone: LazyArg) => (f: (a: A) => Option) => (ma: Kind4) => Kind4; export declare function chainOptionK(F: FromEither3, M: Chain3): (onNone: LazyArg) => (f: (a: A) => Option) => (ma: Kind3) => Kind3; export declare function chainOptionK(F: FromEither3C, M: Chain3C): (onNone: LazyArg) => (f: (a: A) => Option) => (ma: Kind3) => Kind3; export declare function chainOptionK(F: FromEither2, M: Chain2): (onNone: LazyArg) => (f: (a: A) => Option) => (ma: Kind2) => Kind2; export declare function chainOptionK(F: FromEither2C, M: Chain2C): (onNone: LazyArg) => (f: (a: A) => Option) => (ma: Kind2) => Kind2; export declare function chainOptionK(F: FromEither, M: Chain): (onNone: LazyArg) => (f: (a: A) => Option) => (ma: HKT2) => HKT2; /** * @since 2.10.0 */ export declare function fromEitherK(F: FromEither4): , E, B>(f: (...a: A) => Either) => (...a: A) => Kind4; export declare function fromEitherK(F: FromEither3): , E, B>(f: (...a: A) => Either) => (...a: A) => Kind3; export declare function fromEitherK(F: FromEither3C): , B>(f: (...a: A) => Either) => (...a: A) => Kind3; export declare function fromEitherK(F: FromEither2): , E, B>(f: (...a: A) => Either) => (...a: A) => Kind2; export declare function fromEitherK(F: FromEither2C): , B>(f: (...a: A) => Either) => (...a: A) => Kind2; export declare function fromEitherK(F: FromEither1): , B>(f: (...a: A) => Either) => (...a: A) => Kind; export declare function fromEitherK(F: FromEither): , E, B>(f: (...a: A) => Either) => (...a: A) => HKT2; /** * @since 2.10.0 */ export declare function chainEitherK(F: FromEither4, M: Chain4): (f: (a: A) => Either) => (ma: Kind4) => Kind4; export declare function chainEitherK(F: FromEither3, M: Chain3): (f: (a: A) => Either) => (ma: Kind3) => Kind3; export declare function chainEitherK(F: FromEither3C, M: Chain3C): (f: (a: A) => Either) => (ma: Kind3) => Kind3; export declare function chainEitherK(F: FromEither2, M: Chain2): (f: (a: A) => Either) => (ma: Kind2) => Kind2; export declare function chainEitherK(F: FromEither2C, M: Chain2C): (f: (a: A) => Either) => (ma: Kind2) => Kind2; export declare function chainEitherK(F: FromEither1, M: Chain1): (f: (a: A) => Either) => (ma: Kind) => Kind; export declare function chainEitherK(F: FromEither, M: Chain): (f: (a: A) => Either) => (ma: HKT2) => HKT2; /** * @since 2.12.0 */ export declare function chainFirstEitherK(F: FromEither4, M: Chain4): (f: (a: A) => Either) => (ma: Kind4) => Kind4; export declare function chainFirstEitherK(F: FromEither3, M: Chain3): (f: (a: A) => Either) => (ma: Kind3) => Kind3; export declare function chainFirstEitherK(F: FromEither3C, M: Chain3C): (f: (a: A) => Either) => (ma: Kind3) => Kind3; export declare function chainFirstEitherK(F: FromEither2, M: Chain2): (f: (a: A) => Either) => (ma: Kind2) => Kind2; export declare function chainFirstEitherK(F: FromEither2C, M: Chain2C): (f: (a: A) => Either) => (ma: Kind2) => Kind2; export declare function chainFirstEitherK(F: FromEither1, M: Chain1): (f: (a: A) => Either) => (ma: Kind) => Kind; export declare function chainFirstEitherK(F: FromEither, M: Chain): (f: (a: A) => Either) => (ma: HKT2) => HKT2; /** * @since 2.10.0 */ export declare function filterOrElse(F: FromEither4, M: Chain4): { (refinement: Refinement, onFalse: (a: A) => E): (ma: Kind4) => Kind4; (predicate: Predicate, onFalse: (a: A) => E): (mb: Kind4) => Kind4; (predicate: Predicate, onFalse: (a: A) => E): (ma: Kind4) => Kind4; }; export declare function filterOrElse(F: FromEither3, M: Chain3): { (refinement: Refinement, onFalse: (a: A) => E): (ma: Kind3) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (mb: Kind3) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (ma: Kind3) => Kind3; }; export declare function filterOrElse(F: FromEither3C, M: Chain3C): { (refinement: Refinement, onFalse: (a: A) => E): (ma: Kind3) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (mb: Kind3) => Kind3; (predicate: Predicate, onFalse: (a: A) => E): (ma: Kind3) => Kind3; }; export declare function filterOrElse(F: FromEither2, M: Chain2): { (refinement: Refinement, onFalse: (a: A) => E): (self: Kind2) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (self: Kind2) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (self: Kind2) => Kind2; }; export declare function filterOrElse(F: FromEither2C, M: Chain2C): { (refinement: Refinement, onFalse: (a: A) => E): (ma: Kind2) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (mb: Kind2) => Kind2; (predicate: Predicate, onFalse: (a: A) => E): (ma: Kind2) => Kind2; }; export declare function filterOrElse(F: FromEither, M: Chain): { (refinement: Refinement, onFalse: (a: A) => E): (ma: HKT2) => HKT2; (predicate: Predicate, onFalse: (a: A) => E): (mb: HKT2) => HKT2; (predicate: Predicate, onFalse: (a: A) => E): (ma: HKT2) => HKT2; };