/**
 * The `FromEither` type class represents those data types which support errors.
 *
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
import { type Chain, type Chain1, type Chain2, type Chain2C, type Chain3, type Chain3C, type Chain4 } from "./Chain.js";
import { type Either } from "./Either.js";
import { type LazyArg } from "./function.js";
import { type HKT2, type Kind, type Kind2, type Kind3, type Kind4, type URIS, type URIS2, type URIS3, type URIS4 } from "./HKT.js";
import { type Option } from "./Option.js";
import { type Predicate } from "./Predicate.js";
import { type Refinement } from "./Refinement.js";
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface FromEither<F> {
    readonly URI: F;
    readonly fromEither: <E, A>(e: Either<E, A>) => HKT2<F, E, A>;
}
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface FromEither1<F extends URIS> {
    readonly URI: F;
    readonly fromEither: <A>(fa: Either<unknown, A>) => Kind<F, A>;
}
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface FromEither2<F extends URIS2> {
    readonly URI: F;
    readonly fromEither: <E, A>(fa: Either<E, A>) => Kind2<F, E, A>;
}
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface FromEither2C<F extends URIS2, E> {
    readonly URI: F;
    readonly _E: E;
    readonly fromEither: <A>(fa: Either<E, A>) => Kind2<F, E, A>;
}
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface FromEither3<F extends URIS3> {
    readonly URI: F;
    readonly fromEither: <E, A, R>(fa: Either<E, A>) => Kind3<F, R, E, A>;
}
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface FromEither3C<F extends URIS3, E> {
    readonly URI: F;
    readonly _E: E;
    readonly fromEither: <A, R>(fa: Either<E, A>) => Kind3<F, R, E, A>;
}
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Model
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export interface FromEither4<F extends URIS4> {
    readonly URI: F;
    readonly fromEither: <E, A, S, R>(fa: Either<E, A>) => Kind4<F, S, R, E, A>;
}
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Constructors
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function fromOption<F extends URIS4>(F: FromEither4<F>): <E>(onNone: LazyArg<E>) => <A, S, R>(fa: Option<A>) => Kind4<F, S, R, E, A>;
export declare function fromOption<F extends URIS3>(F: FromEither3<F>): <E>(onNone: LazyArg<E>) => <A, R>(fa: Option<A>) => Kind3<F, R, E, A>;
export declare function fromOption<F extends URIS3, E>(F: FromEither3C<F, E>): (onNone: LazyArg<E>) => <A, R>(fa: Option<A>) => Kind3<F, R, E, A>;
export declare function fromOption<F extends URIS2>(F: FromEither2<F>): <E>(onNone: LazyArg<E>) => <A>(fa: Option<A>) => Kind2<F, E, A>;
export declare function fromOption<F extends URIS2, E>(F: FromEither2C<F, E>): (onNone: LazyArg<E>) => <A>(fa: Option<A>) => Kind2<F, E, A>;
export declare function fromOption<F>(F: FromEither<F>): <E>(onNone: LazyArg<E>) => <A>(ma: Option<A>) => HKT2<F, E, A>;
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Category: Lifting
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function fromPredicate<F extends URIS4>(F: FromEither4<F>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <S, R>(a: A) => Kind4<F, S, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R, B extends A>(b: B) => Kind4<F, S, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R>(a: A) => Kind4<F, S, R, E, A>;
};
export declare function fromPredicate<F extends URIS3>(F: FromEither3<F>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <R>(a: A) => Kind3<F, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <R, B extends A>(b: B) => Kind3<F, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(a: A) => Kind3<F, R, E, A>;
};
export declare function fromPredicate<F extends URIS3, E>(F: FromEither3C<F, E>): {
    <A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <R>(a: A) => Kind3<F, R, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R, B extends A>(b: B) => Kind3<F, R, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(a: A) => Kind3<F, R, E, A>;
};
export declare function fromPredicate<F extends URIS2>(F: FromEither2<F>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (a: A) => Kind2<F, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(b: B) => Kind2<F, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): (a: A) => Kind2<F, E, A>;
};
export declare function fromPredicate<F extends URIS2, E>(F: FromEither2C<F, E>): {
    <A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (a: A) => Kind2<F, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(b: B) => Kind2<F, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): (a: A) => Kind2<F, E, A>;
};
export declare function fromPredicate<F>(F: FromEither<F>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (a: A) => HKT2<F, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(b: B) => HKT2<F, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): (a: A) => HKT2<F, E, A>;
};
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function fromOptionK<F extends URIS4>(F: FromEither4<F>): <E>(onNone: LazyArg<E>) => <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => <S, R>(...a: A) => Kind4<F, S, R, E, B>;
export declare function fromOptionK<F extends URIS3>(F: FromEither3<F>): <E>(onNone: LazyArg<E>) => <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => <R>(...a: A) => Kind3<F, R, E, B>;
export declare function fromOptionK<F extends URIS3, E>(F: FromEither3C<F, E>): (onNone: LazyArg<E>) => <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => <R>(...a: A) => Kind3<F, R, E, B>;
export declare function fromOptionK<F extends URIS2>(F: FromEither2<F>): <E>(onNone: LazyArg<E>) => <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => (...a: A) => Kind2<F, E, B>;
export declare function fromOptionK<F extends URIS2, E>(F: FromEither2C<F, E>): (onNone: LazyArg<E>) => <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => (...a: A) => Kind2<F, E, B>;
export declare function fromOptionK<F>(F: FromEither<F>): <E>(onNone: LazyArg<E>) => <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => (...a: A) => HKT2<F, E, B>;
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function chainOptionK<F extends URIS4>(F: FromEither4<F>, M: Chain4<F>): <E>(onNone: LazyArg<E>) => <A, B>(f: (a: A) => Option<B>) => <S, R>(ma: Kind4<F, S, R, E, A>) => Kind4<F, S, R, E, B>;
export declare function chainOptionK<F extends URIS3>(F: FromEither3<F>, M: Chain3<F>): <E>(onNone: LazyArg<E>) => <A, B>(f: (a: A) => Option<B>) => <R>(ma: Kind3<F, R, E, A>) => Kind3<F, R, E, B>;
export declare function chainOptionK<F extends URIS3, E>(F: FromEither3C<F, E>, M: Chain3C<F, E>): (onNone: LazyArg<E>) => <A, B>(f: (a: A) => Option<B>) => <R>(ma: Kind3<F, R, E, A>) => Kind3<F, R, E, B>;
export declare function chainOptionK<F extends URIS2>(F: FromEither2<F>, M: Chain2<F>): <E>(onNone: LazyArg<E>) => <A, B>(f: (a: A) => Option<B>) => (ma: Kind2<F, E, A>) => Kind2<F, E, B>;
export declare function chainOptionK<F extends URIS2, E>(F: FromEither2C<F, E>, M: Chain2C<F, E>): (onNone: LazyArg<E>) => <A, B>(f: (a: A) => Option<B>) => (ma: Kind2<F, E, A>) => Kind2<F, E, B>;
export declare function chainOptionK<F>(F: FromEither<F>, M: Chain<F>): <E>(onNone: LazyArg<E>) => <A, B>(f: (a: A) => Option<B>) => (ma: HKT2<F, E, A>) => HKT2<F, E, B>;
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function fromEitherK<F extends URIS4>(F: FromEither4<F>): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => Either<E, B>) => <S, R>(...a: A) => Kind4<F, S, R, E, B>;
export declare function fromEitherK<F extends URIS3>(F: FromEither3<F>): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => Either<E, B>) => <R>(...a: A) => Kind3<F, R, E, B>;
export declare function fromEitherK<F extends URIS3, E>(F: FromEither3C<F, E>): <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Either<E, B>) => <R>(...a: A) => Kind3<F, R, E, B>;
export declare function fromEitherK<F extends URIS2>(F: FromEither2<F>): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => Either<E, B>) => (...a: A) => Kind2<F, E, B>;
export declare function fromEitherK<F extends URIS2, E>(F: FromEither2C<F, E>): <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Either<E, B>) => (...a: A) => Kind2<F, E, B>;
export declare function fromEitherK<F extends URIS>(F: FromEither1<F>): <E, A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Either<E, B>) => (...a: A) => Kind<F, B>;
export declare function fromEitherK<F>(F: FromEither<F>): <A extends ReadonlyArray<unknown>, E, B>(f: (...a: A) => Either<E, B>) => (...a: A) => HKT2<F, E, B>;
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function chainEitherK<M extends URIS4>(F: FromEither4<M>, M: Chain4<M>): <A, E, B>(f: (a: A) => Either<E, B>) => <S, R>(ma: Kind4<M, S, R, E, A>) => Kind4<M, S, R, E, B>;
export declare function chainEitherK<M extends URIS3>(F: FromEither3<M>, M: Chain3<M>): <A, E, B>(f: (a: A) => Either<E, B>) => <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, B>;
export declare function chainEitherK<M extends URIS3, E>(F: FromEither3C<M, E>, M: Chain3C<M, E>): <A, B>(f: (a: A) => Either<E, B>) => <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, B>;
export declare function chainEitherK<M extends URIS2>(F: FromEither2<M>, M: Chain2<M>): <A, E, B>(f: (a: A) => Either<E, B>) => (ma: Kind2<M, E, A>) => Kind2<M, E, B>;
export declare function chainEitherK<M extends URIS2, E>(F: FromEither2C<M, E>, M: Chain2C<M, E>): <A, B>(f: (a: A) => Either<E, B>) => (ma: Kind2<M, E, A>) => Kind2<M, E, B>;
export declare function chainEitherK<M extends URIS>(F: FromEither1<M>, M: Chain1<M>): <E, A, B>(f: (a: A) => Either<E, B>) => (ma: Kind<M, A>) => Kind<M, B>;
export declare function chainEitherK<M>(F: FromEither<M>, M: Chain<M>): <A, E, B>(f: (a: A) => Either<E, B>) => (ma: HKT2<M, E, A>) => HKT2<M, E, B>;
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function chainFirstEitherK<M extends URIS4>(F: FromEither4<M>, M: Chain4<M>): <A, E, B>(f: (a: A) => Either<E, B>) => <S, R>(ma: Kind4<M, S, R, E, A>) => Kind4<M, S, R, E, A>;
export declare function chainFirstEitherK<M extends URIS3>(F: FromEither3<M>, M: Chain3<M>): <A, E, B>(f: (a: A) => Either<E, B>) => <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, A>;
export declare function chainFirstEitherK<M extends URIS3, E>(F: FromEither3C<M, E>, M: Chain3C<M, E>): <A, B>(f: (a: A) => Either<E, B>) => <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, A>;
export declare function chainFirstEitherK<M extends URIS2>(F: FromEither2<M>, M: Chain2<M>): <A, E, B>(f: (a: A) => Either<E, B>) => (ma: Kind2<M, E, A>) => Kind2<M, E, A>;
export declare function chainFirstEitherK<M extends URIS2, E>(F: FromEither2C<M, E>, M: Chain2C<M, E>): <A, B>(f: (a: A) => Either<E, B>) => (ma: Kind2<M, E, A>) => Kind2<M, E, A>;
export declare function chainFirstEitherK<M extends URIS>(F: FromEither1<M>, M: Chain1<M>): <E, A, B>(f: (a: A) => Either<E, B>) => (ma: Kind<M, A>) => Kind<M, A>;
export declare function chainFirstEitherK<M>(F: FromEither<M>, M: Chain<M>): <A, E, B>(f: (a: A) => Either<E, B>) => (ma: HKT2<M, E, A>) => HKT2<M, E, A>;
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export declare function filterOrElse<M extends URIS4>(F: FromEither4<M>, M: Chain4<M>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <S, R>(ma: Kind4<M, S, R, E, A>) => Kind4<M, S, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R, B extends A>(mb: Kind4<M, S, R, E, B>) => Kind4<M, S, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <S, R>(ma: Kind4<M, S, R, E, A>) => Kind4<M, S, R, E, A>;
};
export declare function filterOrElse<M extends URIS3>(F: FromEither3<M>, M: Chain3<M>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <R, B extends A>(mb: Kind3<M, R, E, B>) => Kind3<M, R, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, A>;
};
export declare function filterOrElse<M extends URIS3, E>(F: FromEither3C<M, E>, M: Chain3C<M, E>): {
    <A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R, B extends A>(mb: Kind3<M, R, E, B>) => Kind3<M, R, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): <R>(ma: Kind3<M, R, E, A>) => Kind3<M, R, E, A>;
};
export declare function filterOrElse<M extends URIS2>(F: FromEither2<M>, M: Chain2<M>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (self: Kind2<M, E, A>) => Kind2<M, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(self: Kind2<M, E, B>) => Kind2<M, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): (self: Kind2<M, E, A>) => Kind2<M, E, A>;
};
export declare function filterOrElse<M extends URIS2, E>(F: FromEither2C<M, E>, M: Chain2C<M, E>): {
    <A, B extends A>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (ma: Kind2<M, E, A>) => Kind2<M, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(mb: Kind2<M, E, B>) => Kind2<M, E, B>;
    <A>(predicate: Predicate<A>, onFalse: (a: A) => E): (ma: Kind2<M, E, A>) => Kind2<M, E, A>;
};
export declare function filterOrElse<M extends URIS2>(F: FromEither<M>, M: Chain<M>): {
    <A, B extends A, E>(refinement: Refinement<A, B>, onFalse: (a: A) => E): (ma: HKT2<M, E, A>) => HKT2<M, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): <B extends A>(mb: HKT2<M, E, B>) => HKT2<M, E, B>;
    <A, E>(predicate: Predicate<A>, onFalse: (a: A) => E): (ma: HKT2<M, E, A>) => HKT2<M, E, A>;
};
/** @internal */
export declare function tapEither<M extends URIS4>(F: FromEither4<M>, M: Chain4<M>): <A, E, B, S, R>(self: Kind4<M, S, R, E, A>, f: (a: A) => Either<E, B>) => Kind4<M, S, R, E, A>;
/** @internal */
export declare function tapEither<M extends URIS3>(F: FromEither3<M>, M: Chain3<M>): <A, E, B, R>(self: Kind3<M, R, E, A>, f: (a: A) => Either<E, B>) => Kind3<M, R, E, A>;
/** @internal */
export declare function tapEither<M extends URIS3, E>(F: FromEither3C<M, E>, M: Chain3C<M, E>): <A, B, R>(self: Kind3<M, R, E, A>, f: (a: A) => Either<E, B>) => Kind3<M, R, E, A>;
/** @internal */
export declare function tapEither<M extends URIS2>(F: FromEither2<M>, M: Chain2<M>): <A, E, B>(self: Kind2<M, E, A>, f: (a: A) => Either<E, B>) => Kind2<M, E, A>;
/** @internal */
export declare function tapEither<M extends URIS2, E>(F: FromEither2C<M, E>, M: Chain2C<M, E>): <A, B>(self: Kind2<M, E, A>, f: (a: A) => Either<E, B>) => Kind2<M, E, A>;
/** @internal */
export declare function tapEither<M extends URIS>(F: FromEither1<M>, M: Chain1<M>): <E, A, B>(self: Kind<M, A>, f: (a: A) => Either<E, B>) => Kind<M, A>;
/** @internal */
export declare function tapEither<M>(F: FromEither<M>, M: Chain<M>): <A, E, B>(self: HKT2<M, E, A>, f: (a: A) => Either<E, B>) => HKT2<M, E, A>;
//# sourceMappingURL=FromEither.d.ts.map