import { type Either, type Left, type Right } from "./Either.js";
import { type IO } from "./IO.js";
import { type NonEmptyArray } from "./NonEmptyArray.js";
import { type None, type Option, type Some } from "./Option.js";
import { type Reader } from "./Reader.js";
import { type ReadonlyNonEmptyArray } from "./ReadonlyNonEmptyArray.js";
import { type Task } from "./Task.js";
/** @internal */
export declare const isNone: (fa: Option<unknown>) => fa is None;
/** @internal */
export declare const isSome: <A>(fa: Option<A>) => fa is Some<A>;
/** @internal */
export declare const none: Option<never>;
/** @internal */
export declare const some: <A>(a: A) => Option<A>;
/** @internal */
export declare const isLeft: <E>(ma: Either<E, unknown>) => ma is Left<E>;
/** @internal */
export declare const isRight: <A>(ma: Either<unknown, A>) => ma is Right<A>;
/** @internal */
export declare const left: <E, A = never>(e: E) => Either<E, A>;
/** @internal */
export declare const right: <A, E = never>(a: A) => Either<E, A>;
/** @internal */
export declare const singleton: <A>(a: A) => NonEmptyArray<A>;
/** @internal */
export declare const isNonEmpty: <A>(as: readonly A[]) => as is ReadonlyNonEmptyArray<A>;
/** @internal */
export declare const head: <A>(as: ReadonlyNonEmptyArray<A>) => A;
/** @internal */
export declare const tail: <A>(as: ReadonlyNonEmptyArray<A>) => readonly A[];
/** @internal */
export declare const emptyReadonlyArray: readonly [];
/** @internal */
export declare const emptyRecord: {};
/** @internal */
export declare const has: (v: PropertyKey) => boolean;
/** @internal */
export declare const fromReadonlyNonEmptyArray: <A>(as: ReadonlyNonEmptyArray<A>) => NonEmptyArray<A>;
/** @internal */
export declare const URI: unique symbol;
/** @internal */
export interface TypeLambda {
    readonly In: unknown;
    readonly Out2: unknown;
    readonly Out1: unknown;
    readonly Target: unknown;
}
/** @internal */
export interface TypeClass<F extends TypeLambda> {
    readonly [URI]?: F;
}
/** @internal */
export type Kind<F extends TypeLambda, In, Out2, Out1, Target> = F extends ({
    readonly type: unknown;
}) ? (F & {
    readonly In: In;
    readonly Out2: Out2;
    readonly Out1: Out1;
    readonly Target: Target;
})['type'] : {
    readonly F: F;
    readonly In: (_: In) => void;
    readonly Out2: () => Out2;
    readonly Out1: () => Out1;
    readonly Target: (_: Target) => Target;
};
/** @internal */
export interface FromEither<F extends TypeLambda> extends TypeClass<F> {
    readonly fromEither: <R, O, E, A>(e: Either<E, A>) => Kind<F, R, O, E, A>;
}
/** @internal */
export interface FromIO<F extends TypeLambda> extends TypeClass<F> {
    readonly fromIO: <R, O, E, A>(e: IO<A>) => Kind<F, R, O, E, A>;
}
/** @internal */
export interface FromTask<F extends TypeLambda> extends TypeClass<F> {
    readonly fromTask: <R, O, E, A>(e: Task<A>) => Kind<F, R, O, E, A>;
}
/** @internal */
export interface FromReader<F extends TypeLambda> extends TypeClass<F> {
    readonly fromReader: <R, O, E, A>(e: Reader<R, A>) => Kind<F, R, O, E, A>;
}
/** @internal */
export declare const liftNullable: <F extends TypeLambda>(F: FromEither<F>) => <A extends readonly unknown[], B, E>(f: (...a: A) => B, onNullable: (...a: A) => E) => <R, O>(...a: A) => Kind<F, R, O, E, NonNullable<B>>;
/** @internal */
export declare const liftOption: <F extends TypeLambda>(F: FromEither<F>) => <A extends readonly unknown[], B, E>(f: (...a: A) => Option<B>, onNone: (...a: A) => E) => <R, O>(...a: A) => Kind<F, R, O, E, B>;
/** @internal */
export interface FlatMap<F extends TypeLambda> extends TypeClass<F> {
    readonly flatMap: {
        <A, R2, O2, E2, B>(f: (a: A) => Kind<F, R2, O2, E2, B>): <R1, O1, E1>(self: Kind<F, R1, O1, E1, A>) => Kind<F, R1 & R2, O1 | O2, E1 | E2, B>;
        <R1, O1, E1, A, R2, O2, E2, B>(self: Kind<F, R1, O1, E1, A>, f: (a: A) => Kind<F, R2, O2, E2, B>): Kind<F, R1 & R2, O1 | O2, E1 | E2, B>;
    };
}
/** @internal */
export declare const flatMapNullable: <F extends TypeLambda>(F: FromEither<F>, M: FlatMap<F>) => {
    <A, B, E2>(f: (a: A) => B, onNullable: (a: A) => E2): <R, O, E1>(self: Kind<F, R, O, E1, A>) => Kind<F, R, O, E2 | E1, NonNullable<B>>;
    <R_1, O_1, E1_1, A_1, B_1, E2_1>(self: Kind<F, R_1, O_1, E1_1, A_1>, f: (a: A_1) => B_1, onNullable: (a: A_1) => E2_1): Kind<F, R_1, O_1, E1_1 | E2_1, NonNullable<B_1>>;
};
/** @internal */
export declare const flatMapOption: <F extends TypeLambda>(F: FromEither<F>, M: FlatMap<F>) => {
    <A, B, E2>(f: (a: A) => Option<B>, onNone: (a: A) => E2): <R, O, E1>(self: Kind<F, R, O, E1, A>) => Kind<F, R, O, E2 | E1, B>;
    <R_1, O_1, E1_1, A_1, B_1, E2_1>(self: Kind<F, R_1, O_1, E1_1, A_1>, f: (a: A_1) => Option<B_1>, onNone: (a: A_1) => E2_1): Kind<F, R_1, O_1, E1_1 | E2_1, B_1>;
};
/** @internal */
export declare const flatMapEither: <F extends TypeLambda>(F: FromEither<F>, M: FlatMap<F>) => {
    <A, E2, B>(f: (a: A) => Either<E2, B>): <R, O, E1>(self: Kind<F, R, O, E1, A>) => Kind<F, R, O, E2 | E1, B>;
    <R_1, O_1, E1_1, A_1, E2_1, B_1>(self: Kind<F, R_1, O_1, E1_1, A_1>, f: (a: A_1) => Either<E2_1, B_1>): Kind<F, R_1, O_1, E1_1 | E2_1, B_1>;
};
/** @internal */
export declare const flatMapIO: <F extends TypeLambda>(F: FromIO<F>, M: FlatMap<F>) => {
    <A, B>(f: (a: A) => IO<B>): <R, O, E>(self: Kind<F, R, O, E, A>) => Kind<F, R, O, E, B>;
    <R_1, O_1, E_1, A_1, B_1>(self: Kind<F, R_1, O_1, E_1, A_1>, f: (a: A_1) => IO<B_1>): Kind<F, R_1, O_1, E_1, B_1>;
};
/** @internal */
export declare const flatMapTask: <F extends TypeLambda>(F: FromTask<F>, M: FlatMap<F>) => {
    <A, B>(f: (a: A) => Task<B>): <R, O, E>(self: Kind<F, R, O, E, A>) => Kind<F, R, O, E, B>;
    <R_1, O_1, E_1, A_1, B_1>(self: Kind<F, R_1, O_1, E_1, A_1>, f: (a: A_1) => Task<B_1>): Kind<F, R_1, O_1, E_1, B_1>;
};
/** @internal */
export declare const flatMapReader: <F extends TypeLambda>(F: FromReader<F>, M: FlatMap<F>) => {
    <A, R2, B>(f: (a: A) => Reader<R2, B>): <R1, O, E>(self: Kind<F, R1, O, E, A>) => Kind<F, R1 & R2, O, E, B>;
    <R1_1, O_1, E_1, A_1, R2_1, B_1>(self: Kind<F, R1_1, O_1, E_1, A_1>, f: (a: A_1) => Reader<R2_1, B_1>): Kind<F, R1_1 & R2_1, O_1, E_1, B_1>;
};
/**
 * @remarks
 * Added in 1.0.0
 * @remarks
 * Original License: MIT – Copyright (c) 2017-present Giulio Canti
 * @public
 */
export type UnionToIntersection<Union> = (Union extends unknown ? (distributedUnion: Union) => void : never) extends ((mergedIntersection: infer Intersection) => void) ? Intersection & Union : never;
//# sourceMappingURL=internal.d.ts.map