Socket
Socket
Sign inDemoInstall

@fp-ts/data

Package Overview
Dependencies
Maintainers
3
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fp-ts/data - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

_mjs/Ordering.mjs

16

Boolean.d.ts
/**
* @since 1.0.0
*/
import type * as monoid from "@fp-ts/core/Monoid";
import type * as semigroup from "@fp-ts/core/Semigroup";
import type * as sortable from "@fp-ts/core/Sortable";
import type * as monoid from "@fp-ts/core/typeclass/Monoid";
import type * as order from "@fp-ts/core/typeclass/Order";
import type * as semigroup from "@fp-ts/core/typeclass/Semigroup";
import type { LazyArg } from "@fp-ts/data/Function";

@@ -95,11 +95,3 @@ import type { Refinement } from "@fp-ts/data/Refinement";

*/
export declare const Sortable: sortable.Sortable<boolean>;
/**
* @since 1.0.0
*/
export declare const all: (collection: Iterable<boolean>) => boolean;
/**
* @since 1.0.0
*/
export declare const any: (collection: Iterable<boolean>) => boolean;
export declare const Order: order.Order<boolean>;
//# sourceMappingURL=Boolean.d.ts.map

@@ -6,3 +6,3 @@ "use strict";

});
exports.or = exports.match = exports.isBoolean = exports.any = exports.and = exports.all = exports.Sortable = exports.SemigroupAny = exports.SemigroupAll = exports.MonoidAny = exports.MonoidAll = void 0;
exports.or = exports.match = exports.isBoolean = exports.and = exports.SemigroupAny = exports.SemigroupAll = exports.Order = exports.MonoidAny = exports.MonoidAll = void 0;

@@ -74,10 +74,14 @@ /**

combine: and,
combineMany: others => start => {
let c = start;
combineMany: collection => self => {
if (self === false) {
return false;
}
for (const o of others) {
c = and(o)(c);
for (const b of collection) {
if (b === false) {
return false;
}
}
return c;
return true;
}

@@ -103,10 +107,14 @@ };

combine: or,
combineMany: others => start => {
let c = start;
combineMany: collection => self => {
if (self === true) {
return true;
}
for (const o of others) {
c = or(o)(c);
for (const b of collection) {
if (b === true) {
return true;
}
}
return c;
return false;
}

@@ -124,5 +132,3 @@ };

exports.SemigroupAny = SemigroupAny;
const MonoidAll = {
combine: SemigroupAll.combine,
combineMany: SemigroupAll.combineMany,
const MonoidAll = { ...SemigroupAll,
combineAll: all => SemigroupAll.combineMany(all)(true),

@@ -141,5 +147,3 @@ empty: true

exports.MonoidAll = MonoidAll;
const MonoidAny = {
combine: SemigroupAny.combine,
combineMany: SemigroupAny.combineMany,
const MonoidAny = { ...SemigroupAny,
combineAll: all => SemigroupAny.combineMany(all)(false),

@@ -154,18 +158,6 @@ empty: false

exports.MonoidAny = MonoidAny;
const Sortable = {
const Order = {
compare: that => self => self < that ? -1 : self > that ? 1 : 0
};
/**
* @since 1.0.0
*/
exports.Sortable = Sortable;
const all = MonoidAll.combineAll;
/**
* @since 1.0.0
*/
exports.all = all;
const any = MonoidAny.combineAll;
exports.any = any;
exports.Order = Order;
//# sourceMappingURL=Boolean.js.map
/**
* @since 1.0.0
*/
import type { Sortable } from "@fp-ts/core/Sortable";
import type { Order } from "@fp-ts/core/typeclass/Order";
import type { Either } from "@fp-ts/data/Either";

@@ -426,3 +426,3 @@ import * as Equal from "@fp-ts/data/Equal";

*/
export declare const sort: <B>(O: Sortable<B>) => <A extends B>(as: Chunk<A>) => Chunk<A>;
export declare const sort: <B>(O: Order<B>) => <A extends B>(as: Chunk<A>) => Chunk<A>;
/**

@@ -429,0 +429,0 @@ * Returns two splits of this chunk at the specified index.

@@ -1056,3 +1056,3 @@ "use strict";

const reduceRight = (s, f) => self => (0, _Function.pipe)(toArray(self), RA.reduceRight(s, f));
const reduceRight = (s, f) => self => (0, _Function.pipe)(toArray(self), RA.reduceRight(s, (s, a) => f(a, s)));
/**

@@ -1059,0 +1059,0 @@ * Folds over the elements in this chunk from the right.

@@ -10,13 +10,14 @@ /**

*/
import type * as bifunctor from "@fp-ts/core/Bifunctor";
import type { Bounded } from "@fp-ts/core/Bounded";
import type * as contravariant from "@fp-ts/core/Contravariant";
import * as functor from "@fp-ts/core/Functor";
import type { TypeLambda } from "@fp-ts/core/HKT";
import type { Monoid } from "@fp-ts/core/Monoid";
import type { Monoidal } from "@fp-ts/core/Monoidal";
import type { Pointed } from "@fp-ts/core/Pointed";
import type { Semigroup } from "@fp-ts/core/Semigroup";
import type { Semigroupal } from "@fp-ts/core/Semigroupal";
import type { Sortable } from "@fp-ts/core/Sortable";
import type { Applicative } from "@fp-ts/core/typeclass/Applicative";
import type * as bicovariant from "@fp-ts/core/typeclass/Bicovariant";
import type { Bounded } from "@fp-ts/core/typeclass/Bounded";
import type * as contravariant from "@fp-ts/core/typeclass/Contravariant";
import * as covariant from "@fp-ts/core/typeclass/Covariant";
import * as invariant from "@fp-ts/core/typeclass/Invariant";
import type { Monoid } from "@fp-ts/core/typeclass/Monoid";
import type { NonEmptyApplicative } from "@fp-ts/core/typeclass/NonEmptyApplicative";
import type { Order } from "@fp-ts/core/typeclass/Order";
import type { Pointed } from "@fp-ts/core/typeclass/Pointed";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
/**

@@ -30,3 +31,3 @@ * @since 1.0.0

*/
export interface Const</** in out */ S, /** out */ A> {
export interface Const<S, A> {
readonly [phantom]: A;

@@ -40,3 +41,3 @@ readonly value: S;

export interface ConstTypeLambda extends TypeLambda {
readonly type: Const<this["InOut1"], this["Out1"]>;
readonly type: Const<this["Out1"], this["Target"]>;
}

@@ -47,11 +48,4 @@ /**

*/
export interface ConstTypeLambdaBifunctor extends TypeLambda {
readonly type: Const<this["Out2"], this["Out1"]>;
}
/**
* @category type lambdas
* @since 1.0.0
*/
export interface ConstTypeLambdaContravariant extends TypeLambda {
readonly type: Const<this["InOut1"], this["In1"]>;
readonly type: Const<this["In"], this["Target"]>;
}

@@ -63,3 +57,3 @@ /**

export interface ConstTypeLambdaFix<S> extends TypeLambda {
readonly type: Const<S, this["Out1"]>;
readonly type: Const<S, this["Target"]>;
}

@@ -79,3 +73,3 @@ /**

*/
export declare const liftSortable: <S>(Sortable: Sortable<S>) => Sortable<Const<S, never>>;
export declare const liftOrder: <S>(O: Order<S>) => Order<Const<S, never>>;
/**

@@ -97,4 +91,2 @@ * @category instances

/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping

@@ -105,17 +97,61 @@ * @since 1.0.0

/**
* @category mapping
* @since 1.0.0
*/
export declare const imap: <A, B>(to: (a: A) => B, from: (b: B) => A) => <E>(self: Const<E, A>) => Const<E, B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Functor: functor.Functor<ConstTypeLambda>;
export declare const Invariant: invariant.Invariant<ConstTypeLambda>;
/**
* @since 1.0.0
*/
export declare const tupled: <E, A>(self: Const<E, A>) => Const<E, readonly [A]>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <E, A>(self: Const<E, A>) => Const<E, {
readonly [K in N]: A;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Covariant: covariant.Covariant<ConstTypeLambda>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => <E>(self: Const<E, A>) => Const<E, {
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export {
/**
* @category do notation
* @since 1.0.0
*/
let_ as let };
/**
* @category mapping
* @since 1.0.0
*/
export declare const flap: <A>(a: A) => <S, B>(self: Const<S, (a: A) => B>) => Const<S, B>;
export declare const flap: <A>(a: A) => <E, B>(self: Const<E, (a: A) => B>) => Const<E, B>;
/**
* Maps the success value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
export declare const contramap: <B, A>(f: (b: B) => A) => <S>(fa: Const<S, A>) => Const<S, B>;
export declare const as: <B>(b: B) => <E, _>(self: Const<E, _>) => Const<E, B>;
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
export declare const asUnit: <E, _>(self: Const<E, _>) => Const<E, void>;
/**
* @category mapping
* @since 1.0.0
*/
export declare const contramap: <B, A>(f: (b: B) => A) => <S>(self: Const<S, A>) => Const<S, B>;
/**
* @category instances

@@ -129,3 +165,3 @@ * @since 1.0.0

*/
export declare const mapLeft: <S, G>(f: (s: S) => G) => <A>(self: Const<S, A>) => Const<G, A>;
export declare const mapLeft: <S, T>(f: (s: S) => T) => <A>(self: Const<S, A>) => Const<T, A>;
/**

@@ -138,3 +174,3 @@ * Returns an effect whose failure and success channels have been mapped by

*/
export declare const mapBoth: <S, T, A, B>(f: (s: S) => T, g: (a: A) => B) => (self: Const<S, A>) => Const<T, B>;
export declare const bimap: <S, T, A, B>(f: (s: S) => T, g: (a: A) => B) => (self: Const<S, A>) => Const<T, B>;
/**

@@ -144,3 +180,3 @@ * @category instances

*/
export declare const Bifunctor: bifunctor.Bifunctor<ConstTypeLambdaBifunctor>;
export declare const Bicovariant: bicovariant.Bicovariant<ConstTypeLambda>;
/**

@@ -150,3 +186,3 @@ * @category instances

*/
export declare const getPointed: <S>(Monoid: Monoid<S>) => Pointed<ConstTypeLambdaFix<S>>;
export declare const getPointed: <S>(M: Monoid<S>) => Pointed<ConstTypeLambdaFix<S>>;
/**

@@ -156,3 +192,3 @@ * @category instances

*/
export declare const getSemigroupal: <S>(Semigroup: Semigroup<S>) => Semigroupal<ConstTypeLambdaFix<S>>;
export declare const getNonEmptyApplicative: <S>(S: Semigroup<S>) => NonEmptyApplicative<ConstTypeLambdaFix<S>>;
/**

@@ -162,3 +198,3 @@ * @category instances

*/
export declare const getMonoidal: <S>(Monoid: Monoid<S>) => Monoidal<ConstTypeLambdaFix<S>>;
export declare const getApplicative: <S>(M: Monoid<S>) => Applicative<ConstTypeLambdaFix<S>>;
//# sourceMappingURL=Const.d.ts.map

@@ -6,10 +6,12 @@ "use strict";

});
exports.mapLeft = exports.mapBoth = exports.map = exports.make = exports.liftSortable = exports.liftSemigroup = exports.liftMonoid = exports.liftBounded = exports.getSemigroupal = exports.getPointed = exports.getMonoidal = exports.flap = exports.execute = exports.contramap = exports.Functor = exports.Contravariant = exports.Bifunctor = void 0;
exports.tupled = exports.mapLeft = exports.map = exports.make = exports.liftSemigroup = exports.liftOrder = exports.liftMonoid = exports.liftBounded = exports.let = exports.imap = exports.getPointed = exports.getNonEmptyApplicative = exports.getApplicative = exports.flap = exports.execute = exports.contramap = exports.bindTo = exports.bimap = exports.asUnit = exports.as = exports.Invariant = exports.Covariant = exports.Contravariant = exports.Bicovariant = void 0;
var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));
var covariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Covariant"));
var monoid = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Monoid"));
var invariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Invariant"));
var sortable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));
var monoid = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Monoid"));
var order = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Order"));
var _Function = /*#__PURE__*/require("@fp-ts/data/Function");

@@ -43,3 +45,3 @@

exports.execute = execute;
const liftSortable = /*#__PURE__*/sortable.contramap(execute);
const liftOrder = /*#__PURE__*/order.contramap(execute);
/**

@@ -50,8 +52,8 @@ * @category instances

exports.liftSortable = liftSortable;
exports.liftOrder = liftOrder;
const liftBounded = Bounded => ({
compare: liftSortable(Bounded).compare,
maximum: make(Bounded.maximum),
minimum: make(Bounded.minimum)
compare: liftOrder(Bounded).compare,
maxBound: make(Bounded.maxBound),
minBound: make(Bounded.minBound)
});

@@ -80,4 +82,2 @@ /**

/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping

@@ -91,2 +91,9 @@ * @since 1.0.0

/**
* @category mapping
* @since 1.0.0
*/
exports.map = map;
const imap = /*#__PURE__*/covariant.imap(map);
/**
* @category instances

@@ -96,6 +103,32 @@ * @since 1.0.0

exports.map = map;
const Functor = {
exports.imap = imap;
const Invariant = {
imap
};
/**
* @since 1.0.0
*/
exports.Invariant = Invariant;
const tupled = /*#__PURE__*/invariant.tupled(Invariant);
/**
* @category do notation
* @since 1.0.0
*/
exports.tupled = tupled;
const bindTo = /*#__PURE__*/invariant.bindTo(Invariant);
/**
* @category instances
* @since 1.0.0
*/
exports.bindTo = bindTo;
const Covariant = { ...Invariant,
map
};
exports.Covariant = Covariant;
const let_ = /*#__PURE__*/covariant.let(Covariant);
exports.let = let_;
/**

@@ -105,6 +138,15 @@ * @category mapping

*/
const flap = /*#__PURE__*/covariant.flap(Covariant);
/**
* Maps the success value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
exports.Functor = Functor;
const flap = /*#__PURE__*/functor.flap(Functor);
exports.flap = flap;
const as = /*#__PURE__*/covariant.as(Covariant);
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping

@@ -114,3 +156,10 @@ * @since 1.0.0

exports.flap = flap;
exports.as = as;
const asUnit = /*#__PURE__*/covariant.asUnit(Covariant);
/**
* @category mapping
* @since 1.0.0
*/
exports.asUnit = asUnit;
const contramap = /*#__PURE__*/(0, _Function.constant)(_Function.unsafeCoerce);

@@ -123,3 +172,3 @@ /**

exports.contramap = contramap;
const Contravariant = {
const Contravariant = { ...Invariant,
contramap

@@ -145,3 +194,3 @@ };

exports.mapLeft = mapLeft;
const mapBoth = /*#__PURE__*/(0, _Function.unsafeCoerce)(mapLeft);
const bimap = /*#__PURE__*/(0, _Function.unsafeCoerce)(mapLeft);
/**

@@ -152,5 +201,5 @@ * @category instances

exports.mapBoth = mapBoth;
const Bifunctor = {
mapBoth
exports.bimap = bimap;
const Bicovariant = {
bimap
};

@@ -162,6 +211,8 @@ /**

exports.Bifunctor = Bifunctor;
exports.Bicovariant = Bicovariant;
const getPointed = Monoid => ({
of: (0, _Function.constant)(make(Monoid.empty))
const getPointed = M => ({
imap: Invariant.imap,
map,
of: (0, _Function.constant)(make(M.empty))
});

@@ -176,6 +227,7 @@ /**

const getSemigroupal = Semigroup => ({
const getNonEmptyApplicative = S => ({
imap: Invariant.imap,
map,
zipWith: that => self => make(Semigroup.combine(that.value)(self.value)),
zipMany: collection => self => make(Semigroup.combineMany(Array.from(collection).map(c => c.value))(self.value))
product: that => self => make(S.combine(that.value)(self.value)),
productMany: collection => self => make(S.combineMany(Array.from(collection).map(c => c.value))(self.value))
});

@@ -188,14 +240,13 @@ /**

exports.getSemigroupal = getSemigroupal;
exports.getNonEmptyApplicative = getNonEmptyApplicative;
const getMonoidal = Monoid => {
const Semigroupal = getSemigroupal(Monoid);
const Pointed = getPointed(Monoid);
return { ...Pointed,
...Semigroupal,
zipAll: collection => Semigroupal.zipMany(collection)(make(Monoid.empty))
const getApplicative = M => {
const NonEmptyApplicative = getNonEmptyApplicative(M);
return { ...getPointed(M),
...NonEmptyApplicative,
productAll: collection => NonEmptyApplicative.productMany(collection)(make(M.empty))
};
};
exports.getMonoidal = getMonoidal;
exports.getApplicative = getApplicative;
//# sourceMappingURL=Const.js.map

@@ -16,21 +16,27 @@ /**

*/
import * as bifunctor from "@fp-ts/core/Bifunctor";
import type * as extendable from "@fp-ts/core/Extendable";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";
import type { Kind, TypeLambda } from "@fp-ts/core/HKT";
import type * as monad from "@fp-ts/core/Monad";
import type { Monoid } from "@fp-ts/core/Monoid";
import type * as monoidal from "@fp-ts/core/Monoidal";
import type * as pointed from "@fp-ts/core/Pointed";
import type { Semigroup } from "@fp-ts/core/Semigroup";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as traversable from "@fp-ts/core/Traversable";
import type { NonEmptyReadonlyArray } from "@fp-ts/data/NonEmptyReadonlyArray";
import * as applicative from "@fp-ts/core/typeclass/Applicative";
import * as bicovariant from "@fp-ts/core/typeclass/Bicovariant";
import * as chainable from "@fp-ts/core/typeclass/Chainable";
import * as compactable from "@fp-ts/core/typeclass/Compactable";
import type * as coproduct_ from "@fp-ts/core/typeclass/Coproduct";
import * as covariant from "@fp-ts/core/typeclass/Covariant";
import * as filterable from "@fp-ts/core/typeclass/Filterable";
import * as flatMap_ from "@fp-ts/core/typeclass/FlatMap";
import * as foldable from "@fp-ts/core/typeclass/Foldable";
import * as invariant from "@fp-ts/core/typeclass/Invariant";
import type * as monad from "@fp-ts/core/typeclass/Monad";
import type { Monoid } from "@fp-ts/core/typeclass/Monoid";
import type * as nonEmptyAlternative from "@fp-ts/core/typeclass/NonEmptyAlternative";
import * as nonEmptyApplicative from "@fp-ts/core/typeclass/NonEmptyApplicative";
import * as nonEmptyCoproduct from "@fp-ts/core/typeclass/NonEmptyCoproduct";
import * as nonEmptyProduct from "@fp-ts/core/typeclass/NonEmptyProduct";
import * as of_ from "@fp-ts/core/typeclass/Of";
import type * as pointed from "@fp-ts/core/typeclass/Pointed";
import * as product_ from "@fp-ts/core/typeclass/Product";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as traversable from "@fp-ts/core/typeclass/Traversable";
import type { Option } from "@fp-ts/data/Option";
import type { Predicate } from "@fp-ts/data/Predicate";
import type { Refinement } from "@fp-ts/data/Refinement";
import type { Compactable } from "@fp-ts/data/typeclasses/Compactable";
import type * as filterable from "@fp-ts/data/typeclasses/Filterable";
import type { TraversableFilterable } from "@fp-ts/data/typeclasses/TraversableFilterable";
/**

@@ -62,3 +68,3 @@ * @category models

export interface EitherTypeLambda extends TypeLambda {
readonly type: Either<this["Out2"], this["Out1"]>;
readonly type: Either<this["Out1"], this["Target"]>;
}

@@ -77,3 +83,3 @@ /**

export interface ValidatedT<F extends TypeLambda, E> extends TypeLambda {
readonly type: Kind<F, this["InOut1"], this["In1"], this["Out3"], E, this["Out1"]>;
readonly type: Kind<F, this["In"], this["Out2"], E, this["Target"]>;
}

@@ -89,2 +95,322 @@ /**

/**
* Returns an effect whose Right is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
export declare const map: <A, B>(f: (a: A) => B) => <E>(self: Either<E, A>) => Either<E, B>;
/**
* @category mapping
* @since 1.0.0
*/
export declare const imap: <A, B>(to: (a: A) => B, from: (b: B) => A) => <E>(self: Either<E, A>) => Either<E, B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Invariant: invariant.Invariant<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const tupled: <E, A>(self: Either<E, A>) => Either<E, readonly [A]>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <E, A>(self: Either<E, A>) => Either<E, {
readonly [K in N]: A;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Covariant: covariant.Covariant<EitherTypeLambda>;
/**
* @category mapping
* @since 1.0.0
*/
export declare const flap: <A>(a: A) => <E, B>(fab: Either<E, (a: A) => B>) => Either<E, B>;
/**
* Maps the Right value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
export declare const as: <B>(b: B) => <E>(self: Either<E, unknown>) => Either<E, B>;
/**
* Returns the effect Eithering from mapping the Right of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
export declare const asUnit: <R, O, E, _>(self: Either<E, _>) => Either<E, void>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => <E>(self: Either<E, A>) => Either<E, {
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export {
/**
* @category do notation
* @since 1.0.0
*/
let_ as let };
/**
* Returns an effect whose Left and Right channels have been mapped by
* the specified pair of functions, `f` and `g`.
*
* @category mapping
* @since 1.0.0
*/
export declare const bimap: <E, G, A, B>(f: (e: E) => G, g: (a: A) => B) => (self: Either<E, A>) => Either<G, B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Bicovariant: bicovariant.Bicovariant<EitherTypeLambda>;
/**
* Returns an effect with its error channel mapped using the specified
* function. This can be used to lift a "smaller" error into a "larger" error.
*
* @category error handling
* @since 1.0.0
*/
export declare const mapLeft: <E, G>(f: (e: E) => G) => <A>(self: Either<E, A>) => Either<G, A>;
/**
* Constructs a new `Either` holding a `Right` value. This usually represents a Rightful value due to the right bias
* of this structure.
*
* @category constructors
* @since 1.0.0
*/
export declare const right: <A>(a: A) => Either<never, A>;
/**
* @since 1.0.0
*/
export declare const of: <A>(a: A) => Either<never, A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Of: of_.Of<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const unit: Either<never, void>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const Do: Either<never, {}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Pointed: pointed.Pointed<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const flatMap: <A, E2, B>(f: (a: A) => Either<E2, B>) => <E1>(self: Either<E1, A>) => Either<E2 | E1, B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const FlatMap: flatMap_.FlatMap<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const flatten: <E1, E2, A>(mma: Either<E1, Either<E2, A>>) => Either<E1 | E2, A>;
/**
* @since 1.0.0
*/
export declare const andThen: <E2, B>(that: Either<E2, B>) => <E1, _>(self: Either<E1, _>) => Either<E2 | E1, B>;
/**
* @since 1.0.0
*/
export declare const composeKleisliArrow: <B, E2, C>(bfc: (b: B) => Either<E2, C>) => <A, E1>(afb: (a: A) => Either<E1, B>) => (a: A) => Either<E2 | E1, C>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Chainable: chainable.Chainable<EitherTypeLambda>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, E2, B>(name: Exclude<N, keyof A>, f: (a: A) => Either<E2, B>) => <E1>(self: Either<E1, A>) => Either<E1 | E2, {
readonly [K in keyof A | N]: K extends keyof A ? A[K] : B;
}>;
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
export declare const tap: <A, E2, _>(f: (a: A) => Either<E2, _>) => <E1>(self: Either<E1, A>) => Either<E2 | E1, A>;
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const andThenDiscard: <R2, O2, E2, _>(that: Either<E2, _>) => <R1, O1, E1, A>(self: Either<E1, A>) => Either<E2 | E1, A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monad: monad.Monad<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const product: <E2, B>(that: Either<E2, B>) => <E1, A>(self: Either<E1, A>) => Either<E2 | E1, readonly [A, B]>;
/**
* @since 1.0.0
*/
export declare const productMany: <E, A>(collection: Iterable<Either<E, A>>) => (self: Either<E, A>) => Either<E, [A, ...A[]]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<EitherTypeLambda>;
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
export declare const bindEither: <N extends string, A extends object, E2, B>(name: Exclude<N, keyof A>, fb: Either<E2, B>) => <E1>(self: Either<E1, A>) => Either<E2 | E1, {
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* @since 1.0.0
*/
export declare const productFlatten: <E2, B>(that: Either<E2, B>) => <E1, A extends ReadonlyArray<any>>(self: Either<E1, A>) => Either<E2 | E1, readonly [...A, B]>;
/**
* @since 1.0.0
*/
export declare const productAll: <E, A>(collection: Iterable<Either<E, A>>) => Either<E, readonly A[]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Product: product_.Product<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const tuple: <T extends ReadonlyArray<Either<any, any>>>(...tuple: T) => Either<[
T[number]
] extends [Either<infer E, any>] ? E : never, Readonly<{
[I in keyof T]: [T[I]] extends [Either<any, infer A>] ? A : never;
}>>;
/**
* @since 1.0.0
*/
export declare const struct: <R extends Record<string, Either<any, any>>>(r: R) => Either<[
R[keyof R]
] extends [Either<infer E, any>] ? E : never, {
readonly [K in keyof R]: [R[K]] extends [Either<any, infer A>] ? A : never;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<EitherTypeLambda>;
/**
* @category lifting
* @since 1.0.0
*/
export declare const liftSemigroup: <A>(S: Semigroup<A>) => <E>() => Semigroup<Either<E, A>>;
/**
* @category lifting
* @since 1.0.0
*/
export declare const lift2: <A, B, C>(f: (a: A, b: B) => C) => <E1, E2>(fa: Either<E1, A>, fb: Either<E2, B>) => Either<E1 | E2, C>;
/**
* @category lifting
* @since 1.0.0
*/
export declare const lift3: <A, B, C, D>(f: (a: A, b: B, c: C) => D) => <E1, E2, E3>(fa: Either<E1, A>, fb: Either<E2, B>, fc: Either<E3, C>) => Either<E1 | E2 | E3, D>;
/**
* @since 1.0.0
*/
export declare const ap: <E2, A>(fa: Either<E2, A>) => <E1, B>(self: Either<E1, (a: A) => B>) => Either<E2 | E1, B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Applicative: applicative.Applicative<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const liftMonoid: <A, E>(M: Monoid<A>) => Monoid<Either<E, A>>;
/**
* @since 1.0.0
*/
export declare const coproduct: <E2, B>(that: Either<E2, B>) => <E1, A>(self: Either<E1, A>) => Either<E2 | E1, B | A>;
/**
* @since 1.0.0
*/
export declare const coproductMany: <E, A>(collection: Iterable<Either<E, A>>) => (self: Either<E, A>) => Either<E, A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyCoproduct: nonEmptyCoproduct.NonEmptyCoproduct<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const getSemigroup: <A>() => Semigroup<Either<never, A>>;
/**
* @since 1.0.0
*/
export declare const coproductEither: <E2, B>(that: Either<E2, B>) => <E1, A>(self: Either<E1, A>) => Either<E2 | E1, Either<A, B>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyAlternative: nonEmptyAlternative.NonEmptyAlternative<EitherTypeLambda>;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduce: <B, A>(b: B, f: (b: B, a: A) => B) => <E>(self: Either<E, A>) => B;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (b: B, a: A) => B) => <E>(self: Either<E, A>) => B;
/**
* @category instances
* @since 1.0.0
*/
export declare const Foldable: foldable.Foldable<EitherTypeLambda>;
/**
* @category folding
* @since 1.0.0
*/
export declare const foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => <E>(self: Either<E, A>) => M;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toReadonlyArray: <E, A>(self: Either<E, A>) => ReadonlyArray<A>;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toReadonlyArrayWith: <A, B>(f: (a: A) => B) => <E>(self: Either<E, A>) => ReadonlyArray<B>;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => <TE>(self: Either<TE, A>) => Kind<G, R, O, E, B>;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRightKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => <TE>(self: Either<TE, A>) => Kind<G, R, O, E, B>;
/**
* @category folding
* @since 1.0.0
*/
export declare const foldMapKind: <G extends TypeLambda>(G: coproduct_.Coproduct<G>) => <A, R, O, E, B>(f: (a: A) => Kind<G, R, O, E, B>) => <TE>(self: Either<TE, A>) => Kind<G, R, O, E, B>;
/**
* Returns `true` if the either is an instance of `Left`, `false` otherwise.

@@ -112,10 +438,2 @@ *

/**
* Constructs a new `Either` holding a `Right` value. This usually represents a Rightful value due to the right bias
* of this structure.
*
* @category constructors
* @since 1.0.0
*/
export declare const right: <A>(a: A) => Either<never, A>;
/**
* Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the first function,

@@ -253,10 +571,2 @@ * if the value is a `Right` the inner value is applied to the second function.

/**
* Returns an effect whose Left and Right channels have been mapped by
* the specified pair of functions, `f` and `g`.
*
* @category mapping
* @since 1.0.0
*/
export declare const mapBoth: <E, G, A, B>(f: (e: E) => G, g: (a: A) => B) => (self: Either<E, A>) => Either<G, B>;
/**
* Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to

@@ -312,51 +622,11 @@ * types of kind `* -> *`.

/**
* @category filtering
* @since 1.0.0
*/
export declare const extend: <E, A, B>(f: (wa: Either<E, A>) => B) => (wa: Either<E, A>) => Either<E, B>;
export declare const compact: <E>(onNone: E) => <A>(self: Either<E, Option<A>>) => Either<E, A>;
/**
* @since 1.0.0
*/
export declare const duplicate: <E, A>(ma: Either<E, A>) => Either<E, Either<E, A>>;
/**
* Map each element of a structure to an action, evaluate these actions from left to right, and collect the Eithers.
*
* @example
* import { pipe } from '@fp-ts/data/Function'
* import * as RA from '@fp-ts/data/ReadonlyArray'
* import * as E from '@fp-ts/data/Either'
* import * as O from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(
* pipe(E.right(['a']), E.traverse(O.Monoidal)(RA.head)),
* O.some(E.right('a')),
* )
*
* assert.deepStrictEqual(
* pipe(E.right([]), E.traverse(O.Monoidal)(RA.head)),
* O.none,
* )
*
* @category traversing
* @since 1.0.0
*/
export declare const traverse: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <A, FS, FR, FO, FE, B>(f: (a: A) => Kind<F, FS, FR, FO, FE, B>) => <E>(ta: Either<E, A>) => Kind<F, FS, FR, FO, FE, Either<E, B>>;
/**
* Semigroup returning the left-most non-`Left` value. If both operands are `Right`es then the inner values are
* combined using the provided `Semigroup`.
*
* @example
* import * as E from '@fp-ts/data/Either'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const S = E.getSemigroup(N.SemigroupSum)<string>()
* assert.deepStrictEqual(pipe(E.left('a'), S.combine(E.left('b'))), E.left('a'))
* assert.deepStrictEqual(pipe(E.left('a'), S.combine(E.right(2))), E.right(2))
* assert.deepStrictEqual(pipe(E.right(1), S.combine(E.left('b'))), E.right(1))
* assert.deepStrictEqual(pipe(E.right(1), S.combine(E.right(2))), E.right(3))
*
* @category instances
* @since 1.0.0
*/
export declare const getSemigroup: <A>(Semigroup: Semigroup<A>) => <E>() => Semigroup<Either<E, A>>;
export declare const getCompactable: <E>(onNone: E) => compactable.Compactable<ValidatedT<EitherTypeLambda, E>>;
/**

@@ -366,3 +636,3 @@ * @category filtering

*/
export declare const compact: <E>(onNone: E) => <A>(self: Either<E, Option<A>>) => Either<E, A>;
export declare const separate: <E>(onEmpty: E) => <A, B>(self: Either<E, Either<A, B>>) => readonly [Either<E, A>, Either<E, B>];
/**

@@ -372,18 +642,19 @@ * @category filtering

*/
export declare const separate: <E>(onEmpty: E) => <A, B>(self: Either<E, Either<A, B>>) => readonly [Either<E, A>, Either<E, B>];
export declare const filter: {
<C extends A, B extends A, E2, A = C>(refinement: Refinement<A, B>, onFalse: E2): <E1>(self: Either<E1, C>) => Either<E2 | E1, B>;
<B extends A, E2, A = B>(predicate: Predicate<A>, onFalse: E2): <E1>(self: Either<E1, B>) => Either<E2 | E1, B>;
};
/**
* @category instances
* @category filtering
* @since 1.0.0
*/
export declare const getCompactable: <E>(onNone: E) => Compactable<ValidatedT<EitherTypeLambda, E>>;
export declare const filterMap: <A, B, E>(f: (a: A) => Option<B>, onNone: E) => (self: Either<E, A>) => Either<E, B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const getFilterable: <E>(onEmpty: E) => filterable.Filterable<ValidatedT<EitherTypeLambda, E>>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const traverseFilterMap: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <A, S, R, O, FE, B, E>(f: (a: A) => Kind<F, S, R, O, FE, Option<B>>, onNone: E) => (self: Either<E, A>) => Kind<F, S, R, O, FE, Either<E, B>>;
export declare const partition: {
<C extends A, B extends A, E, A = C>(refinement: Refinement<A, B>, onFalse: E): (self: Either<E, C>) => readonly [Either<E, C>, Either<E, B>];
<B extends A, E, A = B>(predicate: Predicate<A>, onFalse: E): (self: Either<E, B>) => readonly [Either<E, B>, Either<E, B>];
};
/**

@@ -393,3 +664,3 @@ * @category filtering

*/
export declare const traversePartitionMap: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <A, S, R, O, FE, B, C, E>(f: (a: A) => Kind<F, S, R, O, FE, Either<B, C>>, onNone: E) => (self: Either<E, A>) => Kind<F, S, R, O, FE, readonly [Either<E, B>, Either<E, C>]>;
export declare const partitionMap: <A, B, C, E>(f: (a: A) => Either<B, C>, onEmpty: E) => (self: Either<E, A>) => readonly [Either<E, B>, Either<E, C>];
/**

@@ -399,186 +670,24 @@ * @category instances

*/
export declare const getTraversableFilterable: <E>(onEmpty: E) => TraversableFilterable<ValidatedT<EitherTypeLambda, E>>;
export declare const getFilterable: <E>(onEmpty: E) => filterable.Filterable<ValidatedT<EitherTypeLambda, E>>;
/**
* @category instances
* @category traversing
* @since 1.0.0
*/
export declare const Bifunctor: bifunctor.Bifunctor<EitherTypeLambda>;
export declare const traverse: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, FR, FO, FE, B>(f: (a: A) => Kind<F, FR, FO, FE, B>) => <E>(ta: Either<E, A>) => Kind<F, FR, FO, FE, Either<E, B>>;
/**
* Returns an effect with its error channel mapped using the specified
* function. This can be used to lift a "smaller" error into a "larger" error.
*
* @category error handling
* @since 1.0.0
*/
export declare const mapError: <E, G>(f: (e: E) => G) => <A>(self: Either<E, A>) => Either<G, A>;
/**
* Returns an effect whose Right is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
export declare const map: <A, B>(f: (a: A) => B) => <E>(fa: Either<E, A>) => Either<E, B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Functor: functor.Functor<EitherTypeLambda>;
export declare const Traversable: traversable.Traversable<EitherTypeLambda>;
/**
* @category mapping
* @category traversing
* @since 1.0.0
*/
export declare const flap: <A>(a: A) => <E, B>(fab: Either<E, (a: A) => B>) => Either<E, B>;
export declare const sequence: <F extends TypeLambda>(F: applicative.Applicative<F>) => <E, FR, FO, FE, A>(fa: Either<E, Kind<F, FR, FO, FE, A>>) => Kind<F, FR, FO, FE, Either<E, A>>;
/**
* Maps the Right value of this effect to the specified constant value.
*
* @category mapping
* @category traversing
* @since 1.0.0
*/
export declare const as: <B>(b: B) => <E>(self: Either<E, unknown>) => Either<E, B>;
export declare const traverseTap: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => <TE>(self: Either<TE, A>) => Kind<F, R, O, E, Either<TE, A>>;
/**
* Returns the effect Eithering from mapping the Right of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
export declare const unit: <E>(self: Either<E, unknown>) => Either<E, void>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Succeed: pointed.Pointed<EitherTypeLambda>;
/**
* @category sequencing
* @since 1.0.0
*/
export declare const flatMap: <A, E2, B>(f: (a: A) => Either<E2, B>) => <E1>(self: Either<E1, A>) => Either<E1 | E2, B>;
/**
* The `flatten` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.
*
* @example
* import * as E from '@fp-ts/data/Either'
*
* assert.deepStrictEqual(E.flatten(E.right(E.right('a'))), E.right('a'))
* assert.deepStrictEqual(E.flatten(E.right(E.left('e'))), E.left('e'))
* assert.deepStrictEqual(E.flatten(E.left('e')), E.left('e'))
*
* @category sequencing
* @since 1.0.0
*/
export declare const flatten: <E1, E2, A>(mma: Either<E1, Either<E2, A>>) => Either<E1 | E2, A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const FlatMap: flatMap_.FlatMap<EitherTypeLambda>;
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const zipLeft: <E2>(that: Either<E2, unknown>) => <E1, A>(self: Either<E1, A>) => Either<E2 | E1, A>;
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const zipRight: <E2, A>(that: Either<E2, A>) => <E1>(self: Either<E1, unknown>) => Either<E2 | E1, A>;
/**
* Sequentially zips this effect with the specified effect using the specified combiner function.
*
* @category tuple sequencing
* @since 1.0.0
*/
export declare const zipWith: <E2, B, A, C>(that: Either<E2, B>, f: (a: A, b: B) => C) => <E1>(self: Either<E1, A>) => Either<E2 | E1, C>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Semigroupal: semigroupal.Semigroupal<EitherTypeLambda>;
/**
* @since 1.0.0
*/
export declare const ap: <E2, A>(fa: Either<E2, A>) => <E1, B>(fab: Either<E1, (a: A) => B>) => Either<E1 | E2, B>;
/**
* Lifts a binary function into `Either`.
*
* @category lifting
* @since 1.0.0
*/
export declare const lift2: <A, B, C>(f: (a: A, b: B) => C) => <E1, E2>(fa: Either<E1, A>, fb: Either<E2, B>) => Either<E1 | E2, C>;
/**
* Lifts a ternary function into `Either`.
*
* @category lifting
* @since 1.0.0
*/
export declare const lift3: <A, B, C, D>(f: (a: A, b: B, c: C) => D) => <E1, E2, E3>(fa: Either<E1, A>, fb: Either<E2, B>, fc: Either<E3, C>) => Either<E1 | E2 | E3, D>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monoidal: monoidal.Monoidal<EitherTypeLambda>;
/**
* The default [`Monoidal`](#monoidal) instance returns the first error, if you want to
* get all errors you need to provide a way to combine them via a `Semigroup`.
*
* @example
* import * as A from '@fp-ts/core/Semigroupal'
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
* import * as S from '@fp-ts/core/Semigroup'
* import * as string from '@fp-ts/data/String'
*
* const parseString = (u: unknown): E.Either<string, string> =>
* typeof u === 'string' ? E.right(u) : E.left('not a string')
*
* const parseNumber = (u: unknown): E.Either<string, number> =>
* typeof u === 'number' ? E.right(u) : E.left('not a number')
*
* interface Person {
* readonly name: string
* readonly age: number
* }
*
* const parsePerson = (
* input: Record<string, unknown>
* ): E.Either<string, Person> =>
* pipe(
* E.Do,
* E.bindRight('name', parseString(input.name)),
* E.bindRight('age', parseNumber(input.age))
* )
*
* assert.deepStrictEqual(parsePerson({}), E.left('not a string')) // <= first error
*
* const Monoidal = E.getValidatedMonoidal(
* pipe(string.Semigroup, S.intercalate(', '))
* )
*
* const bindRight = A.bindRight(Monoidal)
*
* const parsePersonAll = (
* input: Record<string, unknown>
* ): E.Either<string, Person> =>
* pipe(
* E.Do,
* bindRight('name', parseString(input.name)),
* bindRight('age', parseNumber(input.age))
* )
*
* assert.deepStrictEqual(parsePersonAll({}), E.left('not a string, not a number')) // <= all errors
*
* @category error handling
* @since 1.0.0
*/
export declare const getValidatedMonoidal: <E>(Semigroup: Semigroup<E>) => monoidal.Monoidal<ValidatedT<EitherTypeLambda, E>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monad: monad.Monad<EitherTypeLambda>;
/**
* Returns an effect that effectfully "peeks" at the Left of this effect.

@@ -591,43 +700,2 @@ *

/**
* Returns an effect that effectfully "peeks" at the Right of this effect.
*
* @since 1.0.0
*/
export declare const tap: <A, E2>(f: (a: A) => Either<E2, unknown>) => <E1>(self: Either<E1, A>) => Either<E1 | E2, A>;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toReadonlyArray: <E, A>(self: Either<E, A>) => readonly A[];
/**
* @category folding
* @since 1.0.0
*/
export declare const reduce: <B, A>(b: B, f: (b: B, a: A) => B) => <E>(self: Either<E, A>) => B;
/**
* @category folding
* @since 1.0.0
*/
export declare const foldMap: <M>(Monoid: Monoid<M>) => <A>(f: (a: A) => M) => <E>(self: Either<E, A>) => M;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (a: A, b: B) => B) => <E>(self: Either<E, A>) => B;
/**
* @category instances
* @since 1.0.0
*/
export declare const Traversable: traversable.Traversable<EitherTypeLambda>;
/**
* @category traversing
* @since 1.0.0
*/
export declare const sequence: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <E, FS, FR, FO, FE, A>(fa: Either<E, Kind<F, FS, FR, FO, FE, A>>) => Kind<F, FS, FR, FO, FE, Either<E, A>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Extendable: extendable.Extendable<EitherTypeLambda>;
/**
* @example

@@ -728,54 +796,2 @@ * import * as E from '@fp-ts/data/Either'

/**
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.filter((n) => n > 0, 'error')
* ),
* E.right(1)
* )
* assert.deepStrictEqual(
* pipe(
* E.right(-1),
* E.filter((n) => n > 0, 'error')
* ),
* E.left('error')
* )
* assert.deepStrictEqual(
* pipe(
* E.left('a'),
* E.filter((n) => n > 0, 'error')
* ),
* E.left('a')
* )
*
* @category filtering
* @since 1.0.0
*/
export declare const filter: {
<C extends A, B extends A, E2, A = C>(refinement: Refinement<A, B>, onFalse: E2): <E1>(self: Either<E1, C>) => Either<E2 | E1, B>;
<B extends A, E2, A = B>(predicate: Predicate<A>, onFalse: E2): <E1>(self: Either<E1, B>) => Either<E2 | E1, B>;
};
/**
* @category filtering
* @since 1.0.0
*/
export declare const filterMap: <A, B, E>(f: (a: A) => Option<B>, onNone: E) => (self: Either<E, A>) => Either<E, B>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const partition: {
<C extends A, B extends A, E, A = C>(refinement: Refinement<A, B>, onFalse: E): (self: Either<E, C>) => readonly [Either<E, C>, Either<E, B>];
<B extends A, E, A = B>(predicate: Predicate<A>, onFalse: E): (self: Either<E, B>) => readonly [Either<E, B>, Either<E, B>];
};
/**
* @category filtering
* @since 1.0.0
*/
export declare const partitionMap: <A, B, C, E>(f: (a: A) => Either<B, C>, onEmpty: E) => (self: Either<E, A>) => readonly [Either<E, B>, Either<E, C>];
/**
* @category sequencing

@@ -806,91 +822,2 @@ * @since 1.0.0

export declare const exists: <A>(predicate: Predicate<A>) => (ma: Either<unknown, A>) => boolean;
/**
* @category do notation
* @since 1.0.0
*/
export declare const Do: Either<never, {}>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <E, A>(self: Either<E, A>) => Either<E, {
readonly [K in N]: A;
}>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => <E>(self: Either<E, A>) => Either<E, {
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export {
/**
* @category do notation
* @since 1.0.0
*/
let_ as let };
/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, E2, B>(name: Exclude<N, keyof A>, f: (a: A) => Either<E2, B>) => <E1>(self: Either<E1, A>) => Either<E1 | E2, {
readonly [K in keyof A | N]: K extends keyof A ? A[K] : B;
}>;
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
export declare const bindRight: <N extends string, A extends object, E2, B>(name: Exclude<N, keyof A>, fb: Either<E2, B>) => <E1>(self: Either<E1, A>) => Either<E1 | E2, {
readonly [K in keyof A | N]: K extends keyof A ? A[K] : B;
}>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const Zip: Either<never, readonly []>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const tupled: <E, A>(self: Either<E, A>) => Either<E, readonly [A]>;
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
export declare const zipFlatten: <E2, B>(fb: Either<E2, B>) => <E1, A extends ReadonlyArray<unknown>>(self: Either<E1, A>) => Either<E1 | E2, readonly [...A, B]>;
/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseNonEmptyReadonlyArrayWithIndex: <A, E, B>(f: (index: number, a: A) => Either<E, B>) => (as: readonly [A, ...A[]]) => Either<E, readonly [B, ...B[]]>;
/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseReadonlyArrayWithIndex: <A, E, B>(f: (index: number, a: A) => Either<E, B>) => (as: readonly A[]) => Either<E, readonly B[]>;
/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseNonEmptyReadonlyArray: <A, E, B>(f: (a: A) => Either<E, B>) => (as: readonly [A, ...A[]]) => Either<E, readonly [B, ...B[]]>;
/**
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseReadonlyArray: <A, E, B>(f: (a: A) => Either<E, B>) => (as: readonly A[]) => Either<E, readonly B[]>;
/**
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const sequenceReadonlyArray: <E, A>(arr: ReadonlyArray<Either<E, A>>) => Either<E, ReadonlyArray<A>>;
//# sourceMappingURL=Either.d.ts.map

@@ -6,16 +6,36 @@ "use strict";

});
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.unit = exports.tupled = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyArray = exports.traversePartitionMap = exports.traverseNonEmptyReadonlyArrayWithIndex = exports.traverseNonEmptyReadonlyArray = exports.traverseFilterMap = exports.traverse = exports.toUnion = exports.toUndefined = exports.toReadonlyArray = exports.toNull = exports.tapError = exports.tap = exports.sequenceReadonlyArray = exports.sequence = exports.separate = exports.right = exports.reverse = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.orElse = exports.match = exports.mapError = exports.mapBoth = exports.map = exports.liftThrowable = exports.liftPredicate = exports.liftOption = exports.liftNullable = exports.lift3 = exports.lift2 = exports.let = exports.left = exports.isRight = exports.isLeft = exports.isEither = exports.getValidatedMonoidal = exports.getTraversableFilterable = exports.getSemigroup = exports.getRight = exports.getOrElse = exports.getLeft = exports.getFilterable = exports.getCompactable = exports.fromThrowable = exports.fromOption = exports.fromNullable = exports.foldMap = exports.flatten = exports.flatMapOption = exports.flatMapNullable = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.extend = exports.exists = exports.elem = exports.duplicate = exports.compact = exports.catchAll = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.ap = exports.Zip = exports.Traversable = exports.Succeed = exports.Semigroupal = exports.Monoidal = exports.Monad = exports.Functor = exports.FlatMap = exports.Extendable = exports.Do = exports.Bifunctor = void 0;
exports.unit = exports.tupled = exports.tuple = exports.traverseTap = exports.traverse = exports.toUnion = exports.toUndefined = exports.toReadonlyArrayWith = exports.toReadonlyArray = exports.toNull = exports.tapError = exports.tap = exports.struct = exports.sequence = exports.separate = exports.right = exports.reverse = exports.reduceRightKind = exports.reduceRight = exports.reduceKind = exports.reduce = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.partitionMap = exports.partition = exports.orElse = exports.of = exports.match = exports.mapLeft = exports.map = exports.liftThrowable = exports.liftSemigroup = exports.liftPredicate = exports.liftOption = exports.liftNullable = exports.liftMonoid = exports.lift3 = exports.lift2 = exports.let = exports.left = exports.isRight = exports.isLeft = exports.isEither = exports.imap = exports.getSemigroup = exports.getRight = exports.getOrElse = exports.getLeft = exports.getFilterable = exports.getCompactable = exports.fromThrowable = exports.fromOption = exports.fromNullable = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMapOption = exports.flatMapNullable = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.exists = exports.elem = exports.coproductMany = exports.coproductEither = exports.coproduct = exports.composeKleisliArrow = exports.compact = exports.catchAll = exports.bindTo = exports.bindEither = exports.bind = exports.bimap = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThen = exports.Traversable = exports.Product = exports.Pointed = exports.Of = exports.NonEmptyProduct = exports.NonEmptyCoproduct = exports.NonEmptyApplicative = exports.NonEmptyAlternative = exports.Monad = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Do = exports.Covariant = exports.Chainable = exports.Bicovariant = exports.Applicative = void 0;
var bifunctor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Bifunctor"));
var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var bicovariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Bicovariant"));
var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));
var chainable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Chainable"));
var _Semigroup = /*#__PURE__*/require("@fp-ts/core/Semigroup");
var compactable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Compactable"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var covariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Covariant"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Traversable"));
var filterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Filterable"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/FlatMap"));
var foldable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Foldable"));
var invariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Invariant"));
var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var nonEmptyCoproduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyCoproduct"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));
var _Equal = /*#__PURE__*/require("@fp-ts/data/Equal");

@@ -29,4 +49,2 @@

var _Predicate = /*#__PURE__*/require("@fp-ts/data/Predicate");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

@@ -37,26 +55,524 @@

/**
* ```ts
* type Either<E, A> = Left<E> | Right<A>
* ```
* Returns `true` if the specified value is an instance of `Either`, `false`
* otherwise.
*
* Represents a value of one of two possible types (a disjoint union).
* @category guards
* @since 1.0.0
*/
const isEither = either.isEither;
/**
* Returns an effect whose Right is mapped by the specified `f` function.
*
* An instance of `Either` is either an instance of `Left` or `Right`.
* @category mapping
* @since 1.0.0
*/
exports.isEither = isEither;
const map = f => self => isRight(self) ? right(f(self.right)) : self;
/**
* @category mapping
* @since 1.0.0
*/
exports.map = map;
const imap = /*#__PURE__*/covariant.imap(map);
/**
* @category instances
* @since 1.0.0
*/
exports.imap = imap;
const Invariant = {
imap
};
/**
* @since 1.0.0
*/
exports.Invariant = Invariant;
const tupled = /*#__PURE__*/invariant.tupled(Invariant);
/**
* @category do notation
* @since 1.0.0
*/
exports.tupled = tupled;
const bindTo = /*#__PURE__*/invariant.bindTo(Invariant);
/**
* @category instances
* @since 1.0.0
*/
exports.bindTo = bindTo;
const Covariant = { ...Invariant,
map
};
/**
* @category mapping
* @since 1.0.0
*/
exports.Covariant = Covariant;
const flap = /*#__PURE__*/covariant.flap(Covariant);
/**
* Maps the Right value of this effect to the specified constant value.
*
* A common use of `Either` is as an alternative to `Option` for dealing with possible missing values. In this usage,
* `None` is replaced with a `Left` which can contain useful information. `Right` takes the place of `Some`. Convention
* dictates that `Left` is used for Left and `Right` is used for Right.
* @category mapping
* @since 1.0.0
*/
exports.flap = flap;
const as = /*#__PURE__*/covariant.as(Covariant);
/**
* Returns the effect Eithering from mapping the Right of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
exports.as = as;
const asUnit = /*#__PURE__*/covariant.asUnit(Covariant);
exports.asUnit = asUnit;
const let_ = /*#__PURE__*/covariant.let(Covariant);
exports.let = let_;
/**
* Returns `true` if the specified value is an instance of `Either`, `false`
* otherwise.
* Returns an effect whose Left and Right channels have been mapped by
* the specified pair of functions, `f` and `g`.
*
* @category guards
* @category mapping
* @since 1.0.0
*/
const isEither = either.isEither;
const bimap = (f, g) => self => isLeft(self) ? left(f(self.left)) : right(g(self.right));
/**
* @category instances
* @since 1.0.0
*/
exports.bimap = bimap;
const Bicovariant = {
bimap
};
/**
* Returns an effect with its error channel mapped using the specified
* function. This can be used to lift a "smaller" error into a "larger" error.
*
* @category error handling
* @since 1.0.0
*/
exports.Bicovariant = Bicovariant;
const mapLeft = /*#__PURE__*/bicovariant.mapLeft(Bicovariant);
/**
* Constructs a new `Either` holding a `Right` value. This usually represents a Rightful value due to the right bias
* of this structure.
*
* @category constructors
* @since 1.0.0
*/
exports.mapLeft = mapLeft;
const right = either.right;
/**
* @since 1.0.0
*/
exports.right = right;
const of = right;
/**
* @category instances
* @since 1.0.0
*/
exports.of = of;
const Of = {
of
};
/**
* @since 1.0.0
*/
exports.Of = Of;
const unit = /*#__PURE__*/of_.unit(Of);
/**
* @category do notation
* @since 1.0.0
*/
exports.unit = unit;
const Do = /*#__PURE__*/of_.Do(Of);
/**
* @category instances
* @since 1.0.0
*/
exports.Do = Do;
const Pointed = { ...Of,
...Covariant
};
/**
* @since 1.0.0
*/
exports.Pointed = Pointed;
const flatMap = f => self => isLeft(self) ? self : f(self.right);
/**
* @category instances
* @since 1.0.0
*/
exports.flatMap = flatMap;
const FlatMap = {
flatMap
};
/**
* @since 1.0.0
*/
exports.FlatMap = FlatMap;
const flatten = /*#__PURE__*/flatMap_.flatten(FlatMap);
/**
* @since 1.0.0
*/
exports.flatten = flatten;
const andThen = /*#__PURE__*/flatMap_.andThen(FlatMap);
/**
* @since 1.0.0
*/
exports.andThen = andThen;
const composeKleisliArrow = /*#__PURE__*/flatMap_.composeKleisliArrow(FlatMap);
/**
* @category instances
* @since 1.0.0
*/
exports.composeKleisliArrow = composeKleisliArrow;
const Chainable = { ...FlatMap,
...Covariant
};
/**
* @category do notation
* @since 1.0.0
*/
exports.Chainable = Chainable;
const bind = /*#__PURE__*/chainable.bind(Chainable);
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
exports.bind = bind;
const tap = /*#__PURE__*/chainable.tap(Chainable);
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
exports.tap = tap;
const andThenDiscard = /*#__PURE__*/chainable.andThenDiscard(Chainable);
/**
* @category instances
* @since 1.0.0
*/
exports.andThenDiscard = andThenDiscard;
const Monad = { ...Pointed,
...FlatMap
};
/**
* @since 1.0.0
*/
exports.Monad = Monad;
const product = that => self => isRight(self) ? isRight(that) ? right([self.right, that.right]) : that : self;
/**
* @since 1.0.0
*/
exports.product = product;
const productMany = collection => self => {
if (isLeft(self)) {
return self;
}
const out = [self.right];
for (const e of collection) {
if (isLeft(e)) {
return e;
}
out.push(e.right);
}
return right(out);
};
/**
* @category instances
* @since 1.0.0
*/
exports.productMany = productMany;
const NonEmptyProduct = { ...Invariant,
product,
productMany
};
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
exports.NonEmptyProduct = NonEmptyProduct;
const bindEither = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
/**
* @since 1.0.0
*/
exports.bindEither = bindEither;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
/**
* @since 1.0.0
*/
exports.productFlatten = productFlatten;
const productAll = collection => {
const out = [];
for (const e of collection) {
if (isLeft(e)) {
return e;
}
out.push(e.right);
}
return right(out);
};
/**
* @category instances
* @since 1.0.0
*/
exports.productAll = productAll;
const Product = { ...Of,
...NonEmptyProduct,
productAll
};
/**
* @since 1.0.0
*/
exports.Product = Product;
const tuple = /*#__PURE__*/product_.tuple(Product);
/**
* @since 1.0.0
*/
exports.tuple = tuple;
const struct = /*#__PURE__*/product_.struct(Product);
/**
* @category instances
* @since 1.0.0
*/
exports.struct = struct;
const NonEmptyApplicative = { ...NonEmptyProduct,
...Covariant
};
/**
* @category lifting
* @since 1.0.0
*/
exports.NonEmptyApplicative = NonEmptyApplicative;
const liftSemigroup = S => () => semigroup.fromCombine(that => self => isLeft(that) ? self : isLeft(self) ? that : right(S.combine(that.right)(self.right)));
/**
* @category lifting
* @since 1.0.0
*/
exports.liftSemigroup = liftSemigroup;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
/**
* @category lifting
* @since 1.0.0
*/
exports.lift2 = lift2;
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
/**
* @since 1.0.0
*/
exports.lift3 = lift3;
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
/**
* @category instances
* @since 1.0.0
*/
exports.ap = ap;
const Applicative = { ...NonEmptyApplicative,
...Product
};
/**
* @since 1.0.0
*/
exports.Applicative = Applicative;
const liftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
/**
* @since 1.0.0
*/
exports.liftMonoid = liftMonoid;
const coproduct = that => self => isRight(self) ? self : that;
/**
* @since 1.0.0
*/
exports.coproduct = coproduct;
const coproductMany = collection => self => {
let out = self;
if (isRight(out)) {
return out;
}
for (out of collection) {
if (isRight(out)) {
return out;
}
}
return out;
};
/**
* @category instances
* @since 1.0.0
*/
exports.coproductMany = coproductMany;
const NonEmptyCoproduct = { ...Invariant,
coproduct,
coproductMany
};
/**
* @since 1.0.0
*/
exports.NonEmptyCoproduct = NonEmptyCoproduct;
const getSemigroup = /*#__PURE__*/nonEmptyCoproduct.getSemigroup(NonEmptyCoproduct);
/**
* @since 1.0.0
*/
exports.getSemigroup = getSemigroup;
const coproductEither = /*#__PURE__*/nonEmptyCoproduct.coproductEither(NonEmptyCoproduct);
/**
* @category instances
* @since 1.0.0
*/
exports.coproductEither = coproductEither;
const NonEmptyAlternative = { ...Covariant,
...NonEmptyCoproduct
};
/**
* @category folding
* @since 1.0.0
*/
exports.NonEmptyAlternative = NonEmptyAlternative;
const reduce = (b, f) => self => isLeft(self) ? b : f(b, self.right);
/**
* @category folding
* @since 1.0.0
*/
exports.reduce = reduce;
const reduceRight = (b, f) => self => isLeft(self) ? b : f(b, self.right);
/**
* @category instances
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
const Foldable = {
reduce,
reduceRight
};
/**
* @category folding
* @since 1.0.0
*/
exports.Foldable = Foldable;
const foldMap = /*#__PURE__*/foldable.foldMap(Foldable);
/**
* @category conversions
* @since 1.0.0
*/
exports.foldMap = foldMap;
const toReadonlyArray = /*#__PURE__*/foldable.toReadonlyArray(Foldable);
/**
* @category conversions
* @since 1.0.0
*/
exports.toReadonlyArray = toReadonlyArray;
const toReadonlyArrayWith = /*#__PURE__*/foldable.toReadonlyArrayWith(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.toReadonlyArrayWith = toReadonlyArrayWith;
const reduceKind = /*#__PURE__*/foldable.reduceKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.reduceKind = reduceKind;
const reduceRightKind = /*#__PURE__*/foldable.reduceRightKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.reduceRightKind = reduceRightKind;
const foldMapKind = /*#__PURE__*/foldable.foldMapKind(Foldable);
/**
* Returns `true` if the either is an instance of `Left`, `false` otherwise.

@@ -68,3 +584,3 @@ *

exports.isEither = isEither;
exports.foldMapKind = foldMapKind;
const isLeft = either.isLeft;

@@ -89,13 +605,3 @@ /**

exports.isRight = isRight;
const left = either.left;
/**
* Constructs a new `Either` holding a `Right` value. This usually represents a Rightful value due to the right bias
* of this structure.
*
* @category constructors
* @since 1.0.0
*/
exports.left = left;
const right = either.right; // -------------------------------------------------------------------------------------
const left = either.left; // -------------------------------------------------------------------------------------
// pattern matching

@@ -135,3 +641,3 @@ // -------------------------------------------------------------------------------------

exports.right = right;
exports.left = left;

@@ -282,14 +788,2 @@ const match = (onError, onRight) => self => isLeft(self) ? onError(self.left) : onRight(self.right);

/**
* Returns an effect whose Left and Right channels have been mapped by
* the specified pair of functions, `f` and `g`.
*
* @category mapping
* @since 1.0.0
*/
exports.catchAll = catchAll;
const mapBoth = (f, g) => fa => isLeft(fa) ? left(f(fa.left)) : right(g(fa.right));
/**
* Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to

@@ -345,6 +839,7 @@ * types of kind `* -> *`.

exports.mapBoth = mapBoth;
exports.catchAll = catchAll;
const orElse = that => fa => isLeft(fa) ? that : fa;
/**
* @category filtering
* @since 1.0.0

@@ -356,51 +851,4 @@ */

const extend = f => wa => isLeft(wa) ? wa : right(f(wa));
const compact = e => self => isLeft(self) ? self : internal.isNone(self.right) ? left(e) : right(self.right.value);
/**
* @since 1.0.0
*/
exports.extend = extend;
const duplicate = /*#__PURE__*/extend(_Function.identity);
/**
* Map each element of a structure to an action, evaluate these actions from left to right, and collect the Eithers.
*
* @example
* import { pipe } from '@fp-ts/data/Function'
* import * as RA from '@fp-ts/data/ReadonlyArray'
* import * as E from '@fp-ts/data/Either'
* import * as O from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(
* pipe(E.right(['a']), E.traverse(O.Monoidal)(RA.head)),
* O.some(E.right('a')),
* )
*
* assert.deepStrictEqual(
* pipe(E.right([]), E.traverse(O.Monoidal)(RA.head)),
* O.none,
* )
*
* @category traversing
* @since 1.0.0
*/
exports.duplicate = duplicate;
const traverse = Monoidal => f => ta => isLeft(ta) ? Monoidal.of(left(ta.left)) : (0, _Function.pipe)(f(ta.right), Monoidal.map(right));
/**
* Semigroup returning the left-most non-`Left` value. If both operands are `Right`es then the inner values are
* combined using the provided `Semigroup`.
*
* @example
* import * as E from '@fp-ts/data/Either'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const S = E.getSemigroup(N.SemigroupSum)<string>()
* assert.deepStrictEqual(pipe(E.left('a'), S.combine(E.left('b'))), E.left('a'))
* assert.deepStrictEqual(pipe(E.left('a'), S.combine(E.right(2))), E.right(2))
* assert.deepStrictEqual(pipe(E.right(1), S.combine(E.left('b'))), E.right(1))
* assert.deepStrictEqual(pipe(E.right(1), S.combine(E.right(2))), E.right(3))
*
* @category instances

@@ -411,33 +859,4 @@ * @since 1.0.0

exports.traverse = traverse;
const getSemigroup = Semigroup => () => (0, _Semigroup.fromCombine)(that => self => isLeft(that) ? self : isLeft(self) ? that : right(Semigroup.combine(that.right)(self.right)));
/**
* @category filtering
* @since 1.0.0
*/
exports.getSemigroup = getSemigroup;
const compact = e => self => isLeft(self) ? self : internal.isNone(self.right) ? left(e) : right(self.right.value);
/**
* @category filtering
* @since 1.0.0
*/
exports.compact = compact;
const separate = onEmpty => {
return self => isLeft(self) ? [self, self] : isLeft(self.right) ? [right(self.right.left), left(onEmpty)] : [left(onEmpty), right(self.right.right)];
};
/**
* @category instances
* @since 1.0.0
*/
exports.separate = separate;
const getCompactable = onNone => {

@@ -449,3 +868,3 @@ return {

/**
* @category instances
* @category filtering
* @since 1.0.0

@@ -457,7 +876,5 @@ */

const getFilterable = onEmpty => {
return {
filterMap: f => filterMap(f, onEmpty)
};
};
const separate = onEmpty => compactable.separate({ ...Covariant,
...getCompactable(onEmpty)
});
/**

@@ -469,10 +886,5 @@ * @category filtering

exports.getFilterable = getFilterable;
exports.separate = separate;
const traverseFilterMap = Monoidal => {
const traverse_ = traverse(Monoidal);
return (f, onNone) => {
return (0, _Function.flow)(traverse_(f), Monoidal.map(compact(onNone)));
};
};
const filter = (predicate, onFalse) => filterable.filter(getFilterable(onFalse))(predicate);
/**

@@ -484,12 +896,10 @@ * @category filtering

exports.traverseFilterMap = traverseFilterMap;
exports.filter = filter;
const traversePartitionMap = Monoidal => {
const traverse_ = traverse(Monoidal);
return (f, onNone) => {
return (0, _Function.flow)(traverse_(f), Monoidal.map(separate(onNone)));
};
};
const filterMap = (f, onNone) => self => (0, _Function.pipe)(self, flatMap(a => {
const ob = f(a);
return internal.isNone(ob) ? left(onNone) : right(ob.value);
}));
/**
* @category instances
* @category filtering
* @since 1.0.0

@@ -499,18 +909,7 @@ */

exports.traversePartitionMap = traversePartitionMap;
exports.filterMap = filterMap;
const getTraversableFilterable = onEmpty => {
return {
traverseFilterMap: Monoidal => {
const traverseFilterMap_ = traverseFilterMap(Monoidal);
return f => traverseFilterMap_(f, onEmpty);
},
traversePartitionMap: Monoidal => {
const traversePartitionMap_ = traversePartitionMap(Monoidal);
return f => traversePartitionMap_(f, onEmpty);
}
};
};
const partition = (predicate, onFalse) => filterable.partition(getFilterable(onFalse))(predicate);
/**
* @category instances
* @category filtering
* @since 1.0.0

@@ -520,26 +919,6 @@ */

exports.getTraversableFilterable = getTraversableFilterable;
const Bifunctor = {
mapBoth
};
/**
* Returns an effect with its error channel mapped using the specified
* function. This can be used to lift a "smaller" error into a "larger" error.
*
* @category error handling
* @since 1.0.0
*/
exports.partition = partition;
exports.Bifunctor = Bifunctor;
const mapError = /*#__PURE__*/bifunctor.mapLeft(Bifunctor);
const partitionMap = (f, onEmpty) => filterable.partitionMap(getFilterable(onEmpty))(f);
/**
* Returns an effect whose Right is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
exports.mapError = mapError;
const map = /*#__PURE__*/bifunctor.map(Bifunctor);
/**
* @category instances

@@ -549,65 +928,19 @@ * @since 1.0.0

exports.map = map;
const Functor = {
map
};
/**
* @category mapping
* @since 1.0.0
*/
exports.Functor = Functor;
const flap = /*#__PURE__*/functor.flap(Functor);
/**
* Maps the Right value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
exports.partitionMap = partitionMap;
exports.flap = flap;
const as = /*#__PURE__*/functor.as(Functor);
/**
* Returns the effect Eithering from mapping the Right of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
exports.as = as;
const unit = /*#__PURE__*/functor.unit(Functor);
/**
* @category instances
* @since 1.0.0
*/
exports.unit = unit;
const Succeed = {
of: right
const getFilterable = onEmpty => {
return {
filterMap: f => filterMap(f, onEmpty)
};
};
/**
* @category sequencing
* @category traversing
* @since 1.0.0
*/
exports.Succeed = Succeed;
const flatMap = f => self => isLeft(self) ? self : f(self.right);
/**
* The `flatten` function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.
*
* @example
* import * as E from '@fp-ts/data/Either'
*
* assert.deepStrictEqual(E.flatten(E.right(E.right('a'))), E.right('a'))
* assert.deepStrictEqual(E.flatten(E.right(E.left('e'))), E.left('e'))
* assert.deepStrictEqual(E.flatten(E.left('e')), E.left('e'))
*
* @category sequencing
* @since 1.0.0
*/
exports.getFilterable = getFilterable;
exports.flatMap = flatMap;
const flatten = /*#__PURE__*/flatMap(_Function.identity);
const traverse = F => f => ta => isLeft(ta) ? F.of(left(ta.left)) : (0, _Function.pipe)(f(ta.right), F.map(right));
/**

@@ -618,249 +951,22 @@ * @category instances

exports.flatten = flatten;
const FlatMap = {
map,
flatMap
};
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @since 1.0.0
*/
exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
/**
* Sequentially zips this effect with the specified effect using the specified combiner function.
*
* @category tuple sequencing
* @since 1.0.0
*/
exports.zipRight = zipRight;
const zipWith = (that, f) => self => (0, _Function.pipe)(self, flatMap(a => (0, _Function.pipe)(that, map(b => f(a, b)))));
/**
* @category instances
* @since 1.0.0
*/
exports.zipWith = zipWith;
const Semigroupal = {
map,
zipWith,
zipMany: others => start => {
if (isLeft(start)) {
return left(start.left);
}
const res = [start.right];
for (const o of others) {
if (isLeft(o)) {
return left(o.left);
}
res.push(o.right);
}
return right(res);
}
exports.traverse = traverse;
const Traversable = {
traverse
};
/**
* @category traversing
* @since 1.0.0
*/
exports.Semigroupal = Semigroupal;
const ap = /*#__PURE__*/semigroupal.ap(Semigroupal);
exports.Traversable = Traversable;
const sequence = /*#__PURE__*/traversable.sequence(Traversable);
/**
* Lifts a binary function into `Either`.
*
* @category lifting
* @category traversing
* @since 1.0.0
*/
exports.ap = ap;
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
exports.sequence = sequence;
const traverseTap = /*#__PURE__*/traversable.traverseTap(Traversable);
/**
* Lifts a ternary function into `Either`.
*
* @category lifting
* @since 1.0.0
*/
exports.lift2 = lift2;
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
/**
* @category instances
* @since 1.0.0
*/
exports.lift3 = lift3;
const Monoidal = {
map,
of: right,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: collection => {
const res = [];
for (const o of collection) {
if (isLeft(o)) {
return left(o.left);
}
res.push(o.right);
}
return right(res);
}
};
/**
* The default [`Monoidal`](#monoidal) instance returns the first error, if you want to
* get all errors you need to provide a way to combine them via a `Semigroup`.
*
* @example
* import * as A from '@fp-ts/core/Semigroupal'
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
* import * as S from '@fp-ts/core/Semigroup'
* import * as string from '@fp-ts/data/String'
*
* const parseString = (u: unknown): E.Either<string, string> =>
* typeof u === 'string' ? E.right(u) : E.left('not a string')
*
* const parseNumber = (u: unknown): E.Either<string, number> =>
* typeof u === 'number' ? E.right(u) : E.left('not a number')
*
* interface Person {
* readonly name: string
* readonly age: number
* }
*
* const parsePerson = (
* input: Record<string, unknown>
* ): E.Either<string, Person> =>
* pipe(
* E.Do,
* E.bindRight('name', parseString(input.name)),
* E.bindRight('age', parseNumber(input.age))
* )
*
* assert.deepStrictEqual(parsePerson({}), E.left('not a string')) // <= first error
*
* const Monoidal = E.getValidatedMonoidal(
* pipe(string.Semigroup, S.intercalate(', '))
* )
*
* const bindRight = A.bindRight(Monoidal)
*
* const parsePersonAll = (
* input: Record<string, unknown>
* ): E.Either<string, Person> =>
* pipe(
* E.Do,
* bindRight('name', parseString(input.name)),
* bindRight('age', parseNumber(input.age))
* )
*
* assert.deepStrictEqual(parsePersonAll({}), E.left('not a string, not a number')) // <= all errors
*
* @category error handling
* @since 1.0.0
*/
exports.Monoidal = Monoidal;
const getValidatedMonoidal = Semigroup => ({
map,
of: right,
zipWith: (fb, f) => fa => {
if (isLeft(fa)) {
if (isLeft(fb)) {
return left(Semigroup.combine(fb.left)(fa.left));
} else {
return left(fa.left);
}
} else if (isLeft(fb)) {
return left(fb.left);
}
return right(f(fa.right, fb.right));
},
zipMany: others => start => {
const Lefts = [];
const res = [];
if (isLeft(start)) {
Lefts.push(start.left);
} else {
res.push(start.right);
}
for (const o of others) {
if (isLeft(o)) {
Lefts.push(o.left);
} else {
res.push(o.right);
}
}
if (Lefts.length > 0) {
if (Lefts.length > 1) {
return left(Semigroup.combineMany((Lefts.shift(), Lefts))(Lefts[0]));
}
return left(Lefts[0]);
}
return right(res);
},
zipAll: collection => {
const Lefts = [];
const res = [];
for (const o of collection) {
if (isLeft(o)) {
Lefts.push(o.left);
} else {
res.push(o.right);
}
}
if (Lefts.length > 0) {
if (Lefts.length > 1) {
return left(Semigroup.combineMany((Lefts.shift(), Lefts))(Lefts[0]));
}
return left(Lefts[0]);
}
return right(res);
}
});
/**
* @category instances
* @since 1.0.0
*/
exports.getValidatedMonoidal = getValidatedMonoidal;
const Monad = {
map,
of: right,
flatMap
};
/**
* Returns an effect that effectfully "peeks" at the Left of this effect.

@@ -872,3 +978,3 @@ *

exports.Monad = Monad;
exports.traverseTap = traverseTap;

@@ -884,73 +990,2 @@ const tapError = onError => self => {

/**
* Returns an effect that effectfully "peeks" at the Right of this effect.
*
* @since 1.0.0
*/
exports.tapError = tapError;
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
/**
* @category conversions
* @since 1.0.0
*/
exports.tap = tap;
const toReadonlyArray = self => isLeft(self) ? internal.empty : [self.right];
/**
* @category folding
* @since 1.0.0
*/
exports.toReadonlyArray = toReadonlyArray;
const reduce = (b, f) => self => isLeft(self) ? b : f(b, self.right);
/**
* @category folding
* @since 1.0.0
*/
exports.reduce = reduce;
const foldMap = Monoid => f => self => isLeft(self) ? Monoid.empty : f(self.right);
/**
* @category folding
* @since 1.0.0
*/
exports.foldMap = foldMap;
const reduceRight = (b, f) => self => isLeft(self) ? b : f(self.right, b);
/**
* @category instances
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
const Traversable = {
traverse
};
/**
* @category traversing
* @since 1.0.0
*/
exports.Traversable = Traversable;
const sequence = /*#__PURE__*/traversable.sequence(Traversable);
/**
* @category instances
* @since 1.0.0
*/
exports.sequence = sequence;
const Extendable = {
map,
extend
};
/**
* @example

@@ -980,3 +1015,4 @@ * import * as E from '@fp-ts/data/Either'

exports.Extendable = Extendable;
exports.tapError = tapError;
const fromOption = either.fromOption;

@@ -1066,29 +1102,3 @@ /**

/**
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.filter((n) => n > 0, 'error')
* ),
* E.right(1)
* )
* assert.deepStrictEqual(
* pipe(
* E.right(-1),
* E.filter((n) => n > 0, 'error')
* ),
* E.left('error')
* )
* assert.deepStrictEqual(
* pipe(
* E.left('a'),
* E.filter((n) => n > 0, 'error')
* ),
* E.left('a')
* )
*
* @category filtering
* @category sequencing
* @since 1.0.0

@@ -1100,41 +1110,2 @@ */

const filter = (predicate, onFalse) => self => (0, _Function.pipe)(self, flatMap(b => predicate(b) ? right(b) : left(onFalse)));
/**
* @category filtering
* @since 1.0.0
*/
exports.filter = filter;
const filterMap = (f, onNone) => self => (0, _Function.pipe)(self, flatMap(a => {
const ob = f(a);
return internal.isNone(ob) ? left(onNone) : right(ob.value);
}));
/**
* @category filtering
* @since 1.0.0
*/
exports.filterMap = filterMap;
const partition = (predicate, onFalse) => self => [(0, _Function.pipe)(self, filter((0, _Predicate.not)(predicate), onFalse)), (0, _Function.pipe)(self, filter(predicate, onFalse))];
/**
* @category filtering
* @since 1.0.0
*/
exports.partition = partition;
const partitionMap = (f, onEmpty) => self => [(0, _Function.pipe)(self, filterMap((0, _Function.flow)(f, getLeft), onEmpty)), (0, _Function.pipe)(self, filterMap((0, _Function.flow)(f, getRight), onEmpty))];
/**
* @category sequencing
* @since 1.0.0
*/
exports.partitionMap = partitionMap;
const flatMapOption = (f, onNone) => self => (0, _Function.pipe)(self, flatMap(liftOption(f, onNone)));

@@ -1169,149 +1140,5 @@ /**

const exists = predicate => ma => isLeft(ma) ? false : predicate(ma.right); // -------------------------------------------------------------------------------------
// do notation
// -------------------------------------------------------------------------------------
const exists = predicate => ma => isLeft(ma) ? false : predicate(ma.right);
/**
* @category do notation
* @since 1.0.0
*/
exports.exists = exists;
const Do = /*#__PURE__*/right(internal.Do);
/**
* @category do notation
* @since 1.0.0
*/
exports.Do = Do;
const bindTo = /*#__PURE__*/functor.bindTo(Functor);
exports.bindTo = bindTo;
const let_ = /*#__PURE__*/functor.let(Functor);
exports.let = let_;
/**
* @category do notation
* @since 1.0.0
*/
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
exports.bind = bind;
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing
// -------------------------------------------------------------------------------------
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.bindRight = bindRight;
const Zip = /*#__PURE__*/right(internal.empty);
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.Zip = Zip;
const tupled = /*#__PURE__*/functor.tupled(Functor);
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal); // -------------------------------------------------------------------------------------
// array utils
// -------------------------------------------------------------------------------------
/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.zipFlatten = zipFlatten;
const traverseNonEmptyReadonlyArrayWithIndex = f => as => {
const e = f(0, internal.head(as));
if (isLeft(e)) {
return e;
}
const out = [e.right];
for (let i = 1; i < as.length; i++) {
const e = f(i, as[i]);
if (isLeft(e)) {
return e;
}
out.push(e.right);
}
return right(out);
};
/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseNonEmptyReadonlyArrayWithIndex = traverseNonEmptyReadonlyArrayWithIndex;
const traverseReadonlyArrayWithIndex = f => {
const g = traverseNonEmptyReadonlyArrayWithIndex(f);
return as => internal.isNonEmpty(as) ? g(as) : Zip;
};
/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex;
const traverseNonEmptyReadonlyArray = f => {
return traverseNonEmptyReadonlyArrayWithIndex((0, _Function.flow)(_Function.SK, f));
};
/**
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseNonEmptyReadonlyArray = traverseNonEmptyReadonlyArray;
const traverseReadonlyArray = f => {
return traverseReadonlyArrayWithIndex((0, _Function.flow)(_Function.SK, f));
};
/**
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseReadonlyArray = traverseReadonlyArray;
const sequenceReadonlyArray = /*#__PURE__*/traverseReadonlyArray(_Function.identity);
exports.sequenceReadonlyArray = sequenceReadonlyArray;
//# sourceMappingURL=Either.js.map
/**
* @since 1.0.0
*/
import type * as category from "@fp-ts/core/Category";
import type * as composable from "@fp-ts/core/Composable";
import type { TypeLambda } from "@fp-ts/core/HKT";
import type * as monoid from "@fp-ts/core/Monoid";
import type * as semigroup from "@fp-ts/core/Semigroup";
import type * as monoid from "@fp-ts/core/typeclass/Monoid";
import type * as semigroup from "@fp-ts/core/typeclass/Semigroup";
/**

@@ -17,27 +14,6 @@ * @category models

/**
* @category type lambdas
* @since 1.0.0
*/
export interface EndomorphismTypeLambda extends TypeLambda {
readonly type: Endomorphism<this["InOut1"]>;
}
/**
* @since 1.0.0
*/
export declare const id: <A>() => Endomorphism<A>;
/**
* @since 1.0.0
*/
export declare const compose: <B, C>(bc: (b: B) => C) => <A>(ab: (a: A) => B) => (a: A) => C;
/**
* @category instances
* @since 1.0.0
*/
export declare const Composable: composable.Composable<EndomorphismTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Category: category.Category<EndomorphismTypeLambda>;
/**
* `Endomorphism` form a `Semigroup` where the `combine` operation is the usual function composition.

@@ -44,0 +20,0 @@ *

@@ -6,5 +6,5 @@ "use strict";

});
exports.id = exports.getSemigroup = exports.getMonoid = exports.compose = exports.Composable = exports.Category = void 0;
exports.getSemigroup = exports.getMonoid = exports.compose = void 0;
var func = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Function"));
var Function = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Function"));

@@ -18,36 +18,4 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

*/
const compose = Function.compose;
/**
* @since 1.0.0
*/
const id = func.id;
/**
* @since 1.0.0
*/
exports.id = id;
const compose = func.compose; // -------------------------------------------------------------------------------------
// instances
// -------------------------------------------------------------------------------------
/**
* @category instances
* @since 1.0.0
*/
exports.compose = compose;
const Composable = {
compose
};
/**
* @category instances
* @since 1.0.0
*/
exports.Composable = Composable;
const Category = {
compose,
id
};
/**
* `Endomorphism` form a `Semigroup` where the `combine` operation is the usual function composition.

@@ -59,14 +27,14 @@ *

exports.Category = Category;
exports.compose = compose;
const getSemigroup = () => ({
combine: that => self => func.flow(self, that),
combineMany: others => first => {
let c = first;
combine: that => self => Function.flow(self, that),
combineMany: collection => self => a => {
let out = self(a);
for (const o of others) {
c = a => o(c(a));
for (const f of collection) {
out = f(out);
}
return c;
return out;
}

@@ -86,7 +54,6 @@ });

const S = getSemigroup();
return {
combine: S.combine,
combineMany: S.combineMany,
combineAll: all => S.combineMany(all)(func.identity),
empty: func.identity
const empty = Function.identity;
return { ...S,
combineAll: collection => S.combineMany(collection)(empty),
empty
};

@@ -93,0 +60,0 @@ };

/**
* @since 1.0.0
*/
import type * as category from "@fp-ts/core/Category";
import type * as composable from "@fp-ts/core/Composable";
import type { TypeLambda } from "@fp-ts/core/HKT";
import type * as monoid from "@fp-ts/core/Monoid";
import * as semigroup from "@fp-ts/core/Semigroup";
import type { Endomorphism } from "@fp-ts/data/Endomorphism";
import type * as monoid from "@fp-ts/core/typeclass/Monoid";
import * as semigroup from "@fp-ts/core/typeclass/Semigroup";
/**

@@ -15,24 +12,9 @@ * @category type lambdas

export interface FunctionTypeLambda extends TypeLambda {
readonly type: (a: this["In1"]) => this["Out1"];
readonly type: (a: this["In"]) => this["Target"];
}
/**
* @category constructors
* @since 1.0.0
*/
export declare const id: <A>() => Endomorphism<A>;
/**
* @since 1.0.0
*/
export declare const compose: <B, C>(bc: (b: B) => C) => <A>(ab: (a: A) => B) => (a: A) => C;
/**
* @category instances
* @since 1.0.0
*/
export declare const Composable: composable.Composable<FunctionTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Category: category.Category<FunctionTypeLambda>;
/**
* Unary functions form a semigroup as long as you can provide a semigroup for the codomain.

@@ -90,3 +72,3 @@ *

*/
export declare const apply: <A>(a: A) => <B>(f: (a: A) => B) => B;
export declare const apply: <A>(a: A) => <B>(self: (a: A) => B) => B;
/**

@@ -93,0 +75,0 @@ * A lazy argument

@@ -6,9 +6,9 @@ "use strict";

});
exports.flip = exports.constant = exports.constVoid = exports.constUndefined = exports.constTrue = exports.constNull = exports.constFalse = exports.compose = exports.apply = exports.absurd = exports.SK = exports.Composable = exports.Category = void 0;
exports.flip = exports.constant = exports.constVoid = exports.constUndefined = exports.constTrue = exports.constNull = exports.constFalse = exports.compose = exports.apply = exports.absurd = exports.SK = void 0;
exports.flow = flow;
exports.identity = exports.id = exports.hole = exports.getSemigroup = exports.getMonoid = void 0;
exports.identity = exports.hole = exports.getSemigroup = exports.getMonoid = void 0;
exports.pipe = pipe;
exports.untupled = exports.unsafeCoerce = exports.tupled = void 0;
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroup"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));

@@ -20,38 +20,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

/**
* @category constructors
* @since 1.0.0
*/
const id = () => identity;
const compose = bc => ab => flow(ab, bc);
/**
* @since 1.0.0
*/
exports.id = id;
const compose = bc => ab => flow(ab, bc); // -------------------------------------------------------------------------------------
// instances
// -------------------------------------------------------------------------------------
/**
* @category instances
* @since 1.0.0
*/
exports.compose = compose;
const Composable = {
compose
};
/**
* @category instances
* @since 1.0.0
*/
exports.Composable = Composable;
const Category = {
compose,
id
};
/**
* Unary functions form a semigroup as long as you can provide a semigroup for the codomain.

@@ -81,4 +49,5 @@ *

exports.Category = Category;
exports.compose = compose;
const getSemigroup = Semigroup => () => semigroup.fromCombine(that => self => a => Semigroup.combine(that(a))(self(a)));

@@ -118,6 +87,4 @@ /**

return {
combine: S.combine,
combineMany: S.combineMany,
combineAll: all => S.combineMany(all)(empty),
return { ...S,
combineAll: collection => S.combineMany(collection)(empty),
empty

@@ -133,3 +100,3 @@ };

const apply = a => f => f(a);
const apply = a => self => self(a);
/**

@@ -136,0 +103,0 @@ * @since 1.0.0

/**
* @since 1.0.0
*/
import type * as categoryKind from "@fp-ts/core/CategoryKind";
import type * as comonad from "@fp-ts/core/Comonad";
import type * as composableKind from "@fp-ts/core/ComposableKind";
import type * as extendable from "@fp-ts/core/Extendable";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import type * as foldable from "@fp-ts/core/Foldable";
import * as functor from "@fp-ts/core/Functor";
import type { Kind, TypeLambda } from "@fp-ts/core/HKT";
import type * as monad from "@fp-ts/core/Monad";
import type { Monoid } from "@fp-ts/core/Monoid";
import type * as monoidal from "@fp-ts/core/Monoidal";
import type * as pointed from "@fp-ts/core/Pointed";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import type * as semigroupKind from "@fp-ts/core/SemigroupKind";
import type * as traversable from "@fp-ts/core/Traversable";
import * as applicative from "@fp-ts/core/typeclass/Applicative";
import * as chainable from "@fp-ts/core/typeclass/Chainable";
import type * as coproduct_ from "@fp-ts/core/typeclass/Coproduct";
import * as covariant from "@fp-ts/core/typeclass/Covariant";
import * as flatMap_ from "@fp-ts/core/typeclass/FlatMap";
import * as foldable from "@fp-ts/core/typeclass/Foldable";
import * as invariant from "@fp-ts/core/typeclass/Invariant";
import type * as monad from "@fp-ts/core/typeclass/Monad";
import type { Monoid } from "@fp-ts/core/typeclass/Monoid";
import type * as nonEmptyAlternative from "@fp-ts/core/typeclass/NonEmptyAlternative";
import * as nonEmptyApplicative from "@fp-ts/core/typeclass/NonEmptyApplicative";
import * as nonEmptyCoproduct from "@fp-ts/core/typeclass/NonEmptyCoproduct";
import * as nonEmptyProduct from "@fp-ts/core/typeclass/NonEmptyProduct";
import * as of_ from "@fp-ts/core/typeclass/Of";
import type * as pointed from "@fp-ts/core/typeclass/Pointed";
import * as product_ from "@fp-ts/core/typeclass/Product";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as traversable from "@fp-ts/core/typeclass/Traversable";
import type { Either } from "@fp-ts/data/Either";
/**

@@ -29,14 +34,12 @@ * @category models

export interface IdentityTypeLambda extends TypeLambda {
readonly type: Identity<this["Out1"]>;
readonly type: Identity<this["Target"]>;
}
/**
* @category constructors
* @since 1.0.0
*/
export declare const of: <A>(a: A) => Identity<A>;
export declare const map: <A, B>(f: (a: A) => B) => (self: A) => B;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toReadonlyArray: <A>(self: A) => readonly A[];
export declare const imap: <A, B>(to: (a: A) => B, from: (b: B) => A) => (self: Identity<A>) => Identity<B>;
/**

@@ -46,20 +49,33 @@ * @category instances

*/
export declare const Pointed: pointed.Pointed<IdentityTypeLambda>;
export declare const Invariant: invariant.Invariant<IdentityTypeLambda>;
/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
export declare const map: <A, B>(f: (a: A) => B) => (self: Identity<A>) => Identity<B>;
export declare const tupled: <A>(self: Identity<A>) => Identity<readonly [A]>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: Identity<A>) => Identity<{
readonly [K in N]: A;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Functor: functor.Functor<IdentityTypeLambda>;
export declare const Covariant: covariant.Covariant<IdentityTypeLambda>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => (self: Identity<A>) => Identity<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export {
/**
* @category do notation
* @since 1.0.0
*/
let_ as let };
/**
* @category mapping
* @since 1.0.0
*/
export declare const flap: <A>(a: A) => <B>(self: Identity<(a: A) => B>) => Identity<B>;
export declare const flap: <A>(a: A) => <B>(fab: Identity<(a: A) => B>) => Identity<B>;
/**

@@ -71,3 +87,3 @@ * Maps the success value of this effect to the specified constant value.

*/
export declare const as: <B>(b: B) => <A>(self: Identity<A>) => Identity<B>;
export declare const as: <B>(b: B) => <_>(self: Identity<_>) => Identity<B>;
/**

@@ -79,4 +95,28 @@ * Returns the effect resulting from mapping the success of this effect to unit.

*/
export declare const unit: <A>(self: Identity<A>) => Identity<void>;
export declare const asUnit: <_>(self: Identity<_>) => Identity<void>;
/**
* @category constructors
* @since 1.0.0
*/
export declare const of: <A>(a: A) => Identity<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Of: of_.Of<IdentityTypeLambda>;
/**
* @since 1.0.0
*/
export declare const unit: Identity<void>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const Do: Identity<{}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Pointed: pointed.Pointed<IdentityTypeLambda>;
/**
* @category sequencing

@@ -94,12 +134,11 @@ * @since 1.0.0

*/
export declare const composeKind: <B, C>(that: (b: B) => Identity<C>) => <A>(self: (a: A) => Identity<B>) => (a: A) => Identity<C>;
export declare const flatten: <A>(self: Identity<Identity<A>>) => Identity<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const ComposableKind: composableKind.ComposableKind<IdentityTypeLambda>;
export declare const andThen: <B>(that: Identity<B>) => <_>(self: Identity<_>) => Identity<B>;
/**
* @since 1.0.0
*/
export declare const idKind: <A>() => (a: A) => A;
export declare const composeKleisliArrow: <B, C>(bfc: (b: B) => Identity<C>) => <A>(afb: (a: A) => Identity<B>) => (a: A) => Identity<C>;
/**

@@ -109,4 +148,17 @@ * @category instances

*/
export declare const CategoryKind: categoryKind.CategoryKind<IdentityTypeLambda>;
export declare const Chainable: chainable.Chainable<IdentityTypeLambda>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => Identity<B>) => (self: Identity<A>) => Identity<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
export declare const tap: <A, _>(f: (a: A) => Identity<_>) => (self: Identity<A>) => Identity<A>;
/**
* Sequences the specified effect after this effect, but ignores the value

@@ -118,18 +170,38 @@ * produced by the effect.

*/
export declare const zipLeft: (that: Identity<unknown>) => <A>(self: Identity<A>) => Identity<A>;
export declare const andThenDiscard: <_>(that: Identity<_>) => <A>(self: Identity<A>) => Identity<A>;
/**
* A variant of `flatMap` that ignores the value produced by this effect.
* @category instances
* @since 1.0.0
*/
export declare const Monad: monad.Monad<IdentityTypeLambda>;
/**
* @since 1.0.0
*/
export declare const product: <B>(that: B) => <A>(self: A) => readonly [A, B];
/**
* @since 1.0.0
*/
export declare const productMany: <A>(collection: Iterable<A>) => (self: A) => readonly [A, ...A[]];
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<IdentityTypeLambda>;
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category sequencing
* @category do notation
* @since 1.0.0
*/
export declare const zipRight: <A>(that: Identity<A>) => (self: Identity<unknown>) => Identity<A>;
export declare const bindIdentity: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: Identity<B>) => (self: Identity<A>) => Identity<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* @since 1.0.0
*/
export declare const combineKind: <B>(that: Identity<B>) => <A>(self: Identity<A>) => Identity<B | A>;
export declare const productFlatten: <B>(fb: Identity<B>) => <A extends ReadonlyArray<unknown>>(self: Identity<A>) => Identity<readonly [...A, B]>;
/**
* @since 1.0.0
*/
export declare const combineKindMany: <A>(collection: Iterable<A>) => (self: Identity<A>) => Identity<A>;
export declare const productAll: <A>(collection: Iterable<A>) => readonly A[];
/**

@@ -139,11 +211,15 @@ * @category instances

*/
export declare const SemigroupKind: semigroupKind.SemigroupKind<IdentityTypeLambda>;
export declare const Product: product_.Product<IdentityTypeLambda>;
/**
* @since 1.0.0
*/
export declare const zipWith: <B, A, C>(that: B, f: (a: A, b: B) => C) => (self: A) => C;
export declare const tuple: <T extends ReadonlyArray<Identity<any>>>(...tuple: T) => Identity<Readonly<{
[I in keyof T]: [T[I]] extends [Identity<infer A>] ? A : never;
}>>;
/**
* @since 1.0.0
*/
export declare const zipMany: <A>(collection: Iterable<A>) => (self: A) => readonly [A, ...A[]];
export declare const struct: <R extends Record<string, Identity<any>>>(r: R) => Identity<{
readonly [K in keyof R]: [R[K]] extends [Identity<infer A>] ? A : never;
}>;
/**

@@ -153,7 +229,8 @@ * @category instances

*/
export declare const Semigroupal: semigroupal.Semigroupal<IdentityTypeLambda>;
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<IdentityTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const ap: <A>(fa: Identity<A>) => <B>(self: Identity<(a: A) => B>) => Identity<B>;
export declare const liftSemigroup: <A>(S: Semigroup<A>) => Semigroup<Identity<A>>;
/**

@@ -165,3 +242,3 @@ * Lifts a binary function into `Identity`.

*/
export declare const lift2: <A, B, C>(f: (a: A, b: B) => C) => (fa: A, fb: B) => C;
export declare const lift2: <A, B, C>(f: (a: A, b: B) => C) => (fa: Identity<A>, fb: Identity<B>) => Identity<C>;
/**

@@ -173,7 +250,7 @@ * Lifts a ternary function into `Identity`.

*/
export declare const lift3: <A, B, C, D>(f: (a: A, b: B, c: C) => D) => (fa: A, fb: B, fc: C) => D;
export declare const lift3: <A, B, C, D>(f: (a: A, b: B, c: C) => D) => (fa: Identity<A>, fb: Identity<B>, fc: Identity<C>) => Identity<D>;
/**
* @since 1.0.0
*/
export declare const zipAll: <A>(collection: Iterable<A>) => readonly A[];
export declare const ap: <A>(fa: Identity<A>) => <B>(self: Identity<(a: A) => B>) => Identity<B>;
/**

@@ -183,29 +260,28 @@ * @category instances

*/
export declare const Monoidal: monoidal.Monoidal<IdentityTypeLambda>;
export declare const Applicative: applicative.Applicative<IdentityTypeLambda>;
/**
* @since 1.0.0
*/
export declare const flatten: <A>(self: Identity<Identity<A>>) => Identity<A>;
export declare const liftMonoid: <A>(M: Monoid<A>) => Monoid<Identity<A>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monad: monad.Monad<IdentityTypeLambda>;
export declare const coproduct: <B>(that: Identity<B>) => <A>(self: Identity<A>) => Identity<B | A>;
/**
* @since 1.0.0
*/
export declare const extend: <A, B>(f: (that: A) => B) => (self: A) => B;
export declare const coproductMany: <A>(collection: Iterable<A>) => (self: Identity<A>) => Identity<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const duplicate: <A>(self: Identity<A>) => Identity<Identity<A>>;
export declare const NonEmptyCoproduct: nonEmptyCoproduct.NonEmptyCoproduct<IdentityTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Extendable: extendable.Extendable<IdentityTypeLambda>;
export declare const getSemigroup: <A>() => Semigroup<Identity<A>>;
/**
* @since 1.0.0
*/
export declare const extract: <A>(self: Identity<A>) => A;
export declare const coproductEither: <B>(that: Identity<B>) => <A>(self: Identity<A>) => Identity<Either<A, B>>;
/**

@@ -215,3 +291,3 @@ * @category instances

*/
export declare const Comonad: comonad.Comonad<IdentityTypeLambda>;
export declare const NonEmptyAlternative: nonEmptyAlternative.NonEmptyAlternative<IdentityTypeLambda>;
/**

@@ -226,7 +302,2 @@ * @category folding

*/
export declare const foldMap: <M>(_: Monoid<M>) => <A>(f: (a: A) => M) => (self: A) => M;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (b: B, a: A) => B) => (self: A) => B;

@@ -239,70 +310,51 @@ /**

/**
* @category traversing
* @category folding
* @since 1.0.0
*/
export declare const traverse: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, B>) => (self: A) => Kind<F, S, R, O, E, B>;
export declare const foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => (self: Identity<A>) => M;
/**
* @category instances
* @category conversions
* @since 1.0.0
*/
export declare const Traversable: traversable.Traversable<IdentityTypeLambda>;
export declare const toReadonlyArray: <A>(self: Identity<A>) => ReadonlyArray<A>;
/**
* @category traversing
* @category conversions
* @since 1.0.0
*/
export declare const sequence: <F extends TypeLambda>(_: monoidal.Monoidal<F>) => <S, R, O, E, A>(self: Kind<F, S, R, O, E, A>) => Kind<F, S, R, O, E, A>;
export declare const toReadonlyArrayWith: <A, B>(f: (a: A) => B) => (self: Identity<A>) => ReadonlyArray<B>;
/**
* @category do notation
* @category folding
* @since 1.0.0
*/
export declare const Do: Identity<{}>;
export declare const reduceKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: Identity<A>) => Kind<G, R, O, E, B>;
/**
* @category do notation
* @category folding
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: Identity<A>) => Identity<{
readonly [K in N]: A;
}>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => (self: Identity<A>) => Identity<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export {
export declare const reduceRightKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: Identity<A>) => Kind<G, R, O, E, B>;
/**
* @category do notation
* @category folding
* @since 1.0.0
*/
let_ as let };
export declare const foldMapKind: <G extends TypeLambda>(G: coproduct_.Coproduct<G>) => <A, R, O, E, B>(f: (a: A) => Kind<G, R, O, E, B>) => (self: Identity<A>) => Kind<G, R, O, E, B>;
/**
* @category do notation
* @category traversing
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => Identity<B>) => (self: Identity<A>) => Identity<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export declare const traverse: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: A) => Kind<F, R, O, E, B>;
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @category instances
* @since 1.0.0
*/
export declare const bindRight: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: Identity<B>) => (self: Identity<A>) => Identity<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export declare const Traversable: traversable.Traversable<IdentityTypeLambda>;
/**
* @category tuple sequencing
* @category traversing
* @since 1.0.0
*/
export declare const Zip: Identity<readonly []>;
export declare const sequence: <F extends TypeLambda>(F: applicative.Applicative<F>) => <R, O, E, A>(fas: Identity<Kind<F, R, O, E, A>>) => Kind<F, R, O, E, Identity<A>>;
/**
* @category tuple sequencing
* @category traversing
* @since 1.0.0
*/
export declare const tupled: <A>(self: Identity<A>) => Identity<readonly [A]>;
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
export declare const zipFlatten: <B>(fb: B) => <A extends ReadonlyArray<unknown>>(self: Identity<A>) => Identity<readonly [...A, B]>;
export declare const traverseTap: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: Identity<A>) => Kind<F, R, O, E, Identity<A>>;
//# sourceMappingURL=Identity.d.ts.map

@@ -6,10 +6,28 @@ "use strict";

});
exports.zipWith = exports.zipRight = exports.zipMany = exports.zipLeft = exports.zipFlatten = exports.zipAll = exports.unit = exports.tupled = exports.traverse = exports.toReadonlyArray = exports.sequence = exports.reduceRight = exports.reduce = exports.of = exports.map = exports.lift3 = exports.lift2 = exports.let = exports.idKind = exports.foldMap = exports.flatten = exports.flatMap = exports.flap = exports.extract = exports.extend = exports.duplicate = exports.composeKind = exports.combineKindMany = exports.combineKind = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.ap = exports.Zip = exports.Traversable = exports.Semigroupal = exports.SemigroupKind = exports.Pointed = exports.Monoidal = exports.Monad = exports.Functor = exports.Foldable = exports.FlatMap = exports.Extendable = exports.Do = exports.ComposableKind = exports.Comonad = exports.CategoryKind = void 0;
exports.unit = exports.tupled = exports.tuple = exports.traverseTap = exports.traverse = exports.toReadonlyArrayWith = exports.toReadonlyArray = exports.tap = exports.struct = exports.sequence = exports.reduceRightKind = exports.reduceRight = exports.reduceKind = exports.reduce = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.of = exports.map = exports.liftSemigroup = exports.liftMonoid = exports.lift3 = exports.lift2 = exports.let = exports.imap = exports.getSemigroup = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMap = exports.flap = exports.coproductMany = exports.coproductEither = exports.coproduct = exports.composeKleisliArrow = exports.bindTo = exports.bindIdentity = exports.bind = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThen = exports.Traversable = exports.Product = exports.Pointed = exports.Of = exports.NonEmptyProduct = exports.NonEmptyCoproduct = exports.NonEmptyApplicative = exports.NonEmptyAlternative = exports.Monad = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Do = exports.Covariant = exports.Chainable = exports.Applicative = void 0;
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));
var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));
var chainable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Chainable"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var covariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Covariant"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/FlatMap"));
var foldable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Foldable"));
var invariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Invariant"));
var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var nonEmptyCoproduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyCoproduct"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));
var _Function = /*#__PURE__*/require("@fp-ts/data/Function");

@@ -24,14 +42,12 @@

/**
* @category constructors
* @since 1.0.0
*/
const of = _Function.identity;
const map = f => self => f(self);
/**
* @category conversions
* @since 1.0.0
*/
exports.of = of;
const toReadonlyArray = self => [self];
exports.map = map;
const imap = /*#__PURE__*/covariant.imap(map);
/**

@@ -42,17 +58,20 @@ * @category instances

exports.toReadonlyArray = toReadonlyArray;
const Pointed = {
of
exports.imap = imap;
const Invariant = {
imap
};
/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
exports.Pointed = Pointed;
const map = _Function.identity;
exports.Invariant = Invariant;
const tupled = /*#__PURE__*/invariant.tupled(Invariant);
/**
* @category do notation
* @since 1.0.0
*/
exports.tupled = tupled;
const bindTo = /*#__PURE__*/invariant.bindTo(Invariant);
/**
* @category instances

@@ -62,6 +81,10 @@ * @since 1.0.0

exports.map = map;
const Functor = {
exports.bindTo = bindTo;
const Covariant = { ...Invariant,
map
};
exports.Covariant = Covariant;
const let_ = /*#__PURE__*/covariant.let(Covariant);
exports.let = let_;
/**

@@ -71,5 +94,3 @@ * @category mapping

*/
exports.Functor = Functor;
const flap = /*#__PURE__*/functor.flap(Functor);
const flap = /*#__PURE__*/covariant.flap(Covariant);
/**

@@ -83,3 +104,3 @@ * Maps the success value of this effect to the specified constant value.

exports.flap = flap;
const as = /*#__PURE__*/functor.as(Functor);
const as = /*#__PURE__*/covariant.as(Covariant);
/**

@@ -93,10 +114,48 @@ * Returns the effect resulting from mapping the success of this effect to unit.

exports.as = as;
const unit = /*#__PURE__*/functor.unit(Functor);
const asUnit = /*#__PURE__*/covariant.asUnit(Covariant);
/**
* @category sequencing
* @category constructors
* @since 1.0.0
*/
exports.asUnit = asUnit;
const of = _Function.identity;
/**
* @category instances
* @since 1.0.0
*/
exports.of = of;
const Of = {
of
};
/**
* @since 1.0.0
*/
exports.Of = Of;
const unit = /*#__PURE__*/of_.unit(Of);
/**
* @category do notation
* @since 1.0.0
*/
exports.unit = unit;
const Do = /*#__PURE__*/of_.Do(Of);
/**
* @category instances
* @since 1.0.0
*/
exports.Do = Do;
const Pointed = { ...Of,
...Covariant
};
/**
* @category sequencing
* @since 1.0.0
*/
exports.Pointed = Pointed;
const flatMap = f => self => f(self);

@@ -111,3 +170,2 @@ /**

const FlatMap = {
map,
flatMap

@@ -120,12 +178,9 @@ };

exports.FlatMap = FlatMap;
const composeKind = /*#__PURE__*/flatMap_.composeKind(FlatMap);
const flatten = /*#__PURE__*/flatMap_.flatten(FlatMap);
/**
* @category instances
* @since 1.0.0
*/
exports.composeKind = composeKind;
const ComposableKind = {
composeKind
};
exports.flatten = flatten;
const andThen = /*#__PURE__*/flatMap_.andThen(FlatMap);
/**

@@ -135,5 +190,4 @@ * @since 1.0.0

exports.ComposableKind = ComposableKind;
const idKind = () => _Function.identity;
exports.andThen = andThen;
const composeKleisliArrow = /*#__PURE__*/flatMap_.composeKleisliArrow(FlatMap);
/**

@@ -144,9 +198,22 @@ * @category instances

exports.idKind = idKind;
const CategoryKind = {
composeKind,
idKind
exports.composeKleisliArrow = composeKleisliArrow;
const Chainable = { ...FlatMap,
...Covariant
};
/**
* @category do notation
* @since 1.0.0
*/
exports.Chainable = Chainable;
const bind = /*#__PURE__*/chainable.bind(Chainable);
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
exports.bind = bind;
const tap = /*#__PURE__*/chainable.tap(Chainable);
/**
* Sequences the specified effect after this effect, but ignores the value

@@ -159,13 +226,13 @@ * produced by the effect.

exports.CategoryKind = CategoryKind;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
exports.tap = tap;
const andThenDiscard = /*#__PURE__*/chainable.andThenDiscard(Chainable);
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @category instances
* @since 1.0.0
*/
exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
exports.andThenDiscard = andThenDiscard;
const Monad = { ...Pointed,
...FlatMap
};
/**

@@ -175,5 +242,5 @@ * @since 1.0.0

exports.zipRight = zipRight;
exports.Monad = Monad;
const combineKind = () => _Function.identity;
const product = that => self => [self, that];
/**

@@ -184,5 +251,5 @@ * @since 1.0.0

exports.combineKind = combineKind;
exports.product = product;
const combineKindMany = () => _Function.identity;
const productMany = collection => self => [self, ...collection];
/**

@@ -194,15 +261,22 @@ * @category instances

exports.combineKindMany = combineKindMany;
const SemigroupKind = {
map,
combineKind,
combineKindMany
exports.productMany = productMany;
const NonEmptyProduct = { ...Invariant,
product,
productMany
};
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
exports.SemigroupKind = SemigroupKind;
exports.NonEmptyProduct = NonEmptyProduct;
const bindIdentity = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
/**
* @since 1.0.0
*/
const zipWith = (that, f) => self => f(self, that);
exports.bindIdentity = bindIdentity;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
/**

@@ -212,15 +286,29 @@ * @since 1.0.0

exports.productFlatten = productFlatten;
exports.zipWith = zipWith;
const productAll = collection => internal.fromIterable(collection);
/**
* @category instances
* @since 1.0.0
*/
const zipMany = collection => self => {
const out = [self];
for (const a of collection) {
out.push(a);
}
return out;
exports.productAll = productAll;
const Product = { ...Of,
...NonEmptyProduct,
productAll
};
/**
* @since 1.0.0
*/
exports.Product = Product;
const tuple = /*#__PURE__*/product_.tuple(Product);
/**
* @since 1.0.0
*/
exports.tuple = tuple;
const struct = /*#__PURE__*/product_.struct(Product);
/**
* @category instances

@@ -230,15 +318,13 @@ * @since 1.0.0

exports.zipMany = zipMany;
const Semigroupal = {
map,
zipWith,
zipMany
exports.struct = struct;
const NonEmptyApplicative = { ...NonEmptyProduct,
...Covariant
};
/**
* @category instances
* @since 1.0.0
*/
exports.Semigroupal = Semigroupal;
const ap = /*#__PURE__*/semigroupal.ap(Semigroupal);
exports.NonEmptyApplicative = NonEmptyApplicative;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
/**

@@ -251,4 +337,4 @@ * Lifts a binary function into `Identity`.

exports.ap = ap;
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
exports.liftSemigroup = liftSemigroup;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
/**

@@ -262,3 +348,3 @@ * Lifts a ternary function into `Identity`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
/**

@@ -269,4 +355,3 @@ * @since 1.0.0

exports.lift3 = lift3;
const zipAll = collection => Array.from(collection);
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
/**

@@ -277,10 +362,5 @@ * @category instances

exports.zipAll = zipAll;
const Monoidal = {
map,
of,
zipAll,
zipMany,
zipWith
exports.ap = ap;
const Applicative = { ...NonEmptyApplicative,
...Product
};

@@ -291,15 +371,11 @@ /**

exports.Monoidal = Monoidal;
const flatten = /*#__PURE__*/flatMap(_Function.identity);
exports.Applicative = Applicative;
const liftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
/**
* @category instances
* @since 1.0.0
*/
exports.flatten = flatten;
const Monad = {
map,
of,
flatMap
};
exports.liftMonoid = liftMonoid;
const coproduct = () => _Function.identity;
/**

@@ -309,6 +385,8 @@ * @since 1.0.0

exports.Monad = Monad;
const extend = f => self => f(self);
exports.coproduct = coproduct;
const coproductMany = () => _Function.identity;
/**
* @category instances
* @since 1.0.0

@@ -318,14 +396,13 @@ */

exports.extend = extend;
const duplicate = /*#__PURE__*/extend(_Function.identity);
exports.coproductMany = coproductMany;
const NonEmptyCoproduct = { ...Invariant,
coproduct,
coproductMany
};
/**
* @category instances
* @since 1.0.0
*/
exports.duplicate = duplicate;
const Extendable = {
map,
extend
};
exports.NonEmptyCoproduct = NonEmptyCoproduct;
const getSemigroup = /*#__PURE__*/nonEmptyCoproduct.getSemigroup(NonEmptyCoproduct);
/**

@@ -335,4 +412,4 @@ * @since 1.0.0

exports.Extendable = Extendable;
const extract = _Function.identity;
exports.getSemigroup = getSemigroup;
const coproductEither = /*#__PURE__*/nonEmptyCoproduct.coproductEither(NonEmptyCoproduct);
/**

@@ -343,7 +420,5 @@ * @category instances

exports.extract = extract;
const Comonad = {
map,
extend,
extract
exports.coproductEither = coproductEither;
const NonEmptyAlternative = { ...Covariant,
...NonEmptyCoproduct
};

@@ -355,3 +430,3 @@ /**

exports.Comonad = Comonad;
exports.NonEmptyAlternative = NonEmptyAlternative;

@@ -367,11 +442,2 @@ const reduce = (b, f) => self => f(b, self);

const foldMap = _ => f => self => f(self);
/**
* @category folding
* @since 1.0.0
*/
exports.foldMap = foldMap;
const reduceRight = (b, f) => self => f(b, self);

@@ -390,3 +456,3 @@ /**

/**
* @category traversing
* @category folding
* @since 1.0.0

@@ -396,85 +462,71 @@ */

exports.Foldable = Foldable;
const traverse = Monoidal => f => (0, _Function.flow)(f, Monoidal.map(_Function.identity));
const foldMap = /*#__PURE__*/foldable.foldMap(Foldable);
/**
* @category instances
* @category conversions
* @since 1.0.0
*/
exports.traverse = traverse;
const Traversable = {
traverse
};
exports.foldMap = foldMap;
const toReadonlyArray = /*#__PURE__*/foldable.toReadonlyArray(Foldable);
/**
* @category traversing
* @category conversions
* @since 1.0.0
*/
exports.Traversable = Traversable;
const sequence = _ => self => self; // -------------------------------------------------------------------------------------
// do notation
// -------------------------------------------------------------------------------------
exports.toReadonlyArray = toReadonlyArray;
const toReadonlyArrayWith = /*#__PURE__*/foldable.toReadonlyArrayWith(Foldable);
/**
* @category do notation
* @category folding
* @since 1.0.0
*/
exports.sequence = sequence;
const Do = /*#__PURE__*/of(internal.Do);
exports.toReadonlyArrayWith = toReadonlyArrayWith;
const reduceKind = /*#__PURE__*/foldable.reduceKind(Foldable);
/**
* @category do notation
* @category folding
* @since 1.0.0
*/
exports.Do = Do;
const bindTo = /*#__PURE__*/functor.bindTo(Functor);
exports.bindTo = bindTo;
const let_ = /*#__PURE__*/functor.let(Functor);
exports.let = let_;
exports.reduceKind = reduceKind;
const reduceRightKind = /*#__PURE__*/foldable.reduceRightKind(Foldable);
/**
* @category do notation
* @category folding
* @since 1.0.0
*/
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
exports.reduceRightKind = reduceRightKind;
const foldMapKind = /*#__PURE__*/foldable.foldMapKind(Foldable);
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @category traversing
* @since 1.0.0
*/
exports.bind = bind;
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing
// -------------------------------------------------------------------------------------
exports.foldMapKind = foldMapKind;
const traverse = F => f => self => f(self);
/**
* @category tuple sequencing
* @category instances
* @since 1.0.0
*/
exports.bindRight = bindRight;
const Zip = /*#__PURE__*/of(internal.empty);
exports.traverse = traverse;
const Traversable = {
traverse
};
/**
* @category tuple sequencing
* @category traversing
* @since 1.0.0
*/
exports.Zip = Zip;
const tupled = /*#__PURE__*/functor.tupled(Functor);
exports.Traversable = Traversable;
const sequence = /*#__PURE__*/traversable.sequence(Traversable);
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @category traversing
* @since 1.0.0
*/
exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal);
exports.zipFlatten = zipFlatten;
exports.sequence = sequence;
const traverseTap = /*#__PURE__*/traversable.traverseTap(Traversable);
exports.traverseTap = traverseTap;
//# sourceMappingURL=Identity.js.map

@@ -32,2 +32,3 @@ /**

import * as option from "@fp-ts/data/Option";
import * as ordering from "@fp-ts/data/Ordering";
import * as predicate from "@fp-ts/data/Predicate";

@@ -43,6 +44,3 @@ import * as queue from "@fp-ts/data/Queue";

import * as string from "@fp-ts/data/String";
import * as compactable from "@fp-ts/data/typeclasses/Compactable";
import * as filterable from "@fp-ts/data/typeclasses/Filterable";
import * as fromOption from "@fp-ts/data/typeclasses/FromOption";
import * as traversableFilterable from "@fp-ts/data/typeclasses/TraversableFilterable";
import * as weakIterableMap from "@fp-ts/data/weak/WeakIterableMap";

@@ -69,6 +67,2 @@ export {

*/
compactable,
/**
* @since 1.0.0
*/
const_,

@@ -106,6 +100,2 @@ /**

*/
filterable,
/**
* @since 1.0.0
*/
fromOption,

@@ -175,2 +165,6 @@ /**

*/
ordering,
/**
* @since 1.0.0
*/
orPatch,

@@ -220,7 +214,3 @@ /**

*/
traversableFilterable,
/**
* @since 1.0.0
*/
weakIterableMap };
//# sourceMappingURL=index.d.ts.map

@@ -6,3 +6,3 @@ "use strict";

});
exports.weakIterableMap = exports.traversableFilterable = exports.string = exports.sortedSet = exports.sortedMap = exports.safeEval = exports.refinement = exports.redBlackTree = exports.readonlyArray = exports.random = exports.queue = exports.predicate = exports.orPatch = exports.option = exports.number = exports.nonEmptyReadonlyArray = exports.mutableRef = exports.mutableQueue = exports.mutableListBuilder = exports.mutableList = exports.mutableHashSet = exports.mutableHashMap = exports.list = exports.identity = exports.hashSetPatch = exports.hashSet = exports.hashMapPatch = exports.hashMap = exports.function = exports.fromOption = exports.filterable = exports.equal = exports.endomorphism = exports.either = exports.duration = exports.differ = exports.contextPatch = exports.context = exports.const_ = exports.compactable = exports.chunkPatch = exports.chunk = exports.boolean = void 0;
exports.weakIterableMap = exports.string = exports.sortedSet = exports.sortedMap = exports.safeEval = exports.refinement = exports.redBlackTree = exports.readonlyArray = exports.random = exports.queue = exports.predicate = exports.ordering = exports.orPatch = exports.option = exports.number = exports.nonEmptyReadonlyArray = exports.mutableRef = exports.mutableQueue = exports.mutableListBuilder = exports.mutableList = exports.mutableHashSet = exports.mutableHashMap = exports.list = exports.identity = exports.hashSetPatch = exports.hashSet = exports.hashMapPatch = exports.hashMap = exports.function = exports.fromOption = exports.equal = exports.endomorphism = exports.either = exports.duration = exports.differ = exports.contextPatch = exports.context = exports.const_ = exports.chunkPatch = exports.chunk = exports.boolean = void 0;

@@ -121,2 +121,6 @@ var boolean = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Boolean"));

var ordering = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Ordering"));
exports.ordering = ordering;
var predicate = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Predicate"));

@@ -162,10 +166,2 @@

var compactable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/Compactable"));
exports.compactable = compactable;
var filterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/Filterable"));
exports.filterable = filterable;
var fromOption = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/FromOption"));

@@ -175,6 +171,2 @@

var traversableFilterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/TraversableFilterable"));
exports.traversableFilterable = traversableFilterable;
var weakIterableMap = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/weak/WeakIterableMap"));

@@ -181,0 +173,0 @@

@@ -6,3 +6,3 @@ "use strict";

});
exports.toNonEmptyArray = exports.tail = exports.some = exports.none = exports.isSome = exports.isOption = exports.isNone = exports.isNonEmpty = exports.head = exports.has = exports.fromNullableToOption = exports.fromNonEmptyReadonlyArray = exports.empty = exports.Do = exports.Arrayfrom = void 0;
exports.toNonEmptyArray = exports.tail = exports.some = exports.none = exports.isSome = exports.isOption = exports.isNone = exports.isNonEmpty = exports.head = exports.has = exports.fromNullableToOption = exports.fromNonEmptyReadonlyArray = exports.fromIterable = exports.empty = exports.Do = void 0;

@@ -60,3 +60,3 @@ // -------------------------------------------------------------------------------------

const Arrayfrom = collection => Array.isArray(collection) ? collection : Array.from(collection); // -------------------------------------------------------------------------------------
const fromIterable = collection => Array.isArray(collection) ? collection : Array.from(collection); // -------------------------------------------------------------------------------------
// NonEmptyReadonlyArray

@@ -68,3 +68,3 @@ // -------------------------------------------------------------------------------------

exports.Arrayfrom = Arrayfrom;
exports.fromIterable = fromIterable;

@@ -71,0 +71,0 @@ const isNonEmpty = as => as.length > 0;

@@ -1,2 +0,2 @@

import type * as Sortable from "@fp-ts/core/Sortable";
import type * as Order from "@fp-ts/core/typeclass/Order";
import * as Equal from "@fp-ts/data/Equal";

@@ -7,3 +7,3 @@ import { RedBlackTreeIterator } from "@fp-ts/data/internal/RedBlackTree/iterator";

export declare class RedBlackTreeImpl<K, V> implements RBT.RedBlackTree<K, V> {
readonly _ord: Sortable.Sortable<K>;
readonly _ord: Order.Order<K>;
readonly _root: Node.Node<K, V> | undefined;

@@ -13,3 +13,3 @@ readonly _id: RBT.TypeId;

readonly _Value: (_: never) => V;
constructor(_ord: Sortable.Sortable<K>, _root: Node.Node<K, V> | undefined);
constructor(_ord: Order.Order<K>, _root: Node.Node<K, V> | undefined);
[Equal.symbolHash](): number;

@@ -16,0 +16,0 @@ [Equal.symbolEqual](that: unknown): boolean;

@@ -19,3 +19,3 @@ "use strict";

exports.getAt = getAt;
exports.getSortable = getSortable;
exports.getOrder = getOrder;
exports.greaterThan = greaterThan;

@@ -304,3 +304,3 @@ exports.greaterThanEqual = greaterThanEqual;

function getSortable(tree) {
function getOrder(tree) {
return tree._ord;

@@ -307,0 +307,0 @@ }

@@ -5,3 +5,3 @@ /**

import type * as HKT from "@fp-ts/core/HKT";
import type { Sortable } from "@fp-ts/core/Sortable";
import type { Order } from "@fp-ts/core/typeclass/Order";
import type { Either } from "@fp-ts/data/Either";

@@ -57,3 +57,3 @@ import type * as Equal from "@fp-ts/data/Equal";

export interface ListTypeLambda extends HKT.TypeLambda {
readonly type: List<this["Out1"]>;
readonly type: List<this["Target"]>;
}

@@ -238,4 +238,4 @@ /**

*/
export declare const sortWith: <A>(ord: Sortable<A>) => (self: List<A>) => List<A>;
export declare const sortWith: <A>(O: Order<A>) => (self: List<A>) => List<A>;
export {};
//# sourceMappingURL=List.d.ts.map

@@ -15,16 +15,22 @@ /**

*/
import type * as comonad from "@fp-ts/core/Comonad";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";
import type * as functorWithIndex from "@fp-ts/core/FunctorWithIndex";
import type { Kind, TypeLambda } from "@fp-ts/core/HKT";
import type * as monad from "@fp-ts/core/Monad";
import type * as monoidal from "@fp-ts/core/Monoidal";
import * as semigroup from "@fp-ts/core/Semigroup";
import type { Semigroup } from "@fp-ts/core/Semigroup";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as sortable from "@fp-ts/core/Sortable";
import type { Sortable } from "@fp-ts/core/Sortable";
import type * as traversable from "@fp-ts/core/Traversable";
import type * as traversableWithIndex from "@fp-ts/core/TraversableWithIndex";
import * as applicative from "@fp-ts/core/typeclass/Applicative";
import * as chainable from "@fp-ts/core/typeclass/Chainable";
import type { Coproduct } from "@fp-ts/core/typeclass/Coproduct";
import * as covariant from "@fp-ts/core/typeclass/Covariant";
import * as flatMap_ from "@fp-ts/core/typeclass/FlatMap";
import * as foldable from "@fp-ts/core/typeclass/Foldable";
import * as invariant from "@fp-ts/core/typeclass/Invariant";
import type * as monad from "@fp-ts/core/typeclass/Monad";
import type { Monoid } from "@fp-ts/core/typeclass/Monoid";
import * as nonEmptyApplicative from "@fp-ts/core/typeclass/NonEmptyApplicative";
import * as nonEmptyProduct from "@fp-ts/core/typeclass/NonEmptyProduct";
import type * as of_ from "@fp-ts/core/typeclass/Of";
import * as order from "@fp-ts/core/typeclass/Order";
import type { Order } from "@fp-ts/core/typeclass/Order";
import type * as pointed from "@fp-ts/core/typeclass/Pointed";
import type * as product_ from "@fp-ts/core/typeclass/Product";
import * as semigroup from "@fp-ts/core/typeclass/Semigroup";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as traversable from "@fp-ts/core/typeclass/Traversable";
import type { Endomorphism } from "@fp-ts/data/Endomorphism";

@@ -164,3 +170,3 @@ import type { Option } from "@fp-ts/data/Option";

* import * as RNEA from '@fp-ts/data/NonEmptyReadonlyArray'
* import { contramap } from '@fp-ts/core/Sortable'
* import { contramap } from '@fp-ts/core/typeclass/Order'
* import * as S from '@fp-ts/data/String'

@@ -175,5 +181,5 @@ * import * as N from '@fp-ts/data/Number'

*
* const byName = pipe(S.Sortable, contramap((p: Person) => p.name))
* const byName = pipe(S.Order, contramap((p: Person) => p.name))
*
* const byAge = pipe(N.Sortable, contramap((p: Person) => p.age))
* const byAge = pipe(N.Order, contramap((p: Person) => p.age))
*

@@ -198,3 +204,3 @@ * const sortByNameByAge = RNEA.sortBy([byName, byAge])

*/
export declare const sortBy: <B>(ords: readonly sortable.Sortable<B>[]) => <A extends B>(as: readonly [A, ...A[]]) => readonly [A, ...A[]];
export declare const sortBy: <B>(ords: readonly order.Order<B>[]) => <A extends B>(as: readonly [A, ...A[]]) => readonly [A, ...A[]];
/**

@@ -299,3 +305,3 @@ * Creates a `ReadonlyArray` of unique values, in order, from all given `ReadonlyArray`s using a `Eq` for equality comparisons.

*/
export declare const sort: <B>(O: sortable.Sortable<B>) => <A extends B>(as: readonly [A, ...A[]]) => readonly [A, ...A[]];
export declare const sort: <B>(O: order.Order<B>) => <A extends B>(as: readonly [A, ...A[]]) => readonly [A, ...A[]];
/**

@@ -337,16 +343,12 @@ * Change the element at the specified index, creating a new `NonEmptyReadonlyArray`, or returning `None` if the index is out of bounds.

*/
export declare const crossWith: <B, A, C>(that: readonly [B, ...B[]], f: (a: A, b: B) => C) => (self: readonly [A, ...A[]]) => readonly [C, ...C[]];
export declare const product: <B>(that: readonly [B, ...B[]]) => <A>(self: readonly [A, ...A[]]) => readonly [readonly [A, B], ...(readonly [A, B])[]];
/**
* @since 1.0.0
*/
export declare const cross: <B>(that: readonly [B, ...B[]]) => <A>(self: readonly [A, ...A[]]) => readonly [readonly [A, B], ...(readonly [A, B])[]];
export declare const productMany: <A>(collection: Iterable<readonly [A, ...A[]]>) => (self: readonly [A, ...A[]]) => readonly [readonly [A, ...A[]], ...(readonly [A, ...A[]])[]];
/**
* @since 1.0.0
*/
export declare const crossMany: <A>(collection: Iterable<readonly [A, ...A[]]>) => (self: readonly [A, ...A[]]) => readonly [readonly [A, ...A[]], ...(readonly [A, ...A[]])[]];
export declare const productAll: <A>(collection: Iterable<readonly [A, ...A[]]>) => readonly [readonly A[], ...(readonly A[])[]];
/**
* @since 1.0.0
*/
export declare const crossAll: <A>(collection: Iterable<readonly [A, ...A[]]>) => readonly [readonly A[], ...(readonly A[])[]];
/**
* Prepend an element to every member of an array

@@ -456,16 +458,9 @@ *

/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const zipLeft: (second: NonEmptyReadonlyArray<unknown>) => <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<A>;
export declare const andThen: <B>(that: NonEmptyReadonlyArray<B>) => <_>(self: NonEmptyReadonlyArray<_>) => NonEmptyReadonlyArray<B>;
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const zipRight: <A>(second: NonEmptyReadonlyArray<A>) => (self: NonEmptyReadonlyArray<unknown>) => NonEmptyReadonlyArray<A>;
export declare const composeKleisliArrow: <B, C>(bfc: (b: B) => NonEmptyReadonlyArray<C>) => <A>(afb: (a: A) => NonEmptyReadonlyArray<B>) => (a: A) => NonEmptyReadonlyArray<C>;
/**

@@ -478,20 +473,21 @@ * @since 1.0.0

*/
export declare const extend: <A, B>(f: (as: readonly [A, ...A[]]) => B) => (as: readonly [A, ...A[]]) => readonly [B, ...B[]];
export declare const extend: <A, B>(f: (fa: readonly [A, ...A[]]) => B) => (self: readonly [A, ...A[]]) => readonly [B, ...B[]];
/**
* @since 1.0.0
*/
export declare const duplicate: <A>(ma: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<NonEmptyReadonlyArray<A>>;
export declare const flatten: <A>(self: NonEmptyReadonlyArray<NonEmptyReadonlyArray<A>>) => NonEmptyReadonlyArray<A>;
/**
* @since 1.0.0
*/
export declare const flatten: <A>(mma: NonEmptyReadonlyArray<NonEmptyReadonlyArray<A>>) => NonEmptyReadonlyArray<A>;
export declare const mapWithIndex: <A, B>(f: (a: A, i: number) => B) => (self: readonly [A, ...A[]]) => readonly [B, ...B[]];
/**
* @category traversing
* @since 1.0.0
*/
export declare const mapWithIndex: <A, B>(f: (a: A, i: number) => B) => (self: readonly [A, ...A[]]) => readonly [B, ...B[]];
export declare const traverseWithIndex: <F extends TypeLambda>(F: nonEmptyApplicative.NonEmptyApplicative<F>) => <A, R, O, E, B>(f: (a: A, i: number) => Kind<F, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, R, O, E, readonly [B, ...B[]]>;
/**
* @category instances
* @category traversing
* @since 1.0.0
*/
export declare const FunctorWithIndex: functorWithIndex.FunctorWithIndex<NonEmptyReadonlyArrayTypeLambda, number>;
export declare const traverse: <F extends TypeLambda>(F: nonEmptyApplicative.NonEmptyApplicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, R, O, E, readonly [B, ...B[]]>;
/**

@@ -501,24 +497,23 @@ * @category traversing

*/
export declare const traverseWithIndex: <F extends TypeLambda>(Semigroupal: semigroupal.Semigroupal<F>) => <A, S, R, O, E, B>(f: (a: A, i: number) => Kind<F, S, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, S, R, O, E, readonly [B, ...B[]]>;
export declare const sequence: <F extends TypeLambda>(F: nonEmptyApplicative.NonEmptyApplicative<F>) => <R, O, E, A>(self: readonly [Kind<F, R, O, E, A>, ...Kind<F, R, O, E, A>[]]) => Kind<F, R, O, E, readonly [A, ...A[]]>;
/**
* @category traversing
* @category type lambdas
* @since 1.0.0
*/
export declare const traverse: <F extends TypeLambda>(Semigroupal: semigroupal.Semigroupal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, S, R, O, E, readonly [B, ...B[]]>;
export interface NonEmptyReadonlyArrayTypeLambda extends TypeLambda {
readonly type: NonEmptyReadonlyArray<this["Target"]>;
}
/**
* @category traversing
* @category instances
* @since 1.0.0
*/
export declare const sequence: <F extends TypeLambda>(Semigroupal: semigroupal.Semigroupal<F>) => <S, R, O, E, A>(self: readonly [Kind<F, S, R, O, E, A>, ...Kind<F, S, R, O, E, A>[]]) => Kind<F, S, R, O, E, readonly [A, ...A[]]>;
export declare const getSemigroup: <A>() => Semigroup<NonEmptyReadonlyArray<A>>;
/**
* @since 1.0.0
*/
export declare const extract: <A>(self: NonEmptyReadonlyArray<A>) => A;
export declare const getUnionSemigroup: <A>() => Semigroup<NonEmptyReadonlyArray<A>>;
/**
* @category type lambdas
* @since 1.0.0
*/
export interface NonEmptyReadonlyArrayTypeLambda extends TypeLambda {
readonly type: NonEmptyReadonlyArray<this["Out1"]>;
}
export declare const imap: <A, B>(to: (a: A) => B, from: (b: B) => A) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<B>;
/**

@@ -528,13 +523,25 @@ * @category instances

*/
export declare const getSemigroup: <A>() => Semigroup<NonEmptyReadonlyArray<A>>;
export declare const Invariant: invariant.Invariant<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const getUnionSemigroup: <A>() => Semigroup<NonEmptyReadonlyArray<A>>;
export declare const bindTo: <N extends string>(name: N) => <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<{
readonly [K in N]: A;
}>;
/**
* @since 1.0.0
*/
export declare const tupled: <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<readonly [A]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Functor: functor.Functor<NonEmptyReadonlyArrayTypeLambda>;
export declare const Of: of_.Of<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Covariant: covariant.Covariant<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category mapping

@@ -552,8 +559,6 @@ * @since 1.0.0

/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
export declare const unit: (self: NonEmptyReadonlyArray<unknown>) => NonEmptyReadonlyArray<void>;
export declare const asUnit: <_>(self: readonly [_, ...Array<_>]) => readonly [void, ...Array<void>];
/**

@@ -563,4 +568,19 @@ * @category instances

*/
export declare const Semigroupal: semigroupal.Semigroupal<NonEmptyReadonlyArrayTypeLambda>;
export declare const Pointed: pointed.Pointed<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Product: product_.Product<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<NonEmptyReadonlyArrayTypeLambda>;
/**
* Lifts a binary function into `NonEmptyReadonlyArray`.

@@ -580,7 +600,15 @@ *

/**
* @since 1.0.0
*/
export declare const liftSemigroup: <A>(S: semigroup.Semigroup<A>) => semigroup.Semigroup<NonEmptyReadonlyArray<A>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monoidal: monoidal.Monoidal<NonEmptyReadonlyArrayTypeLambda>;
export declare const Applicative: applicative.Applicative<NonEmptyReadonlyArrayTypeLambda>;
/**
* @since 1.0.0
*/
export declare const liftMonoid: <A>(M: Monoid<A>) => Monoid<NonEmptyReadonlyArray<A>>;
/**
* @category instances

@@ -591,2 +619,14 @@ * @since 1.0.0

/**
* @category instances
* @since 1.0.0
*/
export declare const Chainable: chainable.Chainable<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => NonEmptyReadonlyArray<B>) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<{
readonly [K in keyof A | N]: K extends keyof A ? A[K] : B;
}>;
/**
* Returns an effect that effectfully "peeks" at the success of this effect.

@@ -608,4 +648,9 @@ *

*/
export declare const tap: <A>(f: (a: A) => NonEmptyReadonlyArray<unknown>) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<A>;
export declare const tap: <A, _>(f: (a: A) => NonEmptyReadonlyArray<_>) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const andThenDiscard: <_>(that: NonEmptyReadonlyArray<_>) => <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<A>;
/**
* @category folding

@@ -616,2 +661,12 @@ * @since 1.0.0

/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (b: B, a: A) => B) => (self: readonly [A, ...A[]]) => B;
/**
* @category instances
* @since 1.0.0
*/
export declare const Foldable: foldable.Foldable<NonEmptyReadonlyArrayTypeLambda>;
/**
* **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`.

@@ -627,3 +682,3 @@ *

*/
export declare const reduceRight: <B, A>(b: B, f: (a: A, b: B) => B) => (self: readonly [A, ...A[]]) => B;
export declare const reduceKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: NonEmptyReadonlyArray<A>) => Kind<G, R, O, E, B>;
/**

@@ -633,10 +688,8 @@ * @category folding

*/
export declare const reduceWithIndex: <B, A>(b: B, f: (i: number, b: B, a: A) => B) => (self: readonly [A, ...A[]]) => B;
export declare const reduceRightKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: NonEmptyReadonlyArray<A>) => Kind<G, R, O, E, B>;
/**
* **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`.
*
* @category folding
* @since 1.0.0
*/
export declare const foldMapWithIndex: <S>(S: semigroup.Semigroup<S>) => <A>(f: (i: number, a: A) => S) => (self: readonly [A, ...A[]]) => S;
export declare const foldMapKind: <G extends TypeLambda>(G: Coproduct<G>) => <A, R, O, E, B>(f: (a: A) => Kind<G, R, O, E, B>) => (self: NonEmptyReadonlyArray<A>) => Kind<G, R, O, E, B>;
/**

@@ -646,13 +699,15 @@ * @category folding

*/
export declare const reduceRightWithIndex: <B, A>(b: B, f: (i: number, a: A, b: B) => B) => (self: readonly [A, ...A[]]) => B;
export declare const reduceWithIndex: <B, A>(b: B, f: (i: number, b: B, a: A) => B) => (self: readonly [A, ...A[]]) => B;
/**
* **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`.
*
* @category folding
* @since 1.0.0
*/
export declare const reduceKind: <F extends TypeLambda>(Flattenable: flatMap_.FlatMap<F>) => <S, R, O, E, B, A>(fb: Kind<F, S, R, O, E, B>, f: (b: B, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, S, R, O, E, B>;
export declare const foldMapWithIndex: <S>(S: semigroup.Semigroup<S>) => <A>(f: (i: number, a: A) => S) => (self: readonly [A, ...A[]]) => S;
/**
* @category instances
* @category folding
* @since 1.0.0
*/
export declare const Traversable: traversable.Traversable<NonEmptyReadonlyArrayTypeLambda>;
export declare const reduceRightWithIndex: <B, A>(b: B, f: (i: number, a: A, b: B) => B) => (self: readonly [A, ...A[]]) => B;
/**

@@ -662,8 +717,7 @@ * @category instances

*/
export declare const TraversableWithIndex: traversableWithIndex.TraversableWithIndex<NonEmptyReadonlyArrayTypeLambda, number>;
export declare const Traversable: traversable.Traversable<NonEmptyReadonlyArrayTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Comonad: comonad.Comonad<NonEmptyReadonlyArrayTypeLambda>;
export declare const traverseTap: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: NonEmptyReadonlyArray<A>) => Kind<F, R, O, E, NonEmptyReadonlyArray<A>>;
/**

@@ -674,9 +728,2 @@ * @category do notation

export declare const Do: NonEmptyReadonlyArray<{}>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<{
readonly [K in N]: A;
}>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<{

@@ -692,9 +739,2 @@ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;

/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => NonEmptyReadonlyArray<B>) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<{
readonly [K in keyof A | N]: K extends keyof A ? A[K] : B;
}>;
/**
* A variant of `bind` that sequentially ignores the scope.

@@ -705,29 +745,16 @@ *

*/
export declare const bindRight: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: NonEmptyReadonlyArray<B>) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<{
export declare const bindNonEmptyReadonlyArray: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: NonEmptyReadonlyArray<B>) => (self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<{
readonly [K in keyof A | N]: K extends keyof A ? A[K] : B;
}>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const Zip: NonEmptyReadonlyArray<readonly []>;
export declare const productFlatten: <B>(fb: NonEmptyReadonlyArray<B>) => <A extends ReadonlyArray<unknown>>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<readonly [...A, B]>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const tupled: <A>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<readonly [A]>;
export declare const head: <A>(self: NonEmptyReadonlyArray<A>) => A;
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
export declare const zipFlatten: <B>(fb: NonEmptyReadonlyArray<B>) => <A extends ReadonlyArray<unknown>>(self: NonEmptyReadonlyArray<A>) => NonEmptyReadonlyArray<readonly [...A, B]>;
/**
* @since 1.0.0
*/
export declare const head: <A>(as: NonEmptyReadonlyArray<A>) => A;
/**
* @since 1.0.0
*/
export declare const tail: <A>(as: NonEmptyReadonlyArray<A>) => ReadonlyArray<A>;

@@ -753,7 +780,7 @@ /**

*/
export declare const min: <A>(O: sortable.Sortable<A>) => (as: readonly [A, ...A[]]) => A;
export declare const min: <A>(O: order.Order<A>) => (as: readonly [A, ...A[]]) => A;
/**
* @since 1.0.0
*/
export declare const max: <A>(O: sortable.Sortable<A>) => (as: readonly [A, ...A[]]) => A;
export declare const max: <A>(O: order.Order<A>) => (as: readonly [A, ...A[]]) => A;
/**

@@ -760,0 +787,0 @@ * @since 1.0.0

@@ -6,16 +6,29 @@ "use strict";

});
exports.combineAll = exports.chunksOf = exports.chop = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.append = exports.ap = exports.Zip = exports.TraversableWithIndex = exports.Traversable = exports.Semigroupal = exports.Monoidal = exports.Monad = exports.FunctorWithIndex = exports.Functor = exports.FlatMap = exports.Do = exports.Comonad = void 0;
exports.composeKleisliArrow = exports.combineAll = exports.chunksOf = exports.chop = exports.bindTo = exports.bindNonEmptyReadonlyArray = exports.bind = exports.asUnit = exports.as = exports.append = exports.ap = exports.andThenDiscard = exports.andThen = exports.Traversable = exports.Product = exports.Pointed = exports.Of = exports.NonEmptyProduct = exports.NonEmptyApplicative = exports.Monad = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Do = exports.Covariant = exports.Chainable = exports.Applicative = void 0;
exports.concat = concat;
exports.zipWith = exports.zipRight = exports.zipMany = exports.zipLeft = exports.zipFlatten = exports.zipAll = exports.zip = exports.updateLast = exports.updateHead = exports.updateAt = exports.unzip = exports.unsafeFrom = exports.unprepend = exports.unit = exports.uniq = exports.union = exports.unappend = exports.tupled = exports.traverseWithIndex = exports.traverse = exports.tap = exports.tail = exports.splitAt = exports.sortBy = exports.sort = exports.sequence = exports.rotate = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceKind = exports.reduce = exports.range = exports.prependAll = exports.prepend = exports.orElse = exports.of = exports.modifyLast = exports.modifyHead = exports.modifyAt = exports.min = exports.max = exports.matchRight = exports.matchLeft = exports.mapWithIndex = exports.map = exports.makeBy = exports.make = exports.lift3 = exports.lift2 = exports.let = exports.last = exports.isOutOfBound = exports.intersperse = exports.intercalate = exports.init = exports.head = exports.groupBy = exports.group = exports.from = exports.foldMapWithIndex = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMap = exports.flap = exports.extract = exports.extend = exports.duplicate = exports.crossWith = exports.crossMany = exports.crossAll = exports.cross = void 0;
exports.zip = exports.updateLast = exports.updateHead = exports.updateAt = exports.unzip = exports.unsafeFrom = exports.unprepend = exports.uniq = exports.union = exports.unappend = exports.tupled = exports.traverseWithIndex = exports.traverseTap = exports.traverse = exports.tap = exports.tail = exports.splitAt = exports.sortBy = exports.sort = exports.sequence = exports.rotate = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRightKind = exports.reduceRight = exports.reduceKind = exports.reduce = exports.range = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.prependAll = exports.prepend = exports.orElse = exports.of = exports.modifyLast = exports.modifyHead = exports.modifyAt = exports.min = exports.max = exports.matchRight = exports.matchLeft = exports.mapWithIndex = exports.map = exports.makeBy = exports.make = exports.liftSemigroup = exports.liftMonoid = exports.lift3 = exports.lift2 = exports.let = exports.last = exports.isOutOfBound = exports.intersperse = exports.intercalate = exports.init = exports.imap = exports.head = exports.groupBy = exports.group = exports.from = exports.foldMapWithIndex = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMap = exports.flap = exports.extend = void 0;
exports.zipWith = exports.zipMany = exports.zipAll = void 0;
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));
var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));
var chainable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Chainable"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroup"));
var covariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Covariant"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/FlatMap"));
var sortable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));
var foldable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Foldable"));
var invariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Invariant"));
var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var order = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Order"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));
var _Equal = /*#__PURE__*/require("@fp-ts/data/Equal");

@@ -255,3 +268,3 @@

* import * as RNEA from '@fp-ts/data/NonEmptyReadonlyArray'
* import { contramap } from '@fp-ts/core/Sortable'
* import { contramap } from '@fp-ts/core/typeclass/Order'
* import * as S from '@fp-ts/data/String'

@@ -266,5 +279,5 @@ * import * as N from '@fp-ts/data/Number'

*
* const byName = pipe(S.Sortable, contramap((p: Person) => p.name))
* const byName = pipe(S.Order, contramap((p: Person) => p.name))
*
* const byAge = pipe(N.Sortable, contramap((p: Person) => p.age))
* const byAge = pipe(N.Order, contramap((p: Person) => p.age))
*

@@ -295,3 +308,3 @@ * const sortByNameByAge = RNEA.sortBy([byName, byAge])

if (internal.isNonEmpty(ords)) {
return sort(sortable.getMonoid().combineAll(ords));
return sort(order.getMonoid().combineAll(ords));
}

@@ -641,5 +654,5 @@

const crossWith = (that, f) => self => {
const product = that => self => {
const first = head(self);
const out = [f(first, head(that)), ...tail(that).map(b => f(first, b))];
const out = [[first, head(that)], ...tail(that).map(b => [first, b])];
const rest = tail(self);

@@ -653,3 +666,3 @@

for (let j = 0; j < that.length; j++) {
out.push(f(rest[i], that[j]));
out.push([rest[i], that[j]]);
}

@@ -665,15 +678,7 @@ }

exports.crossWith = crossWith;
exports.product = product;
const cross = that => crossWith(that, (a, b) => [a, b]);
/**
* @since 1.0.0
*/
const productMany = collection => self => {
const arrays = internal.fromIterable(collection);
exports.cross = cross;
const crossMany = collection => self => {
const arrays = Array.from(collection);
if (arrays.length === 0) {

@@ -711,5 +716,5 @@ return [self];

exports.crossMany = crossMany;
exports.productMany = productMany;
const crossAll = collection => {
const productAll = collection => {
const arrays = Array.from(collection);

@@ -721,3 +726,3 @@

return crossMany(arrays.slice(1))(arrays[0]);
return productMany(arrays.slice(1))(arrays[0]);
};

@@ -737,3 +742,3 @@ /**

exports.crossAll = crossAll;
exports.productAll = productAll;

@@ -904,10 +909,5 @@ const prependAll = middle => as => {

const FlatMap = {
map,
flatMap
};
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0

@@ -917,12 +917,9 @@ */

exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
const andThen = /*#__PURE__*/flatMap_.andThen(FlatMap);
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @since 1.0.0
*/
exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
exports.andThen = andThen;
const composeKleisliArrow = /*#__PURE__*/flatMap_.composeKleisliArrow(FlatMap);
/**

@@ -932,3 +929,3 @@ * @since 1.0.0

exports.zipRight = zipRight;
exports.composeKleisliArrow = composeKleisliArrow;

@@ -943,5 +940,5 @@ const ap = fa => self => (0, _Function.pipe)(self, flatMap(f => (0, _Function.pipe)(fa, map(a => f(a)))));

const extend = f => as => {
let next = tail(as);
const out = [f(as)];
const extend = f => self => {
let next = tail(self);
const out = [f(self)];

@@ -961,8 +958,2 @@ while (internal.isNonEmpty(next)) {

exports.extend = extend;
const duplicate = /*#__PURE__*/extend(_Function.identity);
/**
* @since 1.0.0
*/
exports.duplicate = duplicate;
const flatten = /*#__PURE__*/flatMap(_Function.identity);

@@ -985,3 +976,3 @@ /**

/**
* @category instances
* @category traversing
* @since 1.0.0

@@ -992,15 +983,6 @@ */

exports.mapWithIndex = mapWithIndex;
const FunctorWithIndex = {
mapWithIndex
};
/**
* @category traversing
* @since 1.0.0
*/
exports.FunctorWithIndex = FunctorWithIndex;
const traverseWithIndex = Semigroupal => f => self => {
const traverseWithIndex = F => f => self => {
const fbs = (0, _Function.pipe)(self, mapWithIndex(f));
return (0, _Function.pipe)(head(fbs), Semigroupal.zipMany(tail(fbs)));
return (0, _Function.pipe)(head(fbs), F.productMany(tail(fbs)));
};

@@ -1015,3 +997,3 @@ /**

const traverse = Semigroupal => f => traverseWithIndex(Semigroupal)(f);
const traverse = F => f => traverseWithIndex(F)(f);
/**

@@ -1025,3 +1007,3 @@ * @category traversing

const sequence = Semigroupal => traverse(Semigroupal)(_Function.identity);
const sequence = F => traverse(F)(_Function.identity);
/**

@@ -1033,3 +1015,3 @@ * @since 1.0.0

exports.sequence = sequence;
const extract = internal.head;
const imap = /*#__PURE__*/covariant.imap(map);
/**

@@ -1040,4 +1022,35 @@ * @category instances

exports.extract = extract;
const Functor = {
exports.imap = imap;
const Invariant = {
imap
};
/**
* @category do notation
* @since 1.0.0
*/
exports.Invariant = Invariant;
const bindTo = /*#__PURE__*/invariant.bindTo(Invariant);
/**
* @since 1.0.0
*/
exports.bindTo = bindTo;
const tupled = /*#__PURE__*/invariant.tupled(Invariant);
/**
* @category instances
* @since 1.0.0
*/
exports.tupled = tupled;
const Of = {
of
};
/**
* @category instances
* @since 1.0.0
*/
exports.Of = Of;
const Covariant = { ...Invariant,
map

@@ -1050,4 +1063,4 @@ };

exports.Functor = Functor;
const flap = /*#__PURE__*/functor.flap(Functor);
exports.Covariant = Covariant;
const flap = /*#__PURE__*/covariant.flap(Covariant);
/**

@@ -1061,6 +1074,4 @@ * Maps the success value of this effect to the specified constant value.

exports.flap = flap;
const as = /*#__PURE__*/functor.as(Functor);
const as = /*#__PURE__*/covariant.as(Covariant);
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping

@@ -1071,3 +1082,3 @@ * @since 1.0.0

exports.as = as;
const unit = /*#__PURE__*/functor.unit(Functor);
const asUnit = /*#__PURE__*/covariant.asUnit(Covariant);
/**

@@ -1078,9 +1089,37 @@ * @category instances

exports.unit = unit;
const Semigroupal = {
map,
zipWith: crossWith,
zipMany: crossMany
exports.asUnit = asUnit;
const Pointed = { ...Of,
...Covariant
};
/**
* @category instances
* @since 1.0.0
*/
exports.Pointed = Pointed;
const NonEmptyProduct = {
product,
productMany,
...Covariant
};
/**
* @category instances
* @since 1.0.0
*/
exports.NonEmptyProduct = NonEmptyProduct;
const Product = { ...Of,
...NonEmptyProduct,
productAll
};
/**
* @category instances
* @since 1.0.0
*/
exports.Product = Product;
const NonEmptyApplicative = { ...NonEmptyProduct,
...Covariant
};
/**
* Lifts a binary function into `NonEmptyReadonlyArray`.

@@ -1092,4 +1131,4 @@ *

exports.Semigroupal = Semigroupal;
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
exports.NonEmptyApplicative = NonEmptyApplicative;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
/**

@@ -1103,4 +1142,10 @@ * Lifts a ternary function into `NonEmptyReadonlyArray`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
/**
* @since 1.0.0
*/
exports.lift3 = lift3;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
/**
* @category instances

@@ -1110,11 +1155,13 @@ * @since 1.0.0

exports.lift3 = lift3;
const Monoidal = {
map,
of,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: crossAll
exports.liftSemigroup = liftSemigroup;
const Applicative = { ...NonEmptyApplicative,
...Product
};
/**
* @since 1.0.0
*/
exports.Applicative = Applicative;
const liftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
/**
* @category instances

@@ -1124,9 +1171,23 @@ * @since 1.0.0

exports.Monoidal = Monoidal;
const Monad = {
map,
of,
flatMap
exports.liftMonoid = liftMonoid;
const Monad = { ...Pointed,
...FlatMap
};
/**
* @category instances
* @since 1.0.0
*/
exports.Monad = Monad;
const Chainable = { ...FlatMap,
...Covariant
};
/**
* @category do notation
* @since 1.0.0
*/
exports.Chainable = Chainable;
const bind = /*#__PURE__*/chainable.bind(Chainable);
/**
* Returns an effect that effectfully "peeks" at the success of this effect.

@@ -1149,6 +1210,6 @@ *

exports.Monad = Monad;
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
exports.bind = bind;
const tap = /*#__PURE__*/chainable.tap(Chainable);
/**
* @category folding
* @category instances
* @since 1.0.0

@@ -1158,5 +1219,32 @@ */

exports.tap = tap;
const andThenDiscard = /*#__PURE__*/chainable.andThenDiscard(Chainable);
/**
* @category folding
* @since 1.0.0
*/
exports.andThenDiscard = andThenDiscard;
const reduce = (b, f) => self => self.reduce((b, a) => f(b, a), b);
/**
* @category folding
* @since 1.0.0
*/
exports.reduce = reduce;
const reduceRight = (b, f) => self => self.reduceRight((b, a) => f(b, a), b);
/**
* @category instances
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
const Foldable = {
reduce,
reduceRight
};
/**
* **Note**. The constraint is relaxed: a `Semigroup` instead of a `Monoid`.

@@ -1168,5 +1256,4 @@ *

exports.Foldable = Foldable;
exports.reduce = reduce;
const foldMap = S => f => self => self.slice(1).reduce((s, a) => S.combine(f(a))(s), f(self[0]));

@@ -1180,4 +1267,10 @@ /**

exports.foldMap = foldMap;
const reduceKind = /*#__PURE__*/foldable.reduceKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
const reduceRight = (b, f) => self => self.reduceRight((b, a) => f(a, b), b);
exports.reduceKind = reduceKind;
const reduceRightKind = /*#__PURE__*/foldable.reduceRightKind(Foldable);
/**

@@ -1188,4 +1281,10 @@ * @category folding

exports.reduceRightKind = reduceRightKind;
const foldMapKind = /*#__PURE__*/foldable.foldMapKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
exports.foldMapKind = foldMapKind;

@@ -1214,3 +1313,3 @@ const reduceWithIndex = (b, f) => self => self.reduce((b, a, i) => f(i, b, a), b);

/**
* @category folding
* @category instances
* @since 1.0.0

@@ -1221,11 +1320,2 @@ */

exports.reduceRightWithIndex = reduceRightWithIndex;
const reduceKind = Flattenable => (fb, f) => reduce(fb, (fb, a) => (0, _Function.pipe)(fb, Flattenable.flatMap(b => f(b, a))));
/**
* @category instances
* @since 1.0.0
*/
exports.reduceKind = reduceKind;
const Traversable = {

@@ -1235,3 +1325,2 @@ traverse

/**
* @category instances
* @since 1.0.0

@@ -1241,20 +1330,4 @@ */

exports.Traversable = Traversable;
const TraversableWithIndex = {
traverseWithIndex
};
const traverseTap = /*#__PURE__*/traversable.traverseTap(Traversable);
/**
* @category instances
* @since 1.0.0
*/
exports.TraversableWithIndex = TraversableWithIndex;
const Comonad = {
map,
extend,
extract
}; // -------------------------------------------------------------------------------------
// do notation
// -------------------------------------------------------------------------------------
/**
* @category do notation

@@ -1264,21 +1337,9 @@ * @since 1.0.0

exports.Comonad = Comonad;
exports.traverseTap = traverseTap;
const Do = /*#__PURE__*/of(internal.Do);
/**
* @category do notation
* @since 1.0.0
*/
exports.Do = Do;
const bindTo = /*#__PURE__*/functor.bindTo(Functor);
exports.bindTo = bindTo;
const let_ = /*#__PURE__*/functor.let(Functor);
const let_ = /*#__PURE__*/covariant.let(Covariant);
exports.let = let_;
/**
* @category do notation
* @since 1.0.0
*/
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**
* A variant of `bind` that sequentially ignores the scope.

@@ -1289,41 +1350,19 @@ *

*/
exports.bind = bind;
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing
// -------------------------------------------------------------------------------------
const bindNonEmptyReadonlyArray = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.bindRight = bindRight;
const Zip = /*#__PURE__*/of(internal.empty);
exports.bindNonEmptyReadonlyArray = bindNonEmptyReadonlyArray;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.Zip = Zip;
const tupled = /*#__PURE__*/functor.tupled(Functor);
exports.productFlatten = productFlatten;
const head = internal.head;
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal);
/**
* @since 1.0.0
*/
exports.zipFlatten = zipFlatten;
const head = extract;
/**
* @since 1.0.0
*/
exports.head = head;

@@ -1330,0 +1369,0 @@ const tail = internal.tail;

/**
* @since 1.0.0
*/
import type * as bounded from "@fp-ts/core/Bounded";
import type * as monoid from "@fp-ts/core/Monoid";
import * as semigroup from "@fp-ts/core/Semigroup";
import type * as sortable from "@fp-ts/core/Sortable";
import type * as bounded from "@fp-ts/core/typeclass/Bounded";
import type * as monoid from "@fp-ts/core/typeclass/Monoid";
import type * as order from "@fp-ts/core/typeclass/Order";
import * as semigroup from "@fp-ts/core/typeclass/Semigroup";
import type { Refinement } from "@fp-ts/data/Refinement";

@@ -38,3 +38,3 @@ /**

*/
export declare const Sortable: sortable.Sortable<number>;
export declare const Order: order.Order<number>;
/**

@@ -89,10 +89,2 @@ * @category instances

export declare const MonoidMultiply: monoid.Monoid<number>;
/**
* @since 1.0.0
*/
export declare const sumAll: (collection: Iterable<number>) => number;
/**
* @since 1.0.0
*/
export declare const multiplyAll: (collection: Iterable<number>) => number;
//# sourceMappingURL=Number.d.ts.map

@@ -6,5 +6,5 @@ "use strict";

});
exports.sumAll = exports.sum = exports.sub = exports.multiplyAll = exports.multiply = exports.isNumber = exports.increment = exports.decrement = exports.Sortable = exports.SemigroupSum = exports.SemigroupMultiply = exports.MonoidSum = exports.MonoidMultiply = exports.Bounded = void 0;
exports.sum = exports.sub = exports.multiply = exports.isNumber = exports.increment = exports.decrement = exports.SemigroupSum = exports.SemigroupMultiply = exports.Order = exports.MonoidSum = exports.MonoidMultiply = exports.Bounded = void 0;
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroup"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));

@@ -67,3 +67,3 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

exports.decrement = decrement;
const Sortable = {
const Order = {
compare: that => self => self < that ? -1 : self > that ? 1 : 0

@@ -76,7 +76,7 @@ };

exports.Sortable = Sortable;
exports.Order = Order;
const Bounded = {
compare: Sortable.compare,
maximum: Infinity,
minimum: -Infinity
compare: Order.compare,
maxBound: Infinity,
minBound: -Infinity
};

@@ -112,3 +112,22 @@ /**

exports.SemigroupSum = SemigroupSum;
const SemigroupMultiply = /*#__PURE__*/semigroup.fromCombine(multiply);
const SemigroupMultiply = {
combine: multiply,
combineMany: collection => self => {
if (self === 0) {
return 0;
}
let out = self;
for (const n of collection) {
if (n === 0) {
return 0;
}
out = out * n;
}
return out;
}
};
/**

@@ -124,6 +143,4 @@ * `number` monoid under addition.

exports.SemigroupMultiply = SemigroupMultiply;
const MonoidSum = {
combine: SemigroupSum.combine,
combineMany: SemigroupSum.combineMany,
combineAll: all => SemigroupSum.combineMany(all)(0),
const MonoidSum = { ...SemigroupSum,
combineAll: collection => SemigroupSum.combineMany(collection)(0),
empty: 0

@@ -141,21 +158,7 @@ };

exports.MonoidSum = MonoidSum;
const MonoidMultiply = {
combine: SemigroupMultiply.combine,
combineMany: SemigroupMultiply.combineMany,
combineAll: all => SemigroupMultiply.combineMany(all)(1),
const MonoidMultiply = { ...SemigroupMultiply,
combineAll: collection => SemigroupMultiply.combineMany(collection)(1),
empty: 1
};
/**
* @since 1.0.0
*/
exports.MonoidMultiply = MonoidMultiply;
const sumAll = MonoidSum.combineAll;
/**
* @since 1.0.0
*/
exports.sumAll = sumAll;
const multiplyAll = MonoidMultiply.combineAll;
exports.multiplyAll = multiplyAll;
//# sourceMappingURL=Number.js.map

@@ -15,23 +15,29 @@ /**

*/
import type * as extendable from "@fp-ts/core/Extendable";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";
import type { Kind, TypeLambda } from "@fp-ts/core/HKT";
import type * as monad from "@fp-ts/core/Monad";
import type * as monoid from "@fp-ts/core/Monoid";
import type * as monoidal from "@fp-ts/core/Monoidal";
import type * as pointed from "@fp-ts/core/Pointed";
import type * as semigroup from "@fp-ts/core/Semigroup";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as sortable from "@fp-ts/core/Sortable";
import * as traversable from "@fp-ts/core/Traversable";
import type * as alternative from "@fp-ts/core/typeclass/Alternative";
import * as applicative from "@fp-ts/core/typeclass/Applicative";
import * as chainable from "@fp-ts/core/typeclass/Chainable";
import * as compactable from "@fp-ts/core/typeclass/Compactable";
import type * as coproduct_ from "@fp-ts/core/typeclass/Coproduct";
import * as covariant from "@fp-ts/core/typeclass/Covariant";
import * as filterable from "@fp-ts/core/typeclass/Filterable";
import * as flatMap_ from "@fp-ts/core/typeclass/FlatMap";
import * as foldable from "@fp-ts/core/typeclass/Foldable";
import * as invariant from "@fp-ts/core/typeclass/Invariant";
import type * as monad from "@fp-ts/core/typeclass/Monad";
import type { Monoid } from "@fp-ts/core/typeclass/Monoid";
import type * as nonEmptyAlternative from "@fp-ts/core/typeclass/NonEmptyAlternative";
import * as nonEmptyApplicative from "@fp-ts/core/typeclass/NonEmptyApplicative";
import * as nonEmptyCoproduct from "@fp-ts/core/typeclass/NonEmptyCoproduct";
import * as nonEmptyProduct from "@fp-ts/core/typeclass/NonEmptyProduct";
import * as of_ from "@fp-ts/core/typeclass/Of";
import type { Order } from "@fp-ts/core/typeclass/Order";
import type * as pointed from "@fp-ts/core/typeclass/Pointed";
import * as product_ from "@fp-ts/core/typeclass/Product";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as traversable from "@fp-ts/core/typeclass/Traversable";
import type { Either } from "@fp-ts/data/Either";
import type { LazyArg } from "@fp-ts/data/Function";
import type { NonEmptyReadonlyArray } from "@fp-ts/data/NonEmptyReadonlyArray";
import type { Predicate } from "@fp-ts/data/Predicate";
import type { Refinement } from "@fp-ts/data/Refinement";
import type * as compactable from "@fp-ts/data/typeclasses/Compactable";
import * as filterable from "@fp-ts/data/typeclasses/Filterable";
import * as fromOption_ from "@fp-ts/data/typeclasses/FromOption";
import * as traversableFilterable from "@fp-ts/data/typeclasses/TraversableFilterable";
/**

@@ -62,5 +68,10 @@ * @category models

export interface OptionTypeLambda extends TypeLambda {
readonly type: Option<this["Out1"]>;
readonly type: Option<this["Target"]>;
}
/**
* @category constructors
* @since 1.0.0
*/
export declare const some: <A>(a: A) => Option<A>;
/**
* Returns `true` if the specified value is an instance of `Option`, `false`

@@ -81,2 +92,403 @@ * otherwise.

/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
export declare const map: <A, B>(f: (a: A) => B) => (self: Option<A>) => Option<B>;
/**
* @category mapping
* @since 1.0.0
*/
export declare const imap: <A_1, B_1>(to: (a: A_1) => B_1, from: (b: B_1) => A_1) => <R_1, O_1, E_1>(self: Option<A_1>) => Option<B_1>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Invariant: invariant.Invariant<OptionTypeLambda>;
/**
* @since 1.0.0
*/
export declare const tupled: <A>(self: Option<A>) => Option<readonly [A]>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: Option<A>) => Option<{
readonly [K in N]: A;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Covariant: covariant.Covariant<OptionTypeLambda>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => (self: Option<A>) => Option<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export {
/**
* @category do notation
* @since 1.0.0
*/
let_ as let };
/**
* @category mapping
* @since 1.0.0
*/
export declare const flap: <A>(a: A) => <B>(fab: Option<(a: A) => B>) => Option<B>;
/**
* Maps the success value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
export declare const as: <B>(b: B) => <_>(self: Option<_>) => Option<B>;
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
export declare const asUnit: <_>(self: Option<_>) => Option<void>;
/**
* @since 1.0.0
*/
export declare const of: <A>(a: A) => Option<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Of: of_.Of<OptionTypeLambda>;
/**
* @since 1.0.0
*/
export declare const unit: Option<void>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const Do: Option<{}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Pointed: pointed.Pointed<OptionTypeLambda>;
/**
* @category sequencing
* @since 1.0.0
*/
export declare const flatMap: <A, B>(f: (a: A) => Option<B>) => (self: Option<A>) => Option<B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const FlatMap: flatMap_.FlatMap<OptionTypeLambda>;
/**
* @since 1.0.0
*/
export declare const flatten: <A>(self: Option<Option<A>>) => Option<A>;
/**
* @since 1.0.0
*/
export declare const andThen: <B>(that: Option<B>) => <_>(self: Option<_>) => Option<B>;
/**
* @since 1.0.0
*/
export declare const composeKleisliArrow: <B, C>(bfc: (b: B) => Option<C>) => <A>(afb: (a: A) => Option<B>) => (a: A) => Option<C>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Chainable: chainable.Chainable<OptionTypeLambda>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => Option<B>) => (self: Option<A>) => Option<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
export declare const tap: <A, _>(f: (a: A) => Option<_>) => (self: Option<A>) => Option<A>;
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const andThenDiscard: <_>(that: Option<_>) => <A>(self: Option<A>) => Option<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monad: monad.Monad<OptionTypeLambda>;
/**
* @since 1.0.0
*/
export declare const product: <B>(that: Option<B>) => <A>(self: Option<A>) => Option<readonly [A, B]>;
/**
* @since 1.0.0
*/
export declare const productMany: <A>(collection: Iterable<Option<A>>) => (self: Option<A>) => Option<readonly [A, ...A[]]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<OptionTypeLambda>;
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
export declare const bindOption: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: Option<B>) => (self: Option<A>) => Option<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* @since 1.0.0
*/
export declare const productFlatten: <B>(fb: Option<B>) => <A extends ReadonlyArray<unknown>>(self: Option<A>) => Option<readonly [...A, B]>;
/**
* @since 1.0.0
*/
export declare const productAll: <A>(collection: Iterable<Option<A>>) => Option<readonly A[]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Product: product_.Product<OptionTypeLambda>;
/**
* @since 1.0.0
*/
export declare const tuple: <T extends ReadonlyArray<Option<any>>>(...tuple: T) => Option<Readonly<{
[I in keyof T]: [T[I]] extends [Option<infer A>] ? A : never;
}>>;
/**
* @since 1.0.0
*/
export declare const struct: <R extends Record<string, Option<any>>>(r: R) => Option<{
readonly [K in keyof R]: [R[K]] extends [Option<infer A>] ? A : never;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<OptionTypeLambda>;
/**
* Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are
* combined using the provided `Semigroup`
*
* | x | y | combine(y)(x) |
* | ------- | ------- | ------------------- |
* | none | none | none |
* | some(a) | none | some(a) |
* | none | some(a) | some(a) |
* | some(a) | some(b) | some(combine(b)(a)) |
*
* @example
* import { getMonoid, some, none } from '@fp-ts/data/Option'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const M = getMonoid(N.SemigroupSum)
* assert.deepStrictEqual(pipe(none, M.combine(none)), none)
* assert.deepStrictEqual(pipe(some(1), M.combine(none)), some(1))
* assert.deepStrictEqual(pipe(none, M.combine(some(1))), some(1))
* assert.deepStrictEqual(pipe(some(1), M.combine(some(2))), some(3))
*
* @category lifting
* @since 1.0.0
*/
export declare const getMonoid: <A>(Semigroup: Semigroup<A>) => Monoid<Option<A>>;
/**
* Lifts a binary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
export declare const lift2: <A, B, C>(f: (a: A, b: B) => C) => (fa: Option<A>, fb: Option<B>) => Option<C>;
/**
* Lifts a ternary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
export declare const lift3: <A, B, C, D>(f: (a: A, b: B, c: C) => D) => (fa: Option<A>, fb: Option<B>, fc: Option<C>) => Option<D>;
/**
* @since 1.0.0
*/
export declare const ap: <A>(fa: Option<A>) => <B>(self: Option<(a: A) => B>) => Option<B>;
/**
* @since 1.0.0
*/
export declare const liftSemigroup: <A>(S: Semigroup<A>) => Semigroup<Option<A>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Applicative: applicative.Applicative<OptionTypeLambda>;
/**
* @since 1.0.0
*/
export declare const liftMonoid: <A>(M: Monoid<A>) => Monoid<Option<A>>;
/**
* @since 1.0.0
*/
export declare const coproduct: <B>(that: Option<B>) => <A>(self: Option<A>) => Option<B | A>;
/**
* @since 1.0.0
*/
export declare const coproductMany: <A>(collection: Iterable<Option<A>>) => (self: Option<A>) => Option<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyCoproduct: nonEmptyCoproduct.NonEmptyCoproduct<OptionTypeLambda>;
/**
* @since 1.0.0
*/
export declare const getSemigroup: <A>() => Semigroup<Option<A>>;
/**
* @since 1.0.0
*/
export declare const coproductEither: <B>(that: Option<B>) => <A>(self: Option<A>) => Option<Either<A, B>>;
/**
* @since 1.0.0
*/
export declare const coproductAll: <A>(collection: Iterable<Option<A>>) => Option<A>;
/**
* @since 1.0.0
*/
export declare const zero: <A>() => Option<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Coproduct: coproduct_.Coproduct<OptionTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyAlternative: nonEmptyAlternative.NonEmptyAlternative<OptionTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Alternative: alternative.Alternative<OptionTypeLambda>;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduce: <B, A>(b: B, f: (b: B, a: A) => B) => (self: Option<A>) => B;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (b: B, a: A) => B) => (self: Option<A>) => B;
/**
* @category instances
* @since 1.0.0
*/
export declare const Foldable: foldable.Foldable<OptionTypeLambda>;
/**
* @category folding
* @since 1.0.0
*/
export declare const foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => (self: Option<A>) => M;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toReadonlyArray: <A>(self: Option<A>) => ReadonlyArray<A>;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toReadonlyArrayWith: <A, B>(f: (a: A) => B) => (self: Option<A>) => ReadonlyArray<B>;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: Option<A>) => Kind<G, R, O, E, B>;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRightKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: Option<A>) => Kind<G, R, O, E, B>;
/**
* @category folding
* @since 1.0.0
*/
export declare const foldMapKind: <G extends TypeLambda>(G: coproduct_.Coproduct<G>) => <A, R, O, E, B>(f: (a: A) => Kind<G, R, O, E, B>) => (self: Option<A>) => Kind<G, R, O, E, B>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const compact: <A>(foa: Option<Option<A>>) => Option<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Compactable: compactable.Compactable<OptionTypeLambda>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const separate: <A, B>(self: Option<Either<A, B>>) => readonly [Option<A>, Option<B>];
/**
* @category filtering
* @since 1.0.0
*/
export declare const filterMap: <A, B>(f: (a: A) => Option<B>) => (fa: Option<A>) => Option<B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Filterable: filterable.Filterable<OptionTypeLambda>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const filter: {
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): (fc: Option<C>) => Option<B>;
<B extends A, A = B>(predicate: Predicate<A>): (fb: Option<B>) => Option<B>;
};
/**
* @category filtering
* @since 1.0.0
*/
export declare const partition: {
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): (fc: Option<C>) => readonly [Option<C>, Option<B>];
<B extends A, A = B>(predicate: Predicate<A>): (fb: Option<B>) => readonly [Option<B>, Option<B>];
};
/**
* @category filtering
* @since 1.0.0
*/
export declare const partitionMap: <A, B, C>(f: (a: A) => Either<B, C>) => (fa: Option<A>) => readonly [Option<B>, Option<C>];
/**
* @category traversing
* @since 1.0.0
*/
export declare const traverse: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: Option<A>) => Kind<F, R, O, E, Option<B>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Traversable: traversable.Traversable<OptionTypeLambda>;
/**
* @category traversing
* @since 1.0.0
*/
export declare const sequence: <F extends TypeLambda>(F: applicative.Applicative<F>) => <R, O, E, A>(fas: Option<Kind<F, R, O, E, A>>) => Kind<F, R, O, E, Option<A>>;
/**
* @category traversing
* @since 1.0.0
*/
export declare const traverseTap: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: Option<A>) => Kind<F, R, O, E, Option<A>>;
/**
* Returns `true` if the option is `None`, `false` otherwise.

@@ -93,3 +505,3 @@ *

*/
export declare const isNone: (fa: Option<unknown>) => fa is None;
export declare const isNone: <A>(self: Option<A>) => self is None;
/**

@@ -107,3 +519,3 @@ * Returns `true` if the option is an instance of `Some`, `false` otherwise.

*/
export declare const isSome: <A>(fa: Option<A>) => fa is Some<A>;
export declare const isSome: <A>(self: Option<A>) => self is Some<A>;
/**

@@ -117,9 +529,2 @@ * `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value.

/**
* Constructs a `Some`. Represents an optional value that exists.
*
* @category constructors
* @since 1.0.0
*/
export declare const some: <A>(a: A) => Option<A>;
/**
* @category conversions

@@ -201,3 +606,3 @@ * @since 1.0.0

*/
export declare const getOrElse: <B>(onNone: B) => <A>(ma: Option<A>) => B | A;
export declare const getOrElse: <B>(onNone: B) => <A>(self: Option<A>) => B | A;
/**

@@ -363,47 +768,2 @@ * Converts an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a

/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
export declare const map: <A, B>(f: (a: A) => B) => (fa: Option<A>) => Option<B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Pointed: pointed.Pointed<OptionTypeLambda>;
/**
* @category sequencing
* @since 1.0.0
*/
export declare const flatMap: <A, B>(f: (a: A) => Option<B>) => (self: Option<A>) => Option<B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const FlatMap: flatMap_.FlatMap<OptionTypeLambda>;
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const zipLeft: (that: Option<unknown>) => <A>(self: Option<A>) => Option<A>;
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @since 1.0.0
*/
export declare const zipRight: <A>(that: Option<A>) => (self: Option<unknown>) => Option<A>;
/**
* @since 1.0.0
*/
export declare const ap: <A>(fa: Option<A>) => <B>(fab: Option<(a: A) => B>) => Option<B>;
/**
* @since 1.0.0
*/
export declare const flatten: <A>(mma: Option<Option<A>>) => Option<A>;
/**
* Lazy version of `orElse`.

@@ -466,37 +826,4 @@ *

/**
* @since 1.0.0
*/
export declare const extend: <A, B>(f: (wa: Option<A>) => B) => (wa: Option<A>) => Option<B>;
/**
* @since 1.0.0
*/
export declare const duplicate: <A>(ma: Option<A>) => Option<Option<A>>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const compact: <A>(foa: Option<Option<A>>) => Option<A>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const separate: <A, B>(fe: Option<Either<A, B>>) => readonly [Option<A>, Option<B>];
/**
* @category filtering
* @since 1.0.0
*/
export declare const filterMap: <A, B>(f: (a: A) => Option<B>) => (fa: Option<A>) => Option<B>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const partitionMap: <A, B, C>(f: (a: A) => Either<B, C>) => (fa: Option<A>) => readonly [Option<B>, Option<C>];
/**
* @category traversing
* @since 1.0.0
*/
export declare const traverse: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, B>) => (ta: Option<A>) => Kind<F, S, R, O, E, Option<B>>;
/**
* The `Sortable` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Sortable` instance for
* The `Order` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Order` instance for
* the type the `Option` contains.

@@ -507,7 +834,7 @@ *

* @example
* import { none, some, liftSortable } from '@fp-ts/data/Option'
* import { none, some, liftOrder } from '@fp-ts/data/Option'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const O = liftSortable(N.Sortable)
* const O = liftOrder(N.Order)
* assert.strictEqual(pipe(none, O.compare(none)), 0)

@@ -519,190 +846,6 @@ * assert.strictEqual(pipe(none, O.compare(some(1))), -1)

*
* @category instances
* @since 1.0.0
*/
export declare const liftSortable: <A>(O: sortable.Sortable<A>) => sortable.Sortable<Option<A>>;
export declare const liftOrder: <A>(O: Order<A>) => Order<Option<A>>;
/**
* Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are
* combined using the provided `Semigroup`
*
* | x | y | combine(y)(x) |
* | ------- | ------- | ------------------- |
* | none | none | none |
* | some(a) | none | some(a) |
* | none | some(a) | some(a) |
* | some(a) | some(b) | some(combine(b)(a)) |
*
* @example
* import { getMonoid, some, none } from '@fp-ts/data/Option'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const M = getMonoid(N.SemigroupSum)
* assert.deepStrictEqual(pipe(none, M.combine(none)), none)
* assert.deepStrictEqual(pipe(some(1), M.combine(none)), some(1))
* assert.deepStrictEqual(pipe(none, M.combine(some(1))), some(1))
* assert.deepStrictEqual(pipe(some(1), M.combine(some(2))), some(3))
*
* @category instances
* @since 1.0.0
*/
export declare const getMonoid: <A>(Semigroup: semigroup.Semigroup<A>) => monoid.Monoid<Option<A>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Functor: functor.Functor<OptionTypeLambda>;
/**
* @category mapping
* @since 1.0.0
*/
export declare const flap: <A>(a: A) => <B>(fab: Option<(a: A) => B>) => Option<B>;
/**
* Maps the success value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
export declare const as: <B>(b: B) => (self: Option<unknown>) => Option<B>;
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
export declare const unit: (self: Option<unknown>) => Option<void>;
/**
* Sequentially zips this effect with the specified effect using the specified combiner function.
*
* @category tuple sequencing
* @since 1.0.0
*/
export declare const zipWith: <B, A, C>(that: Option<B>, f: (a: A, b: B) => C) => (self: Option<A>) => Option<C>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Semigroupal: semigroupal.Semigroupal<OptionTypeLambda>;
/**
* Lifts a binary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
export declare const lift2: <A, B, C>(f: (a: A, b: B) => C) => (fa: Option<A>, fb: Option<B>) => Option<C>;
/**
* Lifts a ternary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
export declare const lift3: <A, B, C, D>(f: (a: A, b: B, c: C) => D) => (fa: Option<A>, fb: Option<B>, fc: Option<C>) => Option<D>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monoidal: monoidal.Monoidal<OptionTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monad: monad.Monad<OptionTypeLambda>;
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
export declare const tap: <A>(f: (a: A) => Option<unknown>) => (self: Option<A>) => Option<A>;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toReadonlyArray: <A>(self: Option<A>) => readonly A[];
/**
* @category folding
* @since 1.0.0
*/
export declare const reduce: <B, A>(b: B, f: (b: B, a: A) => B) => (self: Option<A>) => B;
/**
* @category folding
* @since 1.0.0
*/
export declare const foldMap: <M>(Monoid: monoid.Monoid<M>) => <A>(f: (a: A) => M) => (self: Option<A>) => M;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (a: A, b: B) => B) => (self: Option<A>) => B;
/**
* @category instances
* @since 1.0.0
*/
export declare const Extendable: extendable.Extendable<OptionTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Compactable: compactable.Compactable<OptionTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Filterable: filterable.Filterable<OptionTypeLambda>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const filter: {
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): (fc: Option<C>) => Option<B>;
<B extends A, A = B>(predicate: Predicate<A>): (fb: Option<B>) => Option<B>;
};
/**
* @category filtering
* @since 1.0.0
*/
export declare const partition: {
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): (fc: Option<C>) => readonly [Option<C>, Option<B>];
<B extends A, A = B>(predicate: Predicate<A>): (fb: Option<B>) => readonly [Option<B>, Option<B>];
};
/**
* @category instances
* @since 1.0.0
*/
export declare const Traversable: traversable.Traversable<OptionTypeLambda>;
/**
* @category traversing
* @since 1.0.0
*/
export declare const sequence: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <S, R, O, E, A>(fas: Option<Kind<F, S, R, O, E, A>>) => Kind<F, S, R, O, E, Option<A>>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const traverseFilterMap: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, Option<B>>) => (ta: Option<A>) => Kind<F, S, R, O, E, Option<B>>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const traversePartitionMap: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <A, S, R, O, E, B, C>(f: (a: A) => Kind<F, S, R, O, E, Either<B, C>>) => (wa: Option<A>) => Kind<F, S, R, O, E, readonly [Option<B>, Option<C>]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const TraversableFilterable: traversableFilterable.TraversableFilterable<OptionTypeLambda>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const traverseFilter: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => (self: Option<B>) => Kind<F, S, R, O, E, Option<B>>;
/**
* @category filtering
* @since 1.0.0
*/
export declare const traversePartition: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => (self: Option<B>) => Kind<F, S, R, O, E, readonly [Option<B>, Option<B>]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const FromOption: fromOption_.FromOption<OptionTypeLambda>;
/**
* Returns a *smart constructor* based on the given predicate.

@@ -781,91 +924,2 @@ *

export declare const exists: <A>(predicate: Predicate<A>) => (ma: Option<A>) => boolean;
/**
* @category do notation
* @since 1.0.0
*/
export declare const Do: Option<{}>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: Option<A>) => Option<{
readonly [K in N]: A;
}>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => (self: Option<A>) => Option<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
export {
/**
* @category do notation
* @since 1.0.0
*/
let_ as let };
/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => Option<B>) => (self: Option<A>) => Option<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
export declare const bindRight: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: Option<B>) => (self: Option<A>) => Option<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const Zip: Option<readonly []>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const tupled: <A>(self: Option<A>) => Option<readonly [A]>;
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
export declare const zipFlatten: <B>(fb: Option<B>) => <A extends ReadonlyArray<unknown>>(self: Option<A>) => Option<readonly [...A, B]>;
/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseNonEmptyReadonlyArrayWithIndex: <A, B>(f: (index: number, a: A) => Option<B>) => (as: readonly [A, ...A[]]) => Option<readonly [B, ...B[]]>;
/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseReadonlyArrayWithIndex: <A, B>(f: (index: number, a: A) => Option<B>) => (as: readonly A[]) => Option<readonly B[]>;
/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseNonEmptyReadonlyArray: <A, B>(f: (a: A) => Option<B>) => (as: readonly [A, ...A[]]) => Option<readonly [B, ...B[]]>;
/**
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const traverseReadonlyArray: <A, B>(f: (a: A) => Option<B>) => (as: readonly A[]) => Option<readonly B[]>;
/**
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
export declare const sequenceReadonlyArray: <A>(arr: ReadonlyArray<Option<A>>) => Option<ReadonlyArray<A>>;
//# sourceMappingURL=Option.d.ts.map

@@ -6,14 +6,34 @@ "use strict";

});
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.unit = exports.tupled = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyArray = exports.traversePartitionMap = exports.traversePartition = exports.traverseNonEmptyReadonlyArrayWithIndex = exports.traverseNonEmptyReadonlyArray = exports.traverseFilterMap = exports.traverseFilter = exports.traverse = exports.toUndefined = exports.toReadonlyArray = exports.toNull = exports.toEither = exports.tap = exports.some = exports.sequenceReadonlyArray = exports.sequence = exports.separate = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.orElse = exports.none = exports.match = exports.map = exports.liftThrowable = exports.liftSortable = exports.liftPredicate = exports.liftNullable = exports.liftEither = exports.lift3 = exports.lift2 = exports.let = exports.isSome = exports.isOption = exports.isNone = exports.getOrElse = exports.getMonoid = exports.fromThrowable = exports.fromNullable = exports.fromIterable = exports.fromEither = exports.foldMap = exports.flatten = exports.flatMapNullable = exports.flatMapEither = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.extend = exports.exists = exports.elem = exports.duplicate = exports.compact = exports.catchAll = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.ap = exports.Zip = exports.TraversableFilterable = exports.Traversable = exports.Semigroupal = exports.Pointed = exports.Monoidal = exports.Monad = exports.Functor = exports.FromOption = exports.FlatMap = exports.Filterable = exports.Extendable = exports.Do = exports.Compactable = void 0;
exports.zero = exports.unit = exports.tupled = exports.tuple = exports.traverseTap = exports.traverse = exports.toUndefined = exports.toReadonlyArrayWith = exports.toReadonlyArray = exports.toNull = exports.toEither = exports.tap = exports.struct = exports.some = exports.sequence = exports.separate = exports.reduceRightKind = exports.reduceRight = exports.reduceKind = exports.reduce = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.partitionMap = exports.partition = exports.orElse = exports.of = exports.none = exports.match = exports.map = exports.liftThrowable = exports.liftSemigroup = exports.liftPredicate = exports.liftOrder = exports.liftNullable = exports.liftMonoid = exports.liftEither = exports.lift3 = exports.lift2 = exports.let = exports.isSome = exports.isOption = exports.isNone = exports.imap = exports.getSemigroup = exports.getOrElse = exports.getMonoid = exports.fromThrowable = exports.fromNullable = exports.fromIterable = exports.fromEither = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMapNullable = exports.flatMapEither = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.exists = exports.elem = exports.coproductMany = exports.coproductEither = exports.coproductAll = exports.coproduct = exports.composeKleisliArrow = exports.compact = exports.catchAll = exports.bindTo = exports.bindOption = exports.bind = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThen = exports.Traversable = exports.Product = exports.Pointed = exports.Of = exports.NonEmptyProduct = exports.NonEmptyCoproduct = exports.NonEmptyApplicative = exports.NonEmptyAlternative = exports.Monad = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Filterable = exports.Do = exports.Covariant = exports.Coproduct = exports.Compactable = exports.Chainable = exports.Applicative = exports.Alternative = void 0;
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));
var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));
var chainable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Chainable"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var compactable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Compactable"));
var sortable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));
var covariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Covariant"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Traversable"));
var filterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Filterable"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/FlatMap"));
var foldable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Foldable"));
var invariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Invariant"));
var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var nonEmptyCoproduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyCoproduct"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var order = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Order"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));
var _Equal = /*#__PURE__*/require("@fp-ts/data/Equal");

@@ -27,8 +47,2 @@

var filterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/Filterable"));
var fromOption_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/FromOption"));
var traversableFilterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/TraversableFilterable"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

@@ -38,7 +52,8 @@

// -------------------------------------------------------------------------------------
// refinements
// -------------------------------------------------------------------------------------
/**
* @category constructors
* @since 1.0.0
*/
const some = internal.some;
/**
* Returns `true` if the specified value is an instance of `Option`, `false`

@@ -57,4 +72,676 @@ * otherwise.

*/
exports.some = some;
const isOption = internal.isOption;
/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
exports.isOption = isOption;
const map = f => self => isNone(self) ? none : some(f(self.value));
/**
* @category mapping
* @since 1.0.0
*/
exports.map = map;
const imap = /*#__PURE__*/covariant.imap(map);
/**
* @category instances
* @since 1.0.0
*/
exports.imap = imap;
const Invariant = {
imap
};
/**
* @since 1.0.0
*/
exports.Invariant = Invariant;
const tupled = /*#__PURE__*/invariant.tupled(Invariant);
/**
* @category do notation
* @since 1.0.0
*/
exports.tupled = tupled;
const bindTo = /*#__PURE__*/invariant.bindTo(Invariant);
/**
* @category instances
* @since 1.0.0
*/
exports.bindTo = bindTo;
const Covariant = { ...Invariant,
map
};
exports.Covariant = Covariant;
const let_ = /*#__PURE__*/covariant.let(Covariant);
exports.let = let_;
/**
* @category mapping
* @since 1.0.0
*/
const flap = /*#__PURE__*/covariant.flap(Covariant);
/**
* Maps the success value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
exports.flap = flap;
const as = /*#__PURE__*/covariant.as(Covariant);
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
exports.as = as;
const asUnit = /*#__PURE__*/covariant.asUnit(Covariant);
/**
* @since 1.0.0
*/
exports.asUnit = asUnit;
const of = some;
/**
* @category instances
* @since 1.0.0
*/
exports.of = of;
const Of = {
of: some
};
/**
* @since 1.0.0
*/
exports.Of = Of;
const unit = /*#__PURE__*/of_.unit(Of);
/**
* @category do notation
* @since 1.0.0
*/
exports.unit = unit;
const Do = /*#__PURE__*/of_.Do(Of);
/**
* @category instances
* @since 1.0.0
*/
exports.Do = Do;
const Pointed = { ...Of,
...Covariant
};
/**
* @category sequencing
* @since 1.0.0
*/
exports.Pointed = Pointed;
const flatMap = f => self => isNone(self) ? none : f(self.value);
/**
* @category instances
* @since 1.0.0
*/
exports.flatMap = flatMap;
const FlatMap = {
flatMap
};
/**
* @since 1.0.0
*/
exports.FlatMap = FlatMap;
const flatten = /*#__PURE__*/flatMap_.flatten(FlatMap);
/**
* @since 1.0.0
*/
exports.flatten = flatten;
const andThen = /*#__PURE__*/flatMap_.andThen(FlatMap);
/**
* @since 1.0.0
*/
exports.andThen = andThen;
const composeKleisliArrow = /*#__PURE__*/flatMap_.composeKleisliArrow(FlatMap);
/**
* @category instances
* @since 1.0.0
*/
exports.composeKleisliArrow = composeKleisliArrow;
const Chainable = { ...FlatMap,
...Covariant
};
/**
* @category do notation
* @since 1.0.0
*/
exports.Chainable = Chainable;
const bind = /*#__PURE__*/chainable.bind(Chainable);
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
exports.bind = bind;
const tap = /*#__PURE__*/chainable.tap(Chainable);
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
exports.tap = tap;
const andThenDiscard = /*#__PURE__*/chainable.andThenDiscard(Chainable);
/**
* @category instances
* @since 1.0.0
*/
exports.andThenDiscard = andThenDiscard;
const Monad = { ...Pointed,
...FlatMap
};
/**
* @since 1.0.0
*/
exports.Monad = Monad;
const product = that => self => isSome(self) && isSome(that) ? some([self.value, that.value]) : none;
/**
* @since 1.0.0
*/
exports.product = product;
const productMany = collection => self => {
if (isNone(self)) {
return none;
}
const out = [self.value];
for (const o of collection) {
if (isNone(o)) {
return none;
}
out.push(o.value);
}
return some(out);
};
/**
* @category instances
* @since 1.0.0
*/
exports.productMany = productMany;
const NonEmptyProduct = { ...Invariant,
product,
productMany
};
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
exports.NonEmptyProduct = NonEmptyProduct;
const bindOption = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
/**
* @since 1.0.0
*/
exports.bindOption = bindOption;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
/**
* @since 1.0.0
*/
exports.productFlatten = productFlatten;
const productAll = collection => {
const out = [];
for (const o of collection) {
if (isNone(o)) {
return none;
}
out.push(o.value);
}
return some(out);
};
/**
* @category instances
* @since 1.0.0
*/
exports.productAll = productAll;
const Product = { ...Of,
...NonEmptyProduct,
productAll
};
/**
* @since 1.0.0
*/
exports.Product = Product;
const tuple = /*#__PURE__*/product_.tuple(Product);
/**
* @since 1.0.0
*/
exports.tuple = tuple;
const struct = /*#__PURE__*/product_.struct(Product);
/**
* @category instances
* @since 1.0.0
*/
exports.struct = struct;
const NonEmptyApplicative = { ...NonEmptyProduct,
...Covariant
};
/**
* Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are
* combined using the provided `Semigroup`
*
* | x | y | combine(y)(x) |
* | ------- | ------- | ------------------- |
* | none | none | none |
* | some(a) | none | some(a) |
* | none | some(a) | some(a) |
* | some(a) | some(b) | some(combine(b)(a)) |
*
* @example
* import { getMonoid, some, none } from '@fp-ts/data/Option'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const M = getMonoid(N.SemigroupSum)
* assert.deepStrictEqual(pipe(none, M.combine(none)), none)
* assert.deepStrictEqual(pipe(some(1), M.combine(none)), some(1))
* assert.deepStrictEqual(pipe(none, M.combine(some(1))), some(1))
* assert.deepStrictEqual(pipe(some(1), M.combine(some(2))), some(3))
*
* @category lifting
* @since 1.0.0
*/
exports.NonEmptyApplicative = NonEmptyApplicative;
const getMonoid = Semigroup => {
const combine = that => self => isNone(self) ? that : isNone(that) ? self : some(Semigroup.combine(that.value)(self.value));
return {
combine,
combineMany: others => start => {
let c = start;
for (const o of others) {
c = combine(o)(c);
}
return c;
},
combineAll: collection => {
let c = none;
for (const o of collection) {
c = combine(o)(c);
}
return c;
},
empty: none
};
};
/**
* Lifts a binary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
exports.getMonoid = getMonoid;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
/**
* Lifts a ternary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
exports.lift2 = lift2;
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
/**
* @since 1.0.0
*/
exports.lift3 = lift3;
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
/**
* @since 1.0.0
*/
exports.ap = ap;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
/**
* @category instances
* @since 1.0.0
*/
exports.liftSemigroup = liftSemigroup;
const Applicative = { ...NonEmptyApplicative,
...Product
};
/**
* @since 1.0.0
*/
exports.Applicative = Applicative;
const liftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
/**
* @since 1.0.0
*/
exports.liftMonoid = liftMonoid;
const coproduct = that => self => isSome(self) ? self : that;
/**
* @since 1.0.0
*/
exports.coproduct = coproduct;
const coproductMany = collection => self => {
let out = self;
if (isSome(out)) {
return out;
}
for (out of collection) {
if (isSome(out)) {
return out;
}
}
return out;
};
/**
* @category instances
* @since 1.0.0
*/
exports.coproductMany = coproductMany;
const NonEmptyCoproduct = { ...Invariant,
coproduct,
coproductMany
};
/**
* @since 1.0.0
*/
exports.NonEmptyCoproduct = NonEmptyCoproduct;
const getSemigroup = /*#__PURE__*/nonEmptyCoproduct.getSemigroup(NonEmptyCoproduct);
/**
* @since 1.0.0
*/
exports.getSemigroup = getSemigroup;
const coproductEither = /*#__PURE__*/nonEmptyCoproduct.coproductEither(NonEmptyCoproduct);
/**
* @since 1.0.0
*/
exports.coproductEither = coproductEither;
const coproductAll = collection => {
const options = internal.fromIterable(collection);
if (internal.isNonEmpty(options)) {
return NonEmptyCoproduct.coproductMany(internal.tail(options))(internal.head(options));
}
return none;
};
/**
* @since 1.0.0
*/
exports.coproductAll = coproductAll;
const zero = () => none;
/**
* @category instances
* @since 1.0.0
*/
exports.zero = zero;
const Coproduct = { ...NonEmptyCoproduct,
zero,
coproductAll
};
/**
* @category instances
* @since 1.0.0
*/
exports.Coproduct = Coproduct;
const NonEmptyAlternative = { ...Covariant,
...NonEmptyCoproduct
};
/**
* @category instances
* @since 1.0.0
*/
exports.NonEmptyAlternative = NonEmptyAlternative;
const Alternative = { ...NonEmptyAlternative,
...Coproduct
};
/**
* @category folding
* @since 1.0.0
*/
exports.Alternative = Alternative;
const reduce = (b, f) => self => isNone(self) ? b : f(b, self.value);
/**
* @category folding
* @since 1.0.0
*/
exports.reduce = reduce;
const reduceRight = (b, f) => self => isNone(self) ? b : f(b, self.value);
/**
* @category instances
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
const Foldable = {
reduce,
reduceRight
};
/**
* @category folding
* @since 1.0.0
*/
exports.Foldable = Foldable;
const foldMap = /*#__PURE__*/foldable.foldMap(Foldable);
/**
* @category conversions
* @since 1.0.0
*/
exports.foldMap = foldMap;
const toReadonlyArray = /*#__PURE__*/foldable.toReadonlyArray(Foldable);
/**
* @category conversions
* @since 1.0.0
*/
exports.toReadonlyArray = toReadonlyArray;
const toReadonlyArrayWith = /*#__PURE__*/foldable.toReadonlyArrayWith(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.toReadonlyArrayWith = toReadonlyArrayWith;
const reduceKind = /*#__PURE__*/foldable.reduceKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.reduceKind = reduceKind;
const reduceRightKind = /*#__PURE__*/foldable.reduceRightKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.reduceRightKind = reduceRightKind;
const foldMapKind = /*#__PURE__*/foldable.foldMapKind(Foldable);
/**
* @category filtering
* @since 1.0.0
*/
exports.foldMapKind = foldMapKind;
const compact = flatten;
/**
* @category instances
* @since 1.0.0
*/
exports.compact = compact;
const Compactable = {
compact
};
/**
* @category filtering
* @since 1.0.0
*/
exports.Compactable = Compactable;
const separate = /*#__PURE__*/compactable.separate({ ...Covariant,
...Compactable
});
/**
* @category filtering
* @since 1.0.0
*/
exports.separate = separate;
const filterMap = f => fa => isNone(fa) ? none : f(fa.value);
/**
* @category instances
* @since 1.0.0
*/
exports.filterMap = filterMap;
const Filterable = {
filterMap
};
/**
* @category filtering
* @since 1.0.0
*/
exports.Filterable = Filterable;
const filter = /*#__PURE__*/filterable.filter(Filterable);
/**
* @category filtering
* @since 1.0.0
*/
exports.filter = filter;
const partition = /*#__PURE__*/filterable.partition(Filterable);
/**
* @category filtering
* @since 1.0.0
*/
exports.partition = partition;
const partitionMap = /*#__PURE__*/filterable.partitionMap(Filterable);
/**
* @category traversing
* @since 1.0.0
*/
exports.partitionMap = partitionMap;
const traverse = F => f => self => isNone(self) ? F.of(none) : (0, _Function.pipe)(f(self.value), F.map(some));
/**
* @category instances
* @since 1.0.0
*/
exports.traverse = traverse;
const Traversable = {
traverse
};
/**
* @category traversing
* @since 1.0.0
*/
exports.Traversable = Traversable;
const sequence = /*#__PURE__*/traversable.sequence(Traversable);
/**
* @category traversing
* @since 1.0.0
*/
exports.sequence = sequence;
const traverseTap = /*#__PURE__*/traversable.traverseTap(Traversable);
/**
* Returns `true` if the option is `None`, `false` otherwise.

@@ -72,3 +759,3 @@ *

exports.isOption = isOption;
exports.traverseTap = traverseTap;
const isNone = internal.isNone;

@@ -100,5 +787,3 @@ /**

/**
* Constructs a `Some`. Represents an optional value that exists.
*
* @category constructors
* @category conversions
* @since 1.0.0

@@ -108,10 +793,3 @@ */

exports.none = none;
const some = internal.some;
/**
* @category conversions
* @since 1.0.0
*/
exports.some = some;
const fromIterable = collection => {

@@ -208,3 +886,3 @@ for (const a of collection) {

const getOrElse = onNone => ma => isNone(ma) ? onNone : ma.value;
const getOrElse = onNone => self => isNone(self) ? onNone : self.value;
/**

@@ -399,74 +1077,2 @@ * Converts an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a

/**
* Returns an effect whose success is mapped by the specified `f` function.
*
* @category mapping
* @since 1.0.0
*/
exports.toUndefined = toUndefined;
const map = f => fa => isNone(fa) ? none : some(f(fa.value));
/**
* @category instances
* @since 1.0.0
*/
exports.map = map;
const Pointed = {
of: some
};
/**
* @category sequencing
* @since 1.0.0
*/
exports.Pointed = Pointed;
const flatMap = f => self => isNone(self) ? none : f(self.value);
/**
* @category instances
* @since 1.0.0
*/
exports.flatMap = flatMap;
const FlatMap = {
map,
flatMap
};
/**
* Sequences the specified effect after this effect, but ignores the value
* produced by the effect.
*
* @category sequencing
* @since 1.0.0
*/
exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @since 1.0.0
*/
exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
/**
* @since 1.0.0
*/
exports.zipRight = zipRight;
const ap = fa => fab => (0, _Function.pipe)(fab, flatMap(ab => (0, _Function.pipe)(fa, map(a => ab(a)))));
/**
* @since 1.0.0
*/
exports.ap = ap;
const flatten = /*#__PURE__*/flatMap(_Function.identity);
/**
* Lazy version of `orElse`.

@@ -478,3 +1084,3 @@ *

exports.flatten = flatten;
exports.toUndefined = toUndefined;

@@ -537,64 +1143,4 @@ const catchAll = that => self => isNone(self) ? that() : self;

/**
* @since 1.0.0
*/
exports.orElse = orElse;
const extend = f => wa => isNone(wa) ? none : some(f(wa));
/**
* @since 1.0.0
*/
exports.extend = extend;
const duplicate = /*#__PURE__*/extend(_Function.identity);
/**
* @category filtering
* @since 1.0.0
*/
exports.duplicate = duplicate;
const compact = flatten;
exports.compact = compact;
const defaultSeparated = [none, none];
/**
* @category filtering
* @since 1.0.0
*/
const separate = ma => isNone(ma) ? defaultSeparated : [either.getLeft(ma.value), fromEither(ma.value)];
/**
* @category filtering
* @since 1.0.0
*/
exports.separate = separate;
const filterMap = f => fa => isNone(fa) ? none : f(fa.value);
/**
* @category filtering
* @since 1.0.0
*/
exports.filterMap = filterMap;
const partitionMap = f => (0, _Function.flow)(map(f), separate);
/**
* @category traversing
* @since 1.0.0
*/
exports.partitionMap = partitionMap;
const traverse = F => f => ta => isNone(ta) ? F.of(none) : (0, _Function.pipe)(f(ta.value), F.map(some)); // -------------------------------------------------------------------------------------
// instances
// -------------------------------------------------------------------------------------
/**
* The `Sortable` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Sortable` instance for
* The `Order` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Order` instance for
* the type the `Option` contains.

@@ -605,7 +1151,7 @@ *

* @example
* import { none, some, liftSortable } from '@fp-ts/data/Option'
* import { none, some, liftOrder } from '@fp-ts/data/Option'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const O = liftSortable(N.Sortable)
* const O = liftOrder(N.Order)
* assert.strictEqual(pipe(none, O.compare(none)), 0)

@@ -617,3 +1163,2 @@ * assert.strictEqual(pipe(none, O.compare(some(1))), -1)

*
* @category instances
* @since 1.0.0

@@ -623,337 +1168,6 @@ */

exports.traverse = traverse;
exports.orElse = orElse;
const liftSortable = O => sortable.fromCompare(that => self => isSome(self) ? isSome(that) ? O.compare(that.value)(self.value) : 1 : -1);
const liftOrder = O => order.fromCompare(that => self => isSome(self) ? isSome(that) ? O.compare(that.value)(self.value) : 1 : -1);
/**
* Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are
* combined using the provided `Semigroup`
*
* | x | y | combine(y)(x) |
* | ------- | ------- | ------------------- |
* | none | none | none |
* | some(a) | none | some(a) |
* | none | some(a) | some(a) |
* | some(a) | some(b) | some(combine(b)(a)) |
*
* @example
* import { getMonoid, some, none } from '@fp-ts/data/Option'
* import * as N from '@fp-ts/data/Number'
* import { pipe } from '@fp-ts/data/Function'
*
* const M = getMonoid(N.SemigroupSum)
* assert.deepStrictEqual(pipe(none, M.combine(none)), none)
* assert.deepStrictEqual(pipe(some(1), M.combine(none)), some(1))
* assert.deepStrictEqual(pipe(none, M.combine(some(1))), some(1))
* assert.deepStrictEqual(pipe(some(1), M.combine(some(2))), some(3))
*
* @category instances
* @since 1.0.0
*/
exports.liftSortable = liftSortable;
const getMonoid = Semigroup => {
const combine = that => self => isNone(self) ? that : isNone(that) ? self : some(Semigroup.combine(that.value)(self.value));
return {
combine,
combineMany: others => start => {
let c = start;
for (const o of others) {
c = combine(o)(c);
}
return c;
},
combineAll: collection => {
let c = none;
for (const o of collection) {
c = combine(o)(c);
}
return c;
},
empty: none
};
};
/**
* @category instances
* @since 1.0.0
*/
exports.getMonoid = getMonoid;
const Functor = {
map
};
/**
* @category mapping
* @since 1.0.0
*/
exports.Functor = Functor;
const flap = /*#__PURE__*/functor.flap(Functor);
/**
* Maps the success value of this effect to the specified constant value.
*
* @category mapping
* @since 1.0.0
*/
exports.flap = flap;
const as = /*#__PURE__*/functor.as(Functor);
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
exports.as = as;
const unit = /*#__PURE__*/functor.unit(Functor);
/**
* Sequentially zips this effect with the specified effect using the specified combiner function.
*
* @category tuple sequencing
* @since 1.0.0
*/
exports.unit = unit;
const zipWith = (that, f) => self => (0, _Function.pipe)(self, flatMap(a => (0, _Function.pipe)(that, map(b => f(a, b)))));
/**
* @category instances
* @since 1.0.0
*/
exports.zipWith = zipWith;
const Semigroupal = {
map,
zipWith,
zipMany: others => start => {
if (isNone(start)) {
return none;
}
const res = [start.value];
for (const o of others) {
if (isNone(o)) {
return none;
}
res.push(o.value);
}
return some(res);
}
};
/**
* Lifts a binary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
exports.Semigroupal = Semigroupal;
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
/**
* Lifts a ternary function into `Option`.
*
* @category lifting
* @since 1.0.0
*/
exports.lift2 = lift2;
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
/**
* @category instances
* @since 1.0.0
*/
exports.lift3 = lift3;
const Monoidal = {
of: some,
map,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: collection => {
const res = [];
for (const o of collection) {
if (isNone(o)) {
return none;
}
res.push(o.value);
}
return some(res);
}
};
/**
* @category instances
* @since 1.0.0
*/
exports.Monoidal = Monoidal;
const Monad = {
map,
of: some,
flatMap
};
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
exports.Monad = Monad;
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
/**
* @category conversions
* @since 1.0.0
*/
exports.tap = tap;
const toReadonlyArray = self => isNone(self) ? internal.empty : [self.value];
/**
* @category folding
* @since 1.0.0
*/
exports.toReadonlyArray = toReadonlyArray;
const reduce = (b, f) => self => isNone(self) ? b : f(b, self.value);
/**
* @category folding
* @since 1.0.0
*/
exports.reduce = reduce;
const foldMap = Monoid => f => self => isNone(self) ? Monoid.empty : f(self.value);
/**
* @category folding
* @since 1.0.0
*/
exports.foldMap = foldMap;
const reduceRight = (b, f) => self => isNone(self) ? b : f(self.value, b);
/**
* @category instances
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
const Extendable = {
map,
extend
};
/**
* @category instances
* @since 1.0.0
*/
exports.Extendable = Extendable;
const Compactable = {
compact
};
/**
* @category instances
* @since 1.0.0
*/
exports.Compactable = Compactable;
const Filterable = {
filterMap
};
/**
* @category filtering
* @since 1.0.0
*/
exports.Filterable = Filterable;
const filter = /*#__PURE__*/filterable.filter(Filterable);
/**
* @category filtering
* @since 1.0.0
*/
exports.filter = filter;
const partition = /*#__PURE__*/filterable.partition(Filterable);
/**
* @category instances
* @since 1.0.0
*/
exports.partition = partition;
const Traversable = {
traverse
};
/**
* @category traversing
* @since 1.0.0
*/
exports.Traversable = Traversable;
const sequence = /*#__PURE__*/traversable.sequence(Traversable);
/**
* @category filtering
* @since 1.0.0
*/
exports.sequence = sequence;
const traverseFilterMap = /*#__PURE__*/traversableFilterable.traverseFilterMap(Traversable, Compactable);
/**
* @category filtering
* @since 1.0.0
*/
exports.traverseFilterMap = traverseFilterMap;
const traversePartitionMap = /*#__PURE__*/traversableFilterable.traversePartitionMap(Traversable, Functor, Compactable);
/**
* @category instances
* @since 1.0.0
*/
exports.traversePartitionMap = traversePartitionMap;
const TraversableFilterable = {
traverseFilterMap,
traversePartitionMap
};
/**
* @category filtering
* @since 1.0.0
*/
exports.TraversableFilterable = TraversableFilterable;
const traverseFilter = /*#__PURE__*/traversableFilterable.traverseFilter(TraversableFilterable);
/**
* @category filtering
* @since 1.0.0
*/
exports.traverseFilter = traverseFilter;
const traversePartition = /*#__PURE__*/traversableFilterable.traversePartition(TraversableFilterable);
/**
* @category instances
* @since 1.0.0
*/
exports.traversePartition = traversePartition;
const FromOption = {
fromOption: _Function.identity
};
/**
* Returns a *smart constructor* based on the given predicate.

@@ -973,4 +1187,6 @@ *

exports.FromOption = FromOption;
const liftPredicate = /*#__PURE__*/fromOption_.liftPredicate(FromOption);
exports.liftOrder = liftOrder;
const liftPredicate = predicate => b => predicate(b) ? some(b) : none;
/**

@@ -981,2 +1197,3 @@ * @category lifting

exports.liftPredicate = liftPredicate;

@@ -1047,149 +1264,5 @@

const exists = predicate => ma => isNone(ma) ? false : predicate(ma.value); // -------------------------------------------------------------------------------------
// do notation
// -------------------------------------------------------------------------------------
const exists = predicate => ma => isNone(ma) ? false : predicate(ma.value);
/**
* @category do notation
* @since 1.0.0
*/
exports.exists = exists;
const Do = /*#__PURE__*/some(internal.Do);
/**
* @category do notation
* @since 1.0.0
*/
exports.Do = Do;
const bindTo = /*#__PURE__*/functor.bindTo(Functor);
exports.bindTo = bindTo;
const let_ = /*#__PURE__*/functor.let(Functor);
exports.let = let_;
/**
* @category do notation
* @since 1.0.0
*/
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**
* A variant of `bind` that sequentially ignores the scope.
*
* @category do notation
* @since 1.0.0
*/
exports.bind = bind;
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing
// -------------------------------------------------------------------------------------
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.bindRight = bindRight;
const Zip = /*#__PURE__*/some(internal.empty);
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.Zip = Zip;
const tupled = /*#__PURE__*/functor.tupled(Functor);
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal); // -------------------------------------------------------------------------------------
// array utils
// -------------------------------------------------------------------------------------
/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.zipFlatten = zipFlatten;
const traverseNonEmptyReadonlyArrayWithIndex = f => as => {
const o = f(0, internal.head(as));
if (isNone(o)) {
return none;
}
const out = [o.value];
for (let i = 1; i < as.length; i++) {
const o = f(i, as[i]);
if (isNone(o)) {
return none;
}
out.push(o.value);
}
return some(out);
};
/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseNonEmptyReadonlyArrayWithIndex = traverseNonEmptyReadonlyArrayWithIndex;
const traverseReadonlyArrayWithIndex = f => {
const g = traverseNonEmptyReadonlyArrayWithIndex(f);
return as => internal.isNonEmpty(as) ? g(as) : Zip;
};
/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex;
const traverseNonEmptyReadonlyArray = f => {
return traverseNonEmptyReadonlyArrayWithIndex((0, _Function.flow)(_Function.SK, f));
};
/**
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseNonEmptyReadonlyArray = traverseNonEmptyReadonlyArray;
const traverseReadonlyArray = f => {
return traverseReadonlyArrayWithIndex((0, _Function.flow)(_Function.SK, f));
};
/**
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*
* @category traversing
* @since 1.0.0
*/
exports.traverseReadonlyArray = traverseReadonlyArray;
const sequenceReadonlyArray = /*#__PURE__*/traverseReadonlyArray(_Function.identity);
exports.sequenceReadonlyArray = sequenceReadonlyArray;
//# sourceMappingURL=Option.js.map
{
"name": "@fp-ts/data",
"version": "0.0.7",
"version": "0.0.8",
"license": "MIT",

@@ -10,3 +10,3 @@ "repository": {

"dependencies": {
"@fp-ts/core": "^0.0.5"
"@fp-ts/core": "^0.0.6"
},

@@ -13,0 +13,0 @@ "main": "./index.js",

/**
* @since 1.0.0
*/
import type * as contravariant from "@fp-ts/core/Contravariant";
import type { TypeLambda } from "@fp-ts/core/HKT";
import type * as monoid from "@fp-ts/core/Monoid";
import * as semigroup from "@fp-ts/core/Semigroup";
import * as contravariant from "@fp-ts/core/typeclass/Contravariant";
import * as invariant from "@fp-ts/core/typeclass/Invariant";
import type * as monoid from "@fp-ts/core/typeclass/Monoid";
import * as nonEmptyProduct from "@fp-ts/core/typeclass/NonEmptyProduct";
import * as of_ from "@fp-ts/core/typeclass/Of";
import * as product_ from "@fp-ts/core/typeclass/Product";
import * as semigroup from "@fp-ts/core/typeclass/Semigroup";
/**

@@ -20,3 +24,3 @@ * @category models

export interface PredicateTypeLambda extends TypeLambda {
readonly type: Predicate<this["In1"]>;
readonly type: Predicate<this["Target"]>;
}

@@ -26,2 +30,84 @@ /**

*/
export declare const contramap: <B, A>(f: (b: B) => A) => (self: Predicate<A>) => Predicate<B>;
/**
* @since 1.0.0
*/
export declare const imap: <A, B>(to: (a: A) => B, from: (b: B) => A) => (self: Predicate<A>) => Predicate<B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Invariant: invariant.Invariant<PredicateTypeLambda>;
/**
* @since 1.0.0
*/
export declare const tupled: <A>(self: Predicate<A>) => Predicate<readonly [A]>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: Predicate<A>) => Predicate<{
readonly [K in N]: A;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Contravariant: contravariant.Contravariant<PredicateTypeLambda>;
/**
* @since 1.0.0
*/
export declare const of: <A>(_: A) => Predicate<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Of: of_.Of<PredicateTypeLambda>;
/**
* @since 1.0.0
*/
export declare const Do: Predicate<{}>;
/**
* @since 1.0.0
*/
export declare const product: <B>(that: Predicate<B>) => <A>(self: Predicate<A>) => Predicate<readonly [A, B]>;
/**
* @since 1.0.0
*/
export declare const productMany: <A>(collection: Iterable<Predicate<A>>) => (self: Predicate<A>) => Predicate<readonly [A, ...A[]]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<PredicateTypeLambda>;
/**
* @since 1.0.0
*/
export declare const productAll: <A>(collection: Iterable<Predicate<A>>) => Predicate<readonly A[]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Product: product_.Product<PredicateTypeLambda>;
/**
* @since 1.0.0
*/
export declare const bindPredicate: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: Predicate<B>) => (self: Predicate<A>) => Predicate<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* @since 1.0.0
*/
export declare const tuple: <T extends ReadonlyArray<Predicate<any>>>(...tuple: T) => Predicate<Readonly<{
[I in keyof T]: [T[I]] extends [Predicate<infer A>] ? A : never;
}>>;
/**
* @since 1.0.0
*/
export declare const struct: <R extends Record<string, Predicate<any>>>(r: R) => Predicate<{
readonly [K in keyof R]: [R[K]] extends [Predicate<infer A>] ? A : never;
}>;
/**
* @since 1.0.0
*/
export declare const not: <A>(predicate: Predicate<A>) => Predicate<A>;

@@ -59,11 +145,2 @@ /**

*/
export declare const contramap: <B, A>(f: (b: B) => A) => (self: Predicate<A>) => Predicate<B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Contravariant: contravariant.Contravariant<PredicateTypeLambda>;
/**
* @since 1.0.0
*/
export declare const all: <A>(collection: Iterable<Predicate<A>>) => Predicate<A>;

@@ -70,0 +147,0 @@ /**

@@ -6,8 +6,20 @@ "use strict";

});
exports.or = exports.not = exports.getSemigroupAny = exports.getSemigroupAll = exports.getMonoidAny = exports.getMonoidAll = exports.contramap = exports.any = exports.and = exports.all = exports.Contravariant = void 0;
exports.tupled = exports.tuple = exports.struct = exports.productMany = exports.productAll = exports.product = exports.or = exports.of = exports.not = exports.imap = exports.getSemigroupAny = exports.getSemigroupAll = exports.getMonoidAny = exports.getMonoidAll = exports.contramap = exports.bindTo = exports.bindPredicate = exports.any = exports.and = exports.all = exports.Product = exports.Of = exports.NonEmptyProduct = exports.Invariant = exports.Do = exports.Contravariant = void 0;
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroup"));
var contravariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Contravariant"));
var invariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Invariant"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));
var _Function = /*#__PURE__*/require("@fp-ts/data/Function");
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Common"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

@@ -20,2 +32,158 @@

*/
const contramap = f => self => (0, _Function.flow)(f, self);
/**
* @since 1.0.0
*/
exports.contramap = contramap;
const imap = /*#__PURE__*/contravariant.imap(contramap);
/**
* @category instances
* @since 1.0.0
*/
exports.imap = imap;
const Invariant = {
imap
};
/**
* @since 1.0.0
*/
exports.Invariant = Invariant;
const tupled = /*#__PURE__*/invariant.tupled(Invariant);
/**
* @category do notation
* @since 1.0.0
*/
exports.tupled = tupled;
const bindTo = /*#__PURE__*/invariant.bindTo(Invariant);
/**
* @category instances
* @since 1.0.0
*/
exports.bindTo = bindTo;
const Contravariant = { ...Invariant,
contramap
};
/**
* @since 1.0.0
*/
exports.Contravariant = Contravariant;
const of = _ => () => true;
/**
* @category instances
* @since 1.0.0
*/
exports.of = of;
const Of = {
of
};
/**
* @since 1.0.0
*/
exports.Of = Of;
const Do = /*#__PURE__*/of_.Do(Of);
/**
* @since 1.0.0
*/
exports.Do = Do;
const product = that => self => ([a, b]) => self(a) && that(b);
/**
* @since 1.0.0
*/
exports.product = product;
const productMany = collection => self => {
return ([head, ...tail]) => {
if (self(head) === false) {
return false;
}
const predicates = internal.fromIterable(collection);
for (let i = 0; i < predicates.length; i++) {
if (predicates[i](tail[i]) === false) {
return false;
}
}
return true;
};
};
/**
* @category instances
* @since 1.0.0
*/
exports.productMany = productMany;
const NonEmptyProduct = { ...Contravariant,
product,
productMany
};
/**
* @since 1.0.0
*/
exports.NonEmptyProduct = NonEmptyProduct;
const productAll = collection => as => {
const predicates = internal.fromIterable(collection);
for (let i = 0; i < predicates.length; i++) {
if (predicates[i](as[i]) === false) {
return false;
}
}
return true;
};
/**
* @category instances
* @since 1.0.0
*/
exports.productAll = productAll;
const Product = { ...NonEmptyProduct,
...Of,
productAll
};
/**
* @since 1.0.0
*/
exports.Product = Product;
const bindPredicate = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
/**
* @since 1.0.0
*/
exports.bindPredicate = bindPredicate;
const tuple = /*#__PURE__*/product_.tuple(Product);
/**
* @since 1.0.0
*/
exports.tuple = tuple;
const struct = /*#__PURE__*/product_.struct(Product);
/**
* @since 1.0.0
*/
exports.struct = struct;
const not = predicate => a => !predicate(a);

@@ -97,19 +265,2 @@ /**

const contramap = f => self => (0, _Function.flow)(f, self);
/**
* @category instances
* @since 1.0.0
*/
exports.contramap = contramap;
const Contravariant = {
contramap
};
/**
* @since 1.0.0
*/
exports.Contravariant = Contravariant;
const all = collection => getMonoidAll().combineAll(collection);

@@ -116,0 +267,0 @@ /**

@@ -28,3 +28,3 @@ /**

export interface QueueTypeLambda extends HKT.TypeLambda {
readonly type: Queue<this["Out1"]>;
readonly type: Queue<this["Target"]>;
}

@@ -31,0 +31,0 @@ /**

/**
* @since 1.0.0
*/
import type * as extendable from "@fp-ts/core/Extendable";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";
import type * as functorWithIndex from "@fp-ts/core/FunctorWithIndex";
import type { Kind, TypeLambda } from "@fp-ts/core/HKT";
import type * as monad from "@fp-ts/core/Monad";
import type { Monoid } from "@fp-ts/core/Monoid";
import type * as monoidal from "@fp-ts/core/Monoidal";
import type * as pointed from "@fp-ts/core/Pointed";
import type { Semigroup } from "@fp-ts/core/Semigroup";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as sortable from "@fp-ts/core/Sortable";
import type { Sortable } from "@fp-ts/core/Sortable";
import * as traversable from "@fp-ts/core/Traversable";
import type * as traversableWithIndex from "@fp-ts/core/TraversableWithIndex";
import * as applicative from "@fp-ts/core/typeclass/Applicative";
import * as chainable from "@fp-ts/core/typeclass/Chainable";
import type * as compactable from "@fp-ts/core/typeclass/Compactable";
import type { Coproduct } from "@fp-ts/core/typeclass/Coproduct";
import * as covariant from "@fp-ts/core/typeclass/Covariant";
import * as filterable from "@fp-ts/core/typeclass/Filterable";
import * as flatMap_ from "@fp-ts/core/typeclass/FlatMap";
import * as foldable from "@fp-ts/core/typeclass/Foldable";
import * as invariant from "@fp-ts/core/typeclass/Invariant";
import type * as monad from "@fp-ts/core/typeclass/Monad";
import type { Monoid } from "@fp-ts/core/typeclass/Monoid";
import * as nonEmptyApplicative from "@fp-ts/core/typeclass/NonEmptyApplicative";
import * as nonEmptyProduct from "@fp-ts/core/typeclass/NonEmptyProduct";
import type * as of_ from "@fp-ts/core/typeclass/Of";
import * as order from "@fp-ts/core/typeclass/Order";
import type { Order } from "@fp-ts/core/typeclass/Order";
import type * as pointed from "@fp-ts/core/typeclass/Pointed";
import type * as product_ from "@fp-ts/core/typeclass/Product";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as traversable from "@fp-ts/core/typeclass/Traversable";
import * as traversableFilterable from "@fp-ts/core/typeclass/TraversableFilterable";
import type { Either } from "@fp-ts/data/Either";

@@ -26,6 +33,3 @@ import type { Endomorphism } from "@fp-ts/data/Endomorphism";

import type { Refinement } from "@fp-ts/data/Refinement";
import type * as compactable from "@fp-ts/data/typeclasses/Compactable";
import * as filterable from "@fp-ts/data/typeclasses/Filterable";
import * as fromOption_ from "@fp-ts/data/typeclasses/FromOption";
import * as traversableFilterable from "@fp-ts/data/typeclasses/TraversableFilterable";
/**

@@ -36,3 +40,3 @@ * @category type lambdas

export interface ReadonlyArrayTypeLambda extends TypeLambda {
readonly type: ReadonlyArray<this["Out1"]>;
readonly type: ReadonlyArray<this["Target"]>;
}

@@ -50,4 +54,4 @@ /**

* @exampleTodo
* import { makeBy } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { makeBy } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -79,4 +83,4 @@ * const double = (n: number): number => n * 2

* @exampleTodo
* import { replicate } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { replicate } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -110,3 +114,3 @@ * assert.deepStrictEqual(pipe(3, replicate('a')), ['a', 'a', 'a'])

* @exampleTodo
* import { matchLeft } from '@fp-ts/core/data/ReadonlyArray'
* import { matchLeft } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -135,3 +139,3 @@ * const len: <A>(as: ReadonlyArray<A>) => number = matchLeft(() => 0, (_, tail) => 1 + len(tail))

* @exampleTodo
* import { scanLeft } from '@fp-ts/core/data/ReadonlyArray'
* import { scanLeft } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -147,3 +151,3 @@ * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4])

* @exampleTodo
* import { scanRight } from '@fp-ts/core/data/ReadonlyArray'
* import { scanRight } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -159,3 +163,3 @@ * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10])

* @exampleTodo
* import { isEmpty } from '@fp-ts/core/data/ReadonlyArray'
* import { isEmpty } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -190,5 +194,5 @@ * assert.strictEqual(isEmpty([]), true)

* @exampleTodo
* import { lookup } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { pipe } from '@fp-ts/core/data/Function'
* import { lookup } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -205,4 +209,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], lookup(1)), some(2))

* @exampleTodo
* import { prepend } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { prepend } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -219,4 +223,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], prepend(0)), [0, 1, 2, 3])

* @exampleTodo
* import { append } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { append } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -233,4 +237,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], append(4)), [1, 2, 3, 4])

* @exampleTodo
* import { head } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { head } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -247,4 +251,4 @@ * assert.deepStrictEqual(head([1, 2, 3]), some(1))

* @exampleTodo
* import { last } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { last } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -261,4 +265,4 @@ * assert.deepStrictEqual(last([1, 2, 3]), some(3))

* @exampleTodo
* import { tail } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { tail } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -275,4 +279,4 @@ * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3]))

* @exampleTodo
* import { init } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { init } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -291,4 +295,4 @@ * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2]))

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -311,4 +315,4 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -329,3 +333,3 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import { takeLeftWhile } from '@fp-ts/core/data/ReadonlyArray'
* import { takeLeftWhile } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -345,3 +349,3 @@ * assert.deepStrictEqual(takeLeftWhile((n: number) => n % 2 === 0)([2, 4, 3, 6]), [2, 4])

* @exampleTodo
* import { spanLeft } from '@fp-ts/core/data/ReadonlyArray'
* import { spanLeft } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -361,4 +365,4 @@ * assert.deepStrictEqual(spanLeft((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [[1, 3], [2, 4, 5]])

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -379,4 +383,4 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -395,3 +399,3 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import { dropLeftWhile } from '@fp-ts/core/data/ReadonlyArray'
* import { dropLeftWhile } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -409,4 +413,4 @@ * assert.deepStrictEqual(dropLeftWhile((n: number) => n % 2 === 1)([1, 3, 2, 4, 5]), [2, 4, 5])

* @exampleTodo
* import { findIndex } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findIndex } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -423,4 +427,4 @@ * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1))

* @exampleTodo
* import { findFirst } from '@fp-ts/core/data/ReadonlyArray'
* import { some } from '@fp-ts/core/data/Option'
* import { findFirst } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some } from '@fp-ts/core/typeclass/data/Option'
*

@@ -438,4 +442,4 @@ * assert.deepStrictEqual(findFirst((x: { a: number, b: number }) => x.a === 1)([{ a: 1, b: 1 }, { a: 1, b: 2 }]), some({ a: 1, b: 1 }))

* @exampleTodo
* import { findFirstMap } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findFirstMap } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -459,4 +463,4 @@ * interface Person {

* @exampleTodo
* import { findLast } from '@fp-ts/core/data/ReadonlyArray'
* import { some } from '@fp-ts/core/data/Option'
* import { findLast } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some } from '@fp-ts/core/typeclass/data/Option'
*

@@ -474,4 +478,4 @@ * assert.deepStrictEqual(findLast((x: { a: number, b: number }) => x.a === 1)([{ a: 1, b: 1 }, { a: 1, b: 2 }]), some({ a: 1, b: 2 }))

* @exampleTodo
* import { findLastMap } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findLastMap } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -495,4 +499,4 @@ * interface Person {

* @exampleTodo
* import { findLastIndex } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findLastIndex } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -514,4 +518,4 @@ * interface X {

* @exampleTodo
* import { insertAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some } from '@fp-ts/core/data/Option'
* import { insertAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some } from '@fp-ts/core/typeclass/data/Option'
*

@@ -527,4 +531,4 @@ * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4]))

* @exampleTodo
* import { updateAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { updateAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -542,4 +546,4 @@ * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3]))

* @exampleTodo
* import { modifyAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { modifyAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -557,4 +561,4 @@ * const double = (x: number): number => x * 2

* @exampleTodo
* import { deleteAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { deleteAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -571,3 +575,3 @@ * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3]))

* @exampleTodo
* import { reverse } from '@fp-ts/core/data/ReadonlyArray'
* import { reverse } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -583,4 +587,4 @@ * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1])

* @exampleTodo
* import { rights } from '@fp-ts/core/data/ReadonlyArray'
* import { right, left } from '@fp-ts/core/data/Either'
* import { rights } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { right, left } from '@fp-ts/core/typeclass/data/Either'
*

@@ -596,4 +600,4 @@ * assert.deepStrictEqual(rights([succeed(1), left('foo'), right(2)]), [1, 2])

* @exampleTodo
* import { lefts } from '@fp-ts/core/data/ReadonlyArray'
* import { left, right } from '@fp-ts/core/data/Either'
* import { lefts } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { left, right } from '@fp-ts/core/typeclass/data/Either'
*

@@ -609,10 +613,10 @@ * assert.deepStrictEqual(failures([right(1), left('foo'), right(2)]), ['foo'])

* @exampleTodo
* import { sort } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { sort } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
*
* assert.deepStrictEqual(sort(N.Sortable)([3, 2, 1]), [1, 2, 3])
* assert.deepStrictEqual(sort(N.Order)([3, 2, 1]), [1, 2, 3])
*
* @since 1.0.0
*/
export declare const sort: <B>(O: sortable.Sortable<B>) => <A extends B>(as: readonly A[]) => readonly A[];
export declare const sort: <B>(O: order.Order<B>) => <A extends B>(as: readonly A[]) => readonly A[];
/**

@@ -623,4 +627,4 @@ * Apply a function to pairs of elements at the same index in two `ReadonlyArray`s, collecting the results in a new `ReadonlyArray`. If one

* @exampleTodo
* import { zipWith } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { zipWith } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -637,4 +641,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], zipWith(['a', 'b', 'c', 'd'], (n, s) => s + n)), ['a1', 'b2', 'c3'])

* @exampleTodo
* import { zip } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { zip } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -658,3 +662,3 @@ * assert.deepStrictEqual(pipe([1, 2, 3], zip(['a', 'b', 'c', 'd'])), [[1, 'a'], [2, 'b'], [3, 'c']])

* @exampleTodo
* import { unzip } from '@fp-ts/core/data/ReadonlyArray'
* import { unzip } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -669,3 +673,3 @@ * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']])

*/
export declare const crossWith: <B, A, C>(that: readonly B[], f: (a: A, b: B) => C) => (self: readonly A[]) => readonly C[];
export declare const product: <B>(that: readonly B[]) => <A>(self: readonly A[]) => readonly (readonly [A, B])[];
/**

@@ -678,7 +682,7 @@ * @since 1.0.0

*/
export declare const crossMany: <A>(collection: Iterable<readonly A[]>) => (self: readonly A[]) => readonly (readonly [A, ...A[]])[];
export declare const productMany: <A>(collection: Iterable<readonly A[]>) => (self: readonly A[]) => readonly (readonly [A, ...A[]])[];
/**
* @since 1.0.0
*/
export declare const crossAll: <A>(collection: Iterable<readonly A[]>) => readonly (readonly A[])[];
export declare const productAll: <A>(collection: Iterable<readonly A[]>) => readonly (readonly A[])[];
/**

@@ -688,4 +692,4 @@ * Prepend an element to every member of a `ReadonlyArray`

* @exampleTodo
* import { prependAll } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { prependAll } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -701,4 +705,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3, 4], prependAll(9)), [9, 1, 9, 2, 9, 3, 9, 4])

* @exampleTodo
* import { intersperse } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { intersperse } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -714,3 +718,3 @@ * assert.deepStrictEqual(pipe([1, 2, 3, 4], intersperse(9)), [1, 9, 2, 9, 3, 9, 4])

* @exampleTodo
* import { rotate } from '@fp-ts/core/data/ReadonlyArray'
* import { rotate } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -727,5 +731,5 @@ * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])

* @exampleTodo
* import { elem } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { elem } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -742,4 +746,4 @@ * assert.strictEqual(pipe([1, 2, 3], elem(N.Eq)(2)), true)

* @exampleTodo
* import { uniq } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { uniq } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
*

@@ -756,7 +760,7 @@ * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2])

* @exampleTodo
* import { sortBy } from '@fp-ts/core/data/ReadonlyArray'
* import { contramap } from '@fp-ts/core/Sortable'
* import * as S from '@fp-ts/core/data/string'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { sortBy } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { contramap } from '@fp-ts/core/typeclass/Order'
* import * as S from '@fp-ts/core/typeclass/data/string'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -767,4 +771,4 @@ * interface Person {

* }
* const byName = pipe(S.Sortable, contramap((p: Person) => p.name))
* const byAge = pipe(N.Sortable, contramap((p: Person) => p.age))
* const byName = pipe(S.Order, contramap((p: Person) => p.name))
* const byAge = pipe(N.Order, contramap((p: Person) => p.age))
*

@@ -783,3 +787,3 @@ * const sortByNameByAge = sortBy([byName, byAge])

*/
export declare const sortBy: <B>(ords: readonly sortable.Sortable<B>[]) => <A extends B>(as: readonly A[]) => readonly A[];
export declare const sortBy: <B>(orders: readonly order.Order<B>[]) => <A extends B>(as: readonly A[]) => readonly A[];
/**

@@ -791,6 +795,6 @@ * A useful recursion pattern for processing a `ReadonlyArray` to produce a new `ReadonlyArray`, often used for "chopping" up the input

* @exampleTodo
* import { Eq } from '@fp-ts/core/typeclasses/Eq'
* import * as N from '@fp-ts/core/data/number'
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { Eq } from '@fp-ts/core/typeclass/typeclasses/Eq'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -809,3 +813,3 @@ * const group = <A>(E: Eq<A>): ((as: ReadonlyArray<A>) => ReadonlyArray<ReadonlyArray<A>>) => {

* @exampleTodo
* import { splitAt } from '@fp-ts/core/data/ReadonlyArray'
* import { splitAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -829,3 +833,3 @@ * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]])

* @exampleTodo
* import { chunksOf } from '@fp-ts/core/data/ReadonlyArray'
* import { chunksOf } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -841,5 +845,5 @@ * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])

* @exampleTodo
* import { union } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { union } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -856,5 +860,5 @@ * assert.deepStrictEqual(pipe([1, 2], union(N.Eq)([2, 3])), [1, 2, 3])

* @exampleTodo
* import { intersection } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { intersection } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -871,5 +875,5 @@ * assert.deepStrictEqual(pipe([1, 2], intersection(N.Eq)([2, 3])), [2])

* @exampleTodo
* import { difference } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { difference } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -897,4 +901,4 @@ * assert.deepStrictEqual(pipe([1, 2], difference(N.Eq)([2, 3])), [1])

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -923,7 +927,44 @@ * assert.deepStrictEqual(

*/
export declare const Of: of_.Of<ReadonlyArrayTypeLambda>;
/**
* @since 1.0.0
*/
export declare const imap: <A, B>(to: (a: A) => B, from: (b: B) => A) => (self: ReadonlyArray<A>) => ReadonlyArray<B>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Invariant: invariant.Invariant<ReadonlyArrayTypeLambda>;
/**
* @since 1.0.0
*/
export declare const tupled: <A>(self: ReadonlyArray<A>) => ReadonlyArray<readonly [A]>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: ReadonlyArray<A>) => ReadonlyArray<{
readonly [K in N]: A;
}>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Covariant: covariant.Covariant<ReadonlyArrayTypeLambda>;
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
export declare const asUnit: <_>(self: ReadonlyArray<_>) => ReadonlyArray<void>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Pointed: pointed.Pointed<ReadonlyArrayTypeLambda>;
/**
* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -955,2 +996,15 @@ * assert.deepStrictEqual(

/**
* @since 1.0.0
*/
export declare const andThen: <B>(that: ReadonlyArray<B>) => <_>(self: ReadonlyArray<_>) => ReadonlyArray<B>;
/**
* @since 1.0.0
*/
export declare const composeKleisliArrow: <B, C>(bfc: (b: B) => ReadonlyArray<C>) => <A>(afb: (a: A) => ReadonlyArray<B>) => (a: A) => ReadonlyArray<C>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Chainable: chainable.Chainable<ReadonlyArrayTypeLambda>;
/**
* Sequences the specified effect after this effect, but ignores the value

@@ -962,10 +1016,10 @@ * produced by the effect.

*/
export declare const zipLeft: (that: ReadonlyArray<unknown>) => <A>(self: ReadonlyArray<A>) => ReadonlyArray<A>;
export declare const andThenDiscard: <_>(that: ReadonlyArray<_>) => <A>(self: ReadonlyArray<A>) => ReadonlyArray<A>;
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @category do notation
* @since 1.0.0
*/
export declare const zipRight: <A>(that: ReadonlyArray<A>) => (self: ReadonlyArray<unknown>) => ReadonlyArray<A>;
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => ReadonlyArray<B>) => (self: ReadonlyArray<A>) => ReadonlyArray<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**

@@ -983,3 +1037,3 @@ * @since 1.0.0

* @exampleTodo
* import { flatten } from '@fp-ts/core/data/ReadonlyArray'
* import { flatten } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -996,7 +1050,2 @@ * assert.deepStrictEqual(flatten([[1], [2, 3], [4]]), [1, 2, 3, 4])

/**
* @category instances
* @since 1.0.0
*/
export declare const FunctorWithIndex: functorWithIndex.FunctorWithIndex<ReadonlyArrayTypeLambda, number>;
/**
* @category filtering

@@ -1034,12 +1083,8 @@ * @since 1.0.0

*/
export declare const extend: <A, B>(f: (wa: ReadonlyArray<A>) => B) => (wa: ReadonlyArray<A>) => ReadonlyArray<B>;
export declare const extend: <A, B>(f: (fa: ReadonlyArray<A>) => B) => (self: ReadonlyArray<A>) => ReadonlyArray<B>;
/**
* @since 1.0.0
*/
export declare const duplicate: <A>(wa: ReadonlyArray<A>) => ReadonlyArray<ReadonlyArray<A>>;
/**
* @category traversing
* @since 1.0.0
*/
export declare const traverseWithIndex: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A, i: number) => Kind<F, S, R, O, E, B>) => (self: readonly A[]) => Kind<F, S, R, O, E, readonly B[]>;
export declare const traverseWithIndex: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A, i: number) => Kind<F, R, O, E, B>) => (self: readonly A[]) => Kind<F, R, O, E, readonly B[]>;
/**

@@ -1049,3 +1094,3 @@ * @category traversing

*/
export declare const traverse: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, B>) => (self: readonly A[]) => Kind<F, S, R, O, E, readonly B[]>;
export declare const traverse: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: readonly A[]) => Kind<F, R, O, E, readonly B[]>;
/**

@@ -1074,4 +1119,4 @@ * @since 1.0.0

* @exampleTodo
* import { getSemigroup } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { getSemigroup } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1093,3 +1138,3 @@ * const S = getSemigroup<number>()

/**
* Derives an `Sortable` over the `ReadonlyArray` of a given element type from the `Sortable` of that type. The ordering between two such
* Derives an `Order` over the `ReadonlyArray` of a given element type from the `Order` of that type. The ordering between two such
* `ReadonlyArray`s is equal to: the first non equal comparison of each `ReadonlyArray`s elements taken pairwise in increasing order, in

@@ -1100,7 +1145,7 @@ * case of equality over all the pairwise elements; the longest `ReadonlyArray` is considered the greatest, if both `ReadonlyArray`s have

* @exampleTodo
* import { liftSortable } from '@fp-ts/core/data/ReadonlyArray'
* import * as S from '@fp-ts/core/data/string'
* import { pipe } from '@fp-ts/core/data/Function'
* import { liftOrder } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as S from '@fp-ts/core/typeclass/data/string'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*
* const O = liftSortable(S.Sortable)
* const O = liftOrder(S.Order)
* assert.strictEqual(pipe(['b'], O.compare(['a'])), 1)

@@ -1113,9 +1158,4 @@ * assert.strictEqual(pipe(['a'], O.compare(['a'])), 0)

*/
export declare const liftSortable: <A>(Sortable: sortable.Sortable<A>) => sortable.Sortable<readonly A[]>;
export declare const liftOrder: <A>(O: order.Order<A>) => order.Order<readonly A[]>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Functor: functor.Functor<ReadonlyArrayTypeLambda>;
/**
* @category mapping

@@ -1133,8 +1173,6 @@ * @since 1.0.0

/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @category instances
* @since 1.0.0
*/
export declare const unit: (self: ReadonlyArray<unknown>) => ReadonlyArray<void>;
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<ReadonlyArrayTypeLambda>;
/**

@@ -1144,3 +1182,3 @@ * @category instances

*/
export declare const Semigroupal: semigroupal.Semigroupal<ReadonlyArrayTypeLambda>;
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<ReadonlyArrayTypeLambda>;
/**

@@ -1161,6 +1199,10 @@ * Lifts a binary function into `ReadonlyArray`.

/**
* @since 1.0.0
*/
export declare const liftSemigroup: <A>(S: Semigroup<A>) => Semigroup<ReadonlyArray<A>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monoidal: monoidal.Monoidal<ReadonlyArrayTypeLambda>;
export declare const Product: product_.Product<ReadonlyArrayTypeLambda>;
/**

@@ -1170,2 +1212,11 @@ * @category instances

*/
export declare const Applicative: applicative.Applicative<ReadonlyArrayTypeLambda>;
/**
* @since 1.0.0
*/
export declare const liftMonoid: <A>(M: Monoid<A>) => Monoid<ReadonlyArray<A>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Monad: monad.Monad<ReadonlyArrayTypeLambda>;

@@ -1176,4 +1227,4 @@ /**

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1197,3 +1248,3 @@ * assert.deepStrictEqual(

*/
export declare const tap: <A>(f: (a: A) => ReadonlyArray<unknown>) => (self: ReadonlyArray<A>) => ReadonlyArray<A>;
export declare const tap: <A, _>(f: (a: A) => ReadonlyArray<_>) => (self: ReadonlyArray<A>) => ReadonlyArray<A>;
/**

@@ -1203,7 +1254,2 @@ * @category instances

*/
export declare const Extendable: extendable.Extendable<ReadonlyArrayTypeLambda>;
/**
* @category instances
* @since 1.0.0
*/
export declare const Compactable: compactable.Compactable<ReadonlyArrayTypeLambda>;

@@ -1256,8 +1302,13 @@ /**

*/
export declare const foldMap: <M>(Monoid: Monoid<M>) => <A>(f: (a: A) => M) => (self: readonly A[]) => M;
export declare const reduceRight: <B, A>(b: B, f: (b: B, a: A) => B) => (self: readonly A[]) => B;
/**
* @category instances
* @since 1.0.0
*/
export declare const Foldable: foldable.Foldable<ReadonlyArrayTypeLambda>;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (a: A, b: B) => B) => (self: readonly A[]) => B;
export declare const foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => (self: ReadonlyArray<A>) => M;
/**

@@ -1267,3 +1318,3 @@ * @category folding

*/
export declare const reduceWithIndex: <B, A>(b: B, f: (i: number, b: B, a: A) => B) => (self: readonly A[]) => B;
export declare const reduceKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: ReadonlyArray<A>) => Kind<G, R, O, E, B>;
/**

@@ -1273,3 +1324,3 @@ * @category folding

*/
export declare const foldMapWithIndex: <M>(Monoid: Monoid<M>) => <A>(f: (i: number, a: A) => M) => (self: readonly A[]) => M;
export declare const reduceRightKind: <G extends TypeLambda>(G: monad.Monad<G>) => <B, A, R, O, E>(b: B, f: (b: B, a: A) => Kind<G, R, O, E, B>) => (self: ReadonlyArray<A>) => Kind<G, R, O, E, B>;
/**

@@ -1279,3 +1330,3 @@ * @category folding

*/
export declare const reduceRightWithIndex: <B, A>(b: B, f: (i: number, a: A, b: B) => B) => (self: readonly A[]) => B;
export declare const foldMapKind: <G extends TypeLambda>(G: Coproduct<G>) => <A, R, O, E, B>(f: (a: A) => Kind<G, R, O, E, B>) => (self: ReadonlyArray<A>) => Kind<G, R, O, E, B>;
/**

@@ -1285,4 +1336,14 @@ * @category folding

*/
export declare const reduceKind: <F extends TypeLambda>(Flattenable: flatMap_.FlatMap<F>) => <S, R, O, E, B, A>(fb: Kind<F, S, R, O, E, B>, f: (b: B, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly A[]) => Kind<F, S, R, O, E, B>;
export declare const reduceWithIndex: <B, A>(b: B, f: (i: number, b: B, a: A) => B) => (self: readonly A[]) => B;
/**
* @category folding
* @since 1.0.0
*/
export declare const foldMapWithIndex: <M>(Monoid: Monoid<M>) => <A>(f: (i: number, a: A) => M) => (self: readonly A[]) => M;
/**
* @category folding
* @since 1.0.0
*/
export declare const reduceRightWithIndex: <B, A>(b: B, f: (i: number, a: A, b: B) => B) => (self: readonly A[]) => B;
/**
* @category instances

@@ -1293,6 +1354,6 @@ * @since 1.0.0

/**
* @category instances
* @category traversing
* @since 1.0.0
*/
export declare const TraversableWithIndex: traversableWithIndex.TraversableWithIndex<ReadonlyArrayTypeLambda, number>;
export declare const sequence: <F extends TypeLambda>(F: applicative.Applicative<F>) => <R, O, E, A>(fas: ReadonlyArray<Kind<F, R, O, E, A>>) => Kind<F, R, O, E, ReadonlyArray<A>>;
/**

@@ -1302,3 +1363,3 @@ * @category traversing

*/
export declare const sequence: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <S, R, O, E, A>(fas: ReadonlyArray<Kind<F, S, R, O, E, A>>) => Kind<F, S, R, O, E, ReadonlyArray<A>>;
export declare const traverseTap: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, B>) => (self: ReadonlyArray<A>) => Kind<F, R, O, E, ReadonlyArray<A>>;
/**

@@ -1308,3 +1369,3 @@ * @category filtering

*/
export declare const traverseFilterMap: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, Option<B>>) => (ta: ReadonlyArray<A>) => Kind<F, S, R, O, E, ReadonlyArray<B>>;
export declare const traverseFilterMap: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B>(f: (a: A) => Kind<F, R, O, E, Option<B>>) => (ta: ReadonlyArray<A>) => Kind<F, R, O, E, ReadonlyArray<B>>;
/**

@@ -1314,3 +1375,3 @@ * @category filtering

*/
export declare const traversePartitionMap: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <A, S, R, O, E, B, C>(f: (a: A) => Kind<F, S, R, O, E, Either<B, C>>) => (wa: ReadonlyArray<A>) => Kind<F, S, R, O, E, readonly [ReadonlyArray<B>, ReadonlyArray<C>]>;
export declare const traversePartitionMap: <F extends TypeLambda>(F: applicative.Applicative<F>) => <A, R, O, E, B, C>(f: (a: A) => Kind<F, R, O, E, Either<B, C>>) => (wa: ReadonlyArray<A>) => Kind<F, R, O, E, readonly [ReadonlyArray<B>, ReadonlyArray<C>]>;
/**

@@ -1325,5 +1386,5 @@ * @category instances

* @exampleTodo
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import * as T from '@fp-ts/core/data/Async'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as T from '@fp-ts/core/typeclass/data/Async'
*

@@ -1344,7 +1405,7 @@ * const traverseFilter = RA.traverseFilter(T.MonoidalPar)

*/
export declare const traverseFilter: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => (self: ReadonlyArray<B>) => Kind<F, S, R, O, E, ReadonlyArray<B>>;
export declare const traverseFilter: <F extends TypeLambda>(F: applicative.Applicative<F>) => <B extends A, R, O, E, A = B>(predicate: (a: A) => Kind<F, R, O, E, boolean>) => (self: ReadonlyArray<B>) => Kind<F, R, O, E, ReadonlyArray<B>>;
/**
* @since 1.0.0
*/
export declare const traversePartition: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => (self: ReadonlyArray<B>) => Kind<F, S, R, O, E, readonly [ReadonlyArray<B>, ReadonlyArray<B>]>;
export declare const traversePartition: <F extends TypeLambda>(F: applicative.Applicative<F>) => <B extends A, R, O, E, A = B>(predicate: (a: A) => Kind<F, R, O, E, boolean>) => (self: ReadonlyArray<B>) => Kind<F, R, O, E, readonly [ReadonlyArray<B>, ReadonlyArray<B>]>;
/**

@@ -1392,4 +1453,4 @@ * @category instances

* @exampleTodo
* import { every } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { every } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1409,4 +1470,4 @@ * const isPositive = (n: number): boolean => n > 0

* @exampleTodo
* import { some } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { some } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1432,4 +1493,4 @@ * const isPositive = (n: number): boolean => n > 0

* @exampleTodo
* import * as S from '@fp-ts/core/data/string'
* import { intercalate } from '@fp-ts/core/data/ReadonlyArray'
* import * as S from '@fp-ts/core/typeclass/data/string'
* import { intercalate } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -1446,9 +1507,2 @@ * assert.deepStrictEqual(intercalate(S.Monoid)('-')(['a', 'b', 'c']), 'a-b-c')

export declare const Do: ReadonlyArray<{}>;
/**
* @category do notation
* @since 1.0.0
*/
export declare const bindTo: <N extends string>(name: N) => <A>(self: ReadonlyArray<A>) => ReadonlyArray<{
readonly [K in N]: A;
}>;
declare const let_: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => B) => (self: ReadonlyArray<A>) => ReadonlyArray<{

@@ -1464,9 +1518,2 @@ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;

/**
* @category do notation
* @since 1.0.0
*/
export declare const bind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, f: (a: A) => ReadonlyArray<B>) => (self: ReadonlyArray<A>) => ReadonlyArray<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* A variant of `bind` that sequentially ignores the scope.

@@ -1477,22 +1524,9 @@ *

*/
export declare const bindRight: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: ReadonlyArray<B>) => (self: ReadonlyArray<A>) => ReadonlyArray<{
export declare const bindReadonlyArray: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: ReadonlyArray<B>) => (self: ReadonlyArray<A>) => ReadonlyArray<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;
}>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const Zip: ReadonlyArray<readonly []>;
/**
* @category tuple sequencing
* @since 1.0.0
*/
export declare const tupled: <A>(self: ReadonlyArray<A>) => ReadonlyArray<readonly [A]>;
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
export declare const zipFlatten: <B>(fb: ReadonlyArray<B>) => <A extends ReadonlyArray<unknown>>(self: ReadonlyArray<A>) => ReadonlyArray<readonly [...A, B]>;
export declare const productFlatten: <B>(fb: ReadonlyArray<B>) => <A extends ReadonlyArray<unknown>>(self: ReadonlyArray<A>) => ReadonlyArray<readonly [...A, B]>;
//# sourceMappingURL=ReadonlyArray.d.ts.map

@@ -6,5 +6,5 @@ "use strict";

});
exports.dropLeft = exports.difference = exports.deleteAt = exports.crossWith = exports.crossMany = exports.crossAll = exports.cross = exports.concat = exports.compact = exports.chunksOf = exports.chop = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.append = exports.ap = exports.Zip = exports.TraversableWithIndex = exports.TraversableFilterable = exports.Traversable = exports.Semigroupal = exports.Pointed = exports.Monoidal = exports.Monad = exports.FunctorWithIndex = exports.Functor = exports.FromOption = exports.FlatMap = exports.Filterable = exports.Extendable = exports.Do = exports.Compactable = void 0;
exports.dropLeft = exports.difference = exports.deleteAt = exports.cross = exports.concat = exports.composeKleisliArrow = exports.compact = exports.chunksOf = exports.chop = exports.bindTo = exports.bindReadonlyArray = exports.bind = exports.asUnit = exports.as = exports.append = exports.ap = exports.andThenDiscard = exports.andThen = exports.TraversableFilterable = exports.Traversable = exports.Product = exports.Pointed = exports.Of = exports.NonEmptyProduct = exports.NonEmptyApplicative = exports.Monad = exports.Invariant = exports.FromOption = exports.Foldable = exports.FlatMap = exports.Filterable = exports.Do = exports.Covariant = exports.Compactable = exports.Chainable = exports.Applicative = void 0;
exports.dropLeftWhile = dropLeftWhile;
exports.empty = exports.elem = exports.duplicate = exports.dropRight = void 0;
exports.empty = exports.elem = exports.dropRight = void 0;
exports.every = every;

@@ -15,21 +15,35 @@ exports.filterWithIndex = exports.filterMapWithIndex = exports.filterMap = exports.filter = exports.extend = exports.exists = void 0;

exports.findLast = findLast;
exports.partitionWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partition = exports.orElse = exports.of = exports.modifyAt = exports.matchRight = exports.matchLeft = exports.match = exports.mapWithIndex = exports.map = exports.makeBy = exports.lookup = exports.liftSortable = exports.liftPredicate = exports.liftOption = exports.liftNullable = exports.liftEither = exports.lift3 = exports.lift2 = exports.let = exports.lefts = exports.last = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.intersperse = exports.intersection = exports.intercalate = exports.insertAt = exports.init = exports.head = exports.getUnionSemigroup = exports.getUnionMonoid = exports.getSemigroup = exports.getMonoid = exports.getIntersectionSemigroup = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.fromEither = exports.foldMapWithIndex = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMapNullable = exports.flatMap = exports.flap = exports.findLastMap = exports.findLastIndex = void 0;
exports.sortBy = exports.sort = exports.some = exports.size = exports.sequence = exports.separate = exports.scanRight = exports.scanLeft = exports.rotate = exports.rights = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceKind = exports.reduce = exports.range = exports.prependAll = exports.prepend = void 0;
exports.modifyAt = exports.matchRight = exports.matchLeft = exports.match = exports.mapWithIndex = exports.map = exports.makeBy = exports.lookup = exports.liftSemigroup = exports.liftPredicate = exports.liftOrder = exports.liftOption = exports.liftNullable = exports.liftMonoid = exports.liftEither = exports.lift3 = exports.lift2 = exports.let = exports.lefts = exports.last = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.intersperse = exports.intersection = exports.intercalate = exports.insertAt = exports.init = exports.imap = exports.head = exports.getUnionSemigroup = exports.getUnionMonoid = exports.getSemigroup = exports.getMonoid = exports.getIntersectionSemigroup = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.fromEither = exports.foldMapWithIndex = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMapNullable = exports.flatMap = exports.flap = exports.findLastMap = exports.findLastIndex = void 0;
exports.sortBy = exports.sort = exports.some = exports.size = exports.sequence = exports.separate = exports.scanRight = exports.scanLeft = exports.rotate = exports.rights = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRightKind = exports.reduceRight = exports.reduceKind = exports.reduce = exports.range = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.prependAll = exports.prepend = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partition = exports.orElse = exports.of = void 0;
exports.spanLeft = spanLeft;
exports.takeLeft = exports.tail = exports.splitAt = void 0;
exports.takeLeftWhile = takeLeftWhile;
exports.zipWith = exports.zipRight = exports.zipMany = exports.zipLeft = exports.zipFlatten = exports.zipAll = exports.zip = exports.updateAt = exports.unzip = exports.unit = exports.uniq = exports.union = exports.unfold = exports.tupled = exports.traverseWithIndex = exports.traversePartitionMap = exports.traversePartition = exports.traverseFilterMap = exports.traverseFilter = exports.traverse = exports.tap = exports.takeRight = void 0;
exports.zipWith = exports.zipMany = exports.zipAll = exports.zip = exports.updateAt = exports.unzip = exports.uniq = exports.union = exports.unfold = exports.tupled = exports.traverseWithIndex = exports.traverseTap = exports.traversePartitionMap = exports.traversePartition = exports.traverseFilterMap = exports.traverseFilter = exports.traverse = exports.tap = exports.takeRight = void 0;
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));
var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));
var chainable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Chainable"));
var _Semigroup = /*#__PURE__*/require("@fp-ts/core/Semigroup");
var covariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Covariant"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var filterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Filterable"));
var sortable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/FlatMap"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Traversable"));
var foldable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Foldable"));
var invariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Invariant"));
var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var order = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Order"));
var _Semigroup = /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup");
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));
var traversableFilterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/TraversableFilterable"));
var _Equal = /*#__PURE__*/require("@fp-ts/data/Equal");

@@ -47,8 +61,4 @@

var filterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/Filterable"));
var fromOption_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/FromOption"));
var traversableFilterable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/TraversableFilterable"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

@@ -62,3 +72,3 @@

*/
const fromIterable = internal.Arrayfrom;
const fromIterable = internal.fromIterable;
/**

@@ -70,4 +80,4 @@ * Return a `ReadonlyArray` of length `n` with element `i` initialized with `f(i)`.

* @exampleTodo
* import { makeBy } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { makeBy } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -105,4 +115,4 @@ * const double = (n: number): number => n * 2

* @exampleTodo
* import { replicate } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { replicate } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -154,3 +164,3 @@ * assert.deepStrictEqual(pipe(3, replicate('a')), ['a', 'a', 'a'])

* @exampleTodo
* import { matchLeft } from '@fp-ts/core/data/ReadonlyArray'
* import { matchLeft } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -191,3 +201,3 @@ * const len: <A>(as: ReadonlyArray<A>) => number = matchLeft(() => 0, (_, tail) => 1 + len(tail))

* @exampleTodo
* import { scanLeft } from '@fp-ts/core/data/ReadonlyArray'
* import { scanLeft } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -217,3 +227,3 @@ * assert.deepStrictEqual(scanLeft(10, (b, a: number) => b - a)([1, 2, 3]), [10, 9, 7, 4])

* @exampleTodo
* import { scanRight } from '@fp-ts/core/data/ReadonlyArray'
* import { scanRight } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -243,3 +253,3 @@ * assert.deepStrictEqual(scanRight(10, (a: number, b) => b - a)([1, 2, 3]), [4, 5, 7, 10])

* @exampleTodo
* import { isEmpty } from '@fp-ts/core/data/ReadonlyArray'
* import { isEmpty } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -287,5 +297,5 @@ * assert.strictEqual(isEmpty([]), true)

* @exampleTodo
* import { lookup } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { pipe } from '@fp-ts/core/data/Function'
* import { lookup } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -305,4 +315,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], lookup(1)), some(2))

* @exampleTodo
* import { prepend } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { prepend } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -322,4 +332,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], prepend(0)), [0, 1, 2, 3])

* @exampleTodo
* import { append } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { append } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -338,4 +348,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], append(4)), [1, 2, 3, 4])

* @exampleTodo
* import { head } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { head } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -355,4 +365,4 @@ * assert.deepStrictEqual(head([1, 2, 3]), some(1))

* @exampleTodo
* import { last } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { last } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -373,4 +383,4 @@ * assert.deepStrictEqual(last([1, 2, 3]), some(3))

* @exampleTodo
* import { tail } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { tail } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -391,4 +401,4 @@ * assert.deepStrictEqual(tail([1, 2, 3]), some([2, 3]))

* @exampleTodo
* import { init } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { init } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -411,4 +421,4 @@ * assert.deepStrictEqual(init([1, 2, 3]), some([1, 2]))

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -435,4 +445,4 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -495,4 +505,4 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -515,4 +525,4 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -544,4 +554,4 @@ * const input: ReadonlyArray<number> = [1, 2, 3]

* @exampleTodo
* import { findIndex } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findIndex } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -586,4 +596,4 @@ * assert.deepStrictEqual(findIndex((n: number) => n === 2)([1, 2, 3]), some(1))

* @exampleTodo
* import { findFirstMap } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findFirstMap } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -637,4 +647,4 @@ * interface Person {

* @exampleTodo
* import { findLastMap } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findLastMap } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -672,4 +682,4 @@ * interface Person {

* @exampleTodo
* import { findLastIndex } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { findLastIndex } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -705,4 +715,4 @@ * interface X {

* @exampleTodo
* import { insertAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some } from '@fp-ts/core/data/Option'
* import { insertAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some } from '@fp-ts/core/typeclass/data/Option'
*

@@ -734,4 +744,4 @@ * assert.deepStrictEqual(insertAt(2, 5)([1, 2, 3, 4]), some([1, 2, 5, 3, 4]))

* @exampleTodo
* import { updateAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { updateAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -753,4 +763,4 @@ * assert.deepStrictEqual(updateAt(1, 1)([1, 2, 3]), some([1, 1, 3]))

* @exampleTodo
* import { modifyAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { modifyAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -795,4 +805,4 @@ * const double = (x: number): number => x * 2

* @exampleTodo
* import { deleteAt } from '@fp-ts/core/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/data/Option'
* import { deleteAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { some, none } from '@fp-ts/core/typeclass/data/Option'
*

@@ -811,3 +821,3 @@ * assert.deepStrictEqual(deleteAt(0)([1, 2, 3]), some([2, 3]))

* @exampleTodo
* import { reverse } from '@fp-ts/core/data/ReadonlyArray'
* import { reverse } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -827,4 +837,4 @@ * assert.deepStrictEqual(reverse([1, 2, 3]), [3, 2, 1])

* @exampleTodo
* import { rights } from '@fp-ts/core/data/ReadonlyArray'
* import { right, left } from '@fp-ts/core/data/Either'
* import { rights } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { right, left } from '@fp-ts/core/typeclass/data/Either'
*

@@ -857,4 +867,4 @@ * assert.deepStrictEqual(rights([succeed(1), left('foo'), right(2)]), [1, 2])

* @exampleTodo
* import { lefts } from '@fp-ts/core/data/ReadonlyArray'
* import { left, right } from '@fp-ts/core/data/Either'
* import { lefts } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { left, right } from '@fp-ts/core/typeclass/data/Either'
*

@@ -887,6 +897,6 @@ * assert.deepStrictEqual(failures([right(1), left('foo'), right(2)]), ['foo'])

* @exampleTodo
* import { sort } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { sort } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
*
* assert.deepStrictEqual(sort(N.Sortable)([3, 2, 1]), [1, 2, 3])
* assert.deepStrictEqual(sort(N.Order)([3, 2, 1]), [1, 2, 3])
*

@@ -905,4 +915,4 @@ * @since 1.0.0

* @exampleTodo
* import { zipWith } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { zipWith } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -932,4 +942,4 @@ * assert.deepStrictEqual(pipe([1, 2, 3], zipWith(['a', 'b', 'c', 'd'], (n, s) => s + n)), ['a1', 'b2', 'c3'])

* @exampleTodo
* import { zip } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { zip } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -996,3 +1006,3 @@ * assert.deepStrictEqual(pipe([1, 2, 3], zip(['a', 'b', 'c', 'd'])), [[1, 'a'], [2, 'b'], [3, 'c']])

* @exampleTodo
* import { unzip } from '@fp-ts/core/data/ReadonlyArray'
* import { unzip } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -1025,3 +1035,3 @@ * assert.deepStrictEqual(unzip([[1, 'a'], [2, 'b'], [3, 'c']]), [[1, 2, 3], ['a', 'b', 'c']])

const crossWith = (that, f) => self => {
const product = that => self => {
if (isEmpty(self) || isEmpty(that)) {

@@ -1035,3 +1045,3 @@ return empty;

for (let j = 0; j < that.length; j++) {
out.push(f(self[i], that[j]));
out.push([self[i], that[j]]);
}

@@ -1047,5 +1057,5 @@ }

exports.crossWith = crossWith;
exports.product = product;
const cross = fb => crossWith(fb, (a, b) => [a, b]);
const cross = fb => product(fb);
/**

@@ -1058,3 +1068,3 @@ * @since 1.0.0

const crossMany = collection => self => {
const productMany = collection => self => {
if (isEmpty(self)) {

@@ -1086,5 +1096,5 @@ return empty;

exports.crossMany = crossMany;
exports.productMany = productMany;
const crossAll = collection => {
const productAll = collection => {
const arrays = Array.from(collection);

@@ -1096,3 +1106,3 @@

return crossMany(arrays.slice(1))(arrays[0]);
return productMany(arrays.slice(1))(arrays[0]);
};

@@ -1103,4 +1113,4 @@ /**

* @exampleTodo
* import { prependAll } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { prependAll } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1113,3 +1123,3 @@ * assert.deepStrictEqual(pipe([1, 2, 3, 4], prependAll(9)), [9, 1, 9, 2, 9, 3, 9, 4])

exports.crossAll = crossAll;
exports.productAll = productAll;

@@ -1124,4 +1134,4 @@ const prependAll = middle => {

* @exampleTodo
* import { intersperse } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { intersperse } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1144,3 +1154,3 @@ * assert.deepStrictEqual(pipe([1, 2, 3, 4], intersperse(9)), [1, 9, 2, 9, 3, 9, 4])

* @exampleTodo
* import { rotate } from '@fp-ts/core/data/ReadonlyArray'
* import { rotate } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -1164,5 +1174,5 @@ * assert.deepStrictEqual(rotate(2)([1, 2, 3, 4, 5]), [4, 5, 1, 2, 3])

* @exampleTodo
* import { elem } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { elem } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1194,4 +1204,4 @@ * assert.strictEqual(pipe([1, 2, 3], elem(N.Eq)(2)), true)

* @exampleTodo
* import { uniq } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { uniq } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
*

@@ -1212,7 +1222,7 @@ * assert.deepStrictEqual(uniq(N.Eq)([1, 2, 1]), [1, 2])

* @exampleTodo
* import { sortBy } from '@fp-ts/core/data/ReadonlyArray'
* import { contramap } from '@fp-ts/core/Sortable'
* import * as S from '@fp-ts/core/data/string'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { sortBy } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { contramap } from '@fp-ts/core/typeclass/Order'
* import * as S from '@fp-ts/core/typeclass/data/string'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1223,4 +1233,4 @@ * interface Person {

* }
* const byName = pipe(S.Sortable, contramap((p: Person) => p.name))
* const byAge = pipe(N.Sortable, contramap((p: Person) => p.age))
* const byName = pipe(S.Order, contramap((p: Person) => p.name))
* const byAge = pipe(N.Order, contramap((p: Person) => p.age))
*

@@ -1243,4 +1253,4 @@ * const sortByNameByAge = sortBy([byName, byAge])

const sortBy = ords => {
const f = nonEmptyReadonlyArray.sortBy(ords);
const sortBy = orders => {
const f = nonEmptyReadonlyArray.sortBy(orders);
return as => isNonEmpty(as) ? f(as) : as;

@@ -1254,6 +1264,6 @@ };

* @exampleTodo
* import { Eq } from '@fp-ts/core/typeclasses/Eq'
* import * as N from '@fp-ts/core/data/number'
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { Eq } from '@fp-ts/core/typeclass/typeclasses/Eq'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1279,3 +1289,3 @@ * const group = <A>(E: Eq<A>): ((as: ReadonlyArray<A>) => ReadonlyArray<ReadonlyArray<A>>) => {

* @exampleTodo
* import { splitAt } from '@fp-ts/core/data/ReadonlyArray'
* import { splitAt } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -1303,3 +1313,3 @@ * assert.deepStrictEqual(splitAt(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4, 5]])

* @exampleTodo
* import { chunksOf } from '@fp-ts/core/data/ReadonlyArray'
* import { chunksOf } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -1322,5 +1332,5 @@ * assert.deepStrictEqual(chunksOf(2)([1, 2, 3, 4, 5]), [[1, 2], [3, 4], [5]])

* @exampleTodo
* import { union } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { union } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1341,5 +1351,5 @@ * assert.deepStrictEqual(pipe([1, 2], union(N.Eq)([2, 3])), [1, 2, 3])

* @exampleTodo
* import { intersection } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { intersection } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1360,5 +1370,5 @@ * assert.deepStrictEqual(pipe([1, 2], intersection(N.Eq)([2, 3])), [2])

* @exampleTodo
* import { difference } from '@fp-ts/core/data/ReadonlyArray'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
* import { difference } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as N from '@fp-ts/core/typeclass/data/number'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1397,4 +1407,4 @@ * assert.deepStrictEqual(pipe([1, 2], difference(N.Eq)([2, 3])), [1])

* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1434,9 +1444,64 @@ * assert.deepStrictEqual(

exports.map = map;
const Pointed = {
const Of = {
of
};
/**
* @since 1.0.0
*/
exports.Of = Of;
const imap = /*#__PURE__*/covariant.imap(map);
/**
* @category instances
* @since 1.0.0
*/
exports.imap = imap;
const Invariant = {
imap
};
/**
* @since 1.0.0
*/
exports.Invariant = Invariant;
const tupled = /*#__PURE__*/invariant.tupled(Invariant);
/**
* @category do notation
* @since 1.0.0
*/
exports.tupled = tupled;
const bindTo = /*#__PURE__*/invariant.bindTo(Invariant);
/**
* @category instances
* @since 1.0.0
*/
exports.bindTo = bindTo;
const Covariant = { ...Invariant,
map
};
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @since 1.0.0
*/
exports.Covariant = Covariant;
const asUnit = /*#__PURE__*/covariant.asUnit(Covariant);
/**
* @category instances
* @since 1.0.0
*/
exports.asUnit = asUnit;
const Pointed = { ...Of,
...Covariant
};
/**
* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1473,6 +1538,26 @@ * assert.deepStrictEqual(

const FlatMap = {
map,
flatMap
};
/**
* @since 1.0.0
*/
exports.FlatMap = FlatMap;
const andThen = /*#__PURE__*/flatMap_.andThen(FlatMap);
/**
* @since 1.0.0
*/
exports.andThen = andThen;
const composeKleisliArrow = /*#__PURE__*/flatMap_.composeKleisliArrow(FlatMap);
/**
* @category instances
* @since 1.0.0
*/
exports.composeKleisliArrow = composeKleisliArrow;
const Chainable = { ...FlatMap,
...Covariant
};
/**
* Sequences the specified effect after this effect, but ignores the value

@@ -1485,13 +1570,11 @@ * produced by the effect.

exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
exports.Chainable = Chainable;
const andThenDiscard = /*#__PURE__*/chainable.andThenDiscard(Chainable);
/**
* A variant of `flatMap` that ignores the value produced by this effect.
*
* @category sequencing
* @category do notation
* @since 1.0.0
*/
exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
exports.andThenDiscard = andThenDiscard;
const bind = /*#__PURE__*/chainable.bind(Chainable);
/**

@@ -1501,3 +1584,3 @@ * @since 1.0.0

exports.zipRight = zipRight;
exports.bind = bind;

@@ -1529,3 +1612,3 @@ const ap = fa => fb => (0, _Function.pipe)(fb, flatMap(f => (0, _Function.pipe)(fa, map(a => f(a)))));

* @exampleTodo
* import { flatten } from '@fp-ts/core/data/ReadonlyArray'
* import { flatten } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -1548,3 +1631,3 @@ * assert.deepStrictEqual(flatten([[1], [2, 3], [4]]), [1, 2, 3, 4])

/**
* @category instances
* @category filtering
* @since 1.0.0

@@ -1555,14 +1638,5 @@ */

exports.mapWithIndex = mapWithIndex;
const FunctorWithIndex = {
mapWithIndex
};
/**
* @category filtering
* @since 1.0.0
*/
exports.FunctorWithIndex = FunctorWithIndex;
const filterMapWithIndex = f => self => {
const as = internal.Arrayfrom(self);
const as = internal.fromIterable(self);
const out = [];

@@ -1660,2 +1734,3 @@

/**
* @category traversing
* @since 1.0.0

@@ -1666,11 +1741,4 @@ */

exports.extend = extend;
const duplicate = /*#__PURE__*/extend(_Function.identity);
/**
* @category traversing
* @since 1.0.0
*/
exports.duplicate = duplicate;
const traverseWithIndex = Monoidal => f => self => Monoidal.zipAll(self.map(f));
const traverseWithIndex = F => f => self => F.productAll(self.map(f));
/**

@@ -1684,3 +1752,3 @@ * @category traversing

const traverse = Monoidal => f => traverseWithIndex(Monoidal)(f);
const traverse = F => f => traverseWithIndex(F)(f);
/**

@@ -1748,4 +1816,4 @@ * @since 1.0.0

* @exampleTodo
* import { getSemigroup } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { getSemigroup } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1783,3 +1851,3 @@ * const S = getSemigroup<number>()

/**
* Derives an `Sortable` over the `ReadonlyArray` of a given element type from the `Sortable` of that type. The ordering between two such
* Derives an `Order` over the `ReadonlyArray` of a given element type from the `Order` of that type. The ordering between two such
* `ReadonlyArray`s is equal to: the first non equal comparison of each `ReadonlyArray`s elements taken pairwise in increasing order, in

@@ -1790,7 +1858,7 @@ * case of equality over all the pairwise elements; the longest `ReadonlyArray` is considered the greatest, if both `ReadonlyArray`s have

* @exampleTodo
* import { liftSortable } from '@fp-ts/core/data/ReadonlyArray'
* import * as S from '@fp-ts/core/data/string'
* import { pipe } from '@fp-ts/core/data/Function'
* import { liftOrder } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as S from '@fp-ts/core/typeclass/data/string'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*
* const O = liftSortable(S.Sortable)
* const O = liftOrder(S.Order)
* assert.strictEqual(pipe(['b'], O.compare(['a'])), 1)

@@ -1807,3 +1875,3 @@ * assert.strictEqual(pipe(['a'], O.compare(['a'])), 0)

const liftSortable = Sortable => sortable.fromCompare(that => self => {
const liftOrder = O => order.fromCompare(that => self => {
const aLen = self.length;

@@ -1814,3 +1882,3 @@ const bLen = that.length;

for (let i = 0; i < len; i++) {
const o = Sortable.compare(that[i])(self[i]);
const o = O.compare(that[i])(self[i]);

@@ -1822,6 +1890,6 @@ if (o !== 0) {

return number.Sortable.compare(bLen)(aLen);
return number.Order.compare(bLen)(aLen);
});
/**
* @category instances
* @category mapping
* @since 1.0.0

@@ -1831,14 +1899,5 @@ */

exports.liftSortable = liftSortable;
const Functor = {
map
};
exports.liftOrder = liftOrder;
const flap = /*#__PURE__*/covariant.flap(Covariant);
/**
* @category mapping
* @since 1.0.0
*/
exports.Functor = Functor;
const flap = /*#__PURE__*/functor.flap(Functor);
/**
* Maps the success value of this effect to the specified constant value.

@@ -1851,7 +1910,5 @@ *

exports.flap = flap;
const as = /*#__PURE__*/functor.as(Functor);
const as = /*#__PURE__*/covariant.as(Covariant);
/**
* Returns the effect resulting from mapping the success of this effect to unit.
*
* @category mapping
* @category instances
* @since 1.0.0

@@ -1861,3 +1918,6 @@ */

exports.as = as;
const unit = /*#__PURE__*/functor.unit(Functor);
const NonEmptyProduct = { ...Invariant,
product,
productMany
};
/**

@@ -1868,7 +1928,5 @@ * @category instances

exports.unit = unit;
const Semigroupal = {
map,
zipWith: crossWith,
zipMany: crossMany
exports.NonEmptyProduct = NonEmptyProduct;
const NonEmptyApplicative = { ...NonEmptyProduct,
...Covariant
};

@@ -1882,4 +1940,4 @@ /**

exports.Semigroupal = Semigroupal;
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
exports.NonEmptyApplicative = NonEmptyApplicative;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
/**

@@ -1893,4 +1951,10 @@ * Lifts a ternary function into `ReadonlyArray`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
/**
* @since 1.0.0
*/
exports.lift3 = lift3;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
/**
* @category instances

@@ -1900,9 +1964,6 @@ * @since 1.0.0

exports.lift3 = lift3;
const Monoidal = {
map,
of,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: crossAll
exports.liftSemigroup = liftSemigroup;
const Product = { ...Of,
...NonEmptyProduct,
productAll
};

@@ -1914,14 +1975,27 @@ /**

exports.Monoidal = Monoidal;
const Monad = {
map,
of,
flatMap
exports.Product = Product;
const Applicative = { ...NonEmptyApplicative,
...Product
};
/**
* @since 1.0.0
*/
exports.Applicative = Applicative;
const liftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
/**
* @category instances
* @since 1.0.0
*/
exports.liftMonoid = liftMonoid;
const Monad = { ...Pointed,
...FlatMap
};
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @exampleTodo
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -1947,3 +2021,3 @@ * assert.deepStrictEqual(

exports.Monad = Monad;
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
const tap = /*#__PURE__*/chainable.tap(Chainable);
/**

@@ -1955,12 +2029,2 @@ * @category instances

exports.tap = tap;
const Extendable = {
map,
extend
};
/**
* @category instances
* @since 1.0.0
*/
exports.Extendable = Extendable;
const Compactable = {

@@ -2027,4 +2091,15 @@ compact

const foldMap = Monoid => f => self => self.reduce((m, a) => Monoid.combine(f(a))(m), Monoid.empty);
const reduceRight = (b, f) => self => self.reduceRight((b, a) => f(b, a), b);
/**
* @category instances
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
const Foldable = {
reduce,
reduceRight
};
/**
* @category folding

@@ -2034,6 +2109,18 @@ * @since 1.0.0

exports.Foldable = Foldable;
const foldMap = /*#__PURE__*/foldable.foldMap(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.foldMap = foldMap;
const reduceKind = /*#__PURE__*/foldable.reduceKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
const reduceRight = (b, f) => self => self.reduceRight((b, a) => f(a, b), b);
exports.reduceKind = reduceKind;
const reduceRightKind = /*#__PURE__*/foldable.reduceRightKind(Foldable);
/**

@@ -2044,4 +2131,10 @@ * @category folding

exports.reduceRightKind = reduceRightKind;
const foldMapKind = /*#__PURE__*/foldable.foldMapKind(Foldable);
/**
* @category folding
* @since 1.0.0
*/
exports.reduceRight = reduceRight;
exports.foldMapKind = foldMapKind;

@@ -2068,3 +2161,3 @@ const reduceWithIndex = (b, f) => self => self.reduce((b, a, i) => f(i, b, a), b);

/**
* @category folding
* @category instances
* @since 1.0.0

@@ -2075,11 +2168,2 @@ */

exports.reduceRightWithIndex = reduceRightWithIndex;
const reduceKind = Flattenable => (fb, f) => reduce(fb, (fb, a) => (0, _Function.pipe)(fb, Flattenable.flatMap(b => f(b, a))));
/**
* @category instances
* @since 1.0.0
*/
exports.reduceKind = reduceKind;
const Traversable = {

@@ -2089,3 +2173,3 @@ traverse

/**
* @category instances
* @category traversing
* @since 1.0.0

@@ -2095,5 +2179,3 @@ */

exports.Traversable = Traversable;
const TraversableWithIndex = {
traverseWithIndex
};
const sequence = /*#__PURE__*/traversable.sequence(Traversable);
/**

@@ -2104,4 +2186,4 @@ * @category traversing

exports.TraversableWithIndex = TraversableWithIndex;
const sequence = /*#__PURE__*/traversable.sequence(Traversable);
exports.sequence = sequence;
const traverseTap = /*#__PURE__*/traversable.traverseTap(Traversable);
/**

@@ -2112,4 +2194,6 @@ * @category filtering

exports.sequence = sequence;
const traverseFilterMap = /*#__PURE__*/traversableFilterable.traverseFilterMap(Traversable, Compactable);
exports.traverseTap = traverseTap;
const traverseFilterMap = /*#__PURE__*/traversableFilterable.traverseFilterMap({ ...Traversable,
...Compactable
});
/**

@@ -2121,3 +2205,6 @@ * @category filtering

exports.traverseFilterMap = traverseFilterMap;
const traversePartitionMap = /*#__PURE__*/traversableFilterable.traversePartitionMap(Traversable, Functor, Compactable);
const traversePartitionMap = /*#__PURE__*/traversableFilterable.traversePartitionMap({ ...Traversable,
...Covariant,
...Compactable
});
/**

@@ -2137,5 +2224,5 @@ * @category instances

* @exampleTodo
* import { pipe } from '@fp-ts/core/data/Function'
* import * as RA from '@fp-ts/core/data/ReadonlyArray'
* import * as T from '@fp-ts/core/data/Async'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
* import * as RA from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import * as T from '@fp-ts/core/typeclass/data/Async'
*

@@ -2230,4 +2317,4 @@ * const traverseFilter = RA.traverseFilter(T.MonoidalPar)

* @exampleTodo
* import { some } from '@fp-ts/core/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/data/Function'
* import { some } from '@fp-ts/core/typeclass/data/ReadonlyArray'
* import { pipe } from '@fp-ts/core/typeclass/data/Function'
*

@@ -2258,4 +2345,4 @@ * const isPositive = (n: number): boolean => n > 0

* @exampleTodo
* import * as S from '@fp-ts/core/data/string'
* import { intercalate } from '@fp-ts/core/data/ReadonlyArray'
* import * as S from '@fp-ts/core/typeclass/data/string'
* import { intercalate } from '@fp-ts/core/typeclass/data/ReadonlyArray'
*

@@ -2284,19 +2371,7 @@ * assert.deepStrictEqual(intercalate(S.Monoid)('-')(['a', 'b', 'c']), 'a-b-c')

const Do = /*#__PURE__*/of(internal.Do);
/**
* @category do notation
* @since 1.0.0
*/
exports.Do = Do;
const bindTo = /*#__PURE__*/functor.bindTo(Functor);
exports.bindTo = bindTo;
const let_ = /*#__PURE__*/functor.let(Functor);
const let_ = /*#__PURE__*/covariant.let(Covariant);
exports.let = let_;
/**
* @category do notation
* @since 1.0.0
*/
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**
* A variant of `bind` that sequentially ignores the scope.

@@ -2307,32 +2382,10 @@ *

*/
exports.bind = bind;
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing
// -------------------------------------------------------------------------------------
const bindReadonlyArray = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.bindRight = bindRight;
const Zip = empty;
/**
* @category tuple sequencing
* @since 1.0.0
*/
exports.Zip = Zip;
const tupled = /*#__PURE__*/functor.tupled(Functor);
/**
* Sequentially zips this effect with the specified effect.
*
* @category tuple sequencing
* @since 1.0.0
*/
exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal);
exports.zipFlatten = zipFlatten;
exports.bindReadonlyArray = bindReadonlyArray;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
exports.productFlatten = productFlatten;
//# sourceMappingURL=ReadonlyArray.js.map
/**
* @since 1.0.0
*/
import type { Sortable } from "@fp-ts/core/Sortable";
import type { Order } from "@fp-ts/core/typeclass/Order";
import type { Equal } from "@fp-ts/data/Equal";

@@ -55,5 +55,5 @@ import type { List } from "@fp-ts/data/List";

*/
export declare const empty: <K, V = never>(ord: Sortable<K>) => RedBlackTree<K, V>;
export declare const empty: <K, V = never>(ord: Order<K>) => RedBlackTree<K, V>;
/**
* Gets the `Sortable<K>` that the `RedBlackTree<K, V>` is using.
* Gets the `Order<K>` that the `RedBlackTree<K, V>` is using.
*

@@ -63,3 +63,3 @@ * @since 1.0.0

*/
export declare const getSortable: <K, V>(self: RedBlackTree<K, V>) => Sortable<K>;
export declare const getOrder: <K, V>(self: RedBlackTree<K, V>) => Order<K>;
/**

@@ -71,3 +71,3 @@ * Constructs a new tree from an iterable of key-value pairs.

*/
export declare const from: <K, V>(ord: Sortable<K>) => (entries: Iterable<readonly [K, V]>) => RedBlackTree<K, V>;
export declare const from: <K, V>(ord: Order<K>) => (entries: Iterable<readonly [K, V]>) => RedBlackTree<K, V>;
/**

@@ -79,3 +79,3 @@ * Constructs a new `RedBlackTree` from the specified entries.

*/
export declare const make: <K, Entries extends Array<readonly [K, any]>>(ord: Sortable<K>) => (...entries: Entries) => RedBlackTree<K, Entries[number] extends readonly [any, infer V] ? V : never>;
export declare const make: <K, Entries extends Array<readonly [K, any]>>(ord: Order<K>) => (...entries: Entries) => RedBlackTree<K, Entries[number] extends readonly [any, infer V] ? V : never>;
/**

@@ -82,0 +82,0 @@ * Get all the keys present in the tree.

@@ -6,3 +6,3 @@ "use strict";

});
exports.values = exports.size = exports.removeFirst = exports.reduceWithIndex = exports.reduce = exports.make = exports.lessThanEqual = exports.lessThan = exports.last = exports.keys = exports.isRedBlackTree = exports.insert = exports.has = exports.greaterThanEqual = exports.greaterThan = exports.getSortable = exports.getAt = exports.from = exports.forEachLessThan = exports.forEachGreaterThanEqual = exports.forEachBetween = exports.forEach = exports.first = exports.findFirst = exports.find = exports.empty = exports.backwards = exports.at = exports.Direction = void 0;
exports.values = exports.size = exports.removeFirst = exports.reduceWithIndex = exports.reduce = exports.make = exports.lessThanEqual = exports.lessThan = exports.last = exports.keys = exports.isRedBlackTree = exports.insert = exports.has = exports.greaterThanEqual = exports.greaterThan = exports.getOrder = exports.getAt = exports.from = exports.forEachLessThan = exports.forEachGreaterThanEqual = exports.forEachBetween = exports.forEach = exports.first = exports.findFirst = exports.find = exports.empty = exports.backwards = exports.at = exports.Direction = void 0;

@@ -44,3 +44,3 @@ var RBT = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/RedBlackTree"));

/**
* Gets the `Sortable<K>` that the `RedBlackTree<K, V>` is using.
* Gets the `Order<K>` that the `RedBlackTree<K, V>` is using.
*

@@ -52,3 +52,3 @@ * @since 1.0.0

exports.empty = empty;
const getSortable = RBT.getSortable;
const getOrder = RBT.getOrder;
/**

@@ -61,3 +61,3 @@ * Constructs a new tree from an iterable of key-value pairs.

exports.getSortable = getSortable;
exports.getOrder = getOrder;
const from = RBT.from;

@@ -64,0 +64,0 @@ /**

/**
* @since 1.0.0
*/
import type { Sortable } from "@fp-ts/core/Sortable";
import type { Order } from "@fp-ts/core/typeclass/Order";
import * as Eq from "@fp-ts/data/Equal";

@@ -34,3 +34,3 @@ import * as O from "@fp-ts/data/Option";

*/
export declare const empty: <K, V = never>(ord: Sortable<K>) => SortedMap<K, V>;
export declare const empty: <K, V = never>(ord: Order<K>) => SortedMap<K, V>;
/**

@@ -40,3 +40,3 @@ * @since 1.0.0

*/
export declare const from: <K>(ord: Sortable<K>) => <V>(iterable: Iterable<readonly [K, V]>) => SortedMap<K, V>;
export declare const from: <K>(ord: Order<K>) => <V>(iterable: Iterable<readonly [K, V]>) => SortedMap<K, V>;
/**

@@ -46,3 +46,3 @@ * @since 1.0.0

*/
export declare const make: <K>(ord: Sortable<K>) => <Entries extends readonly (readonly [K, any])[]>(...entries: Entries) => SortedMap<K, Entries[number] extends readonly [any, infer V] ? V : never>;
export declare const make: <K>(ord: Order<K>) => <Entries extends readonly (readonly [K, any])[]>(...entries: Entries) => SortedMap<K, Entries[number] extends readonly [any, infer V] ? V : never>;
/**

@@ -59,3 +59,3 @@ * @since 1.0.0

/**
* Gets the `Sortable<K>` that the `SortedMap<K, V>` is using.
* Gets the `Order<K>` that the `SortedMap<K, V>` is using.
*

@@ -65,3 +65,3 @@ * @since 1.0.0

*/
export declare const getSortable: <K, V>(self: SortedMap<K, V>) => Sortable<K>;
export declare const getOrder: <K, V>(self: SortedMap<K, V>) => Order<K>;
/**

@@ -68,0 +68,0 @@ * @since 1.0.0

@@ -6,3 +6,3 @@ "use strict";

});
exports.values = exports.size = exports.set = exports.remove = exports.reduceWithIndex = exports.reduce = exports.mapWithIndex = exports.map = exports.make = exports.keys = exports.isSortedMap = exports.isNonEmpty = exports.isEmpty = exports.headOption = exports.has = exports.getSortable = exports.get = exports.from = exports.entries = exports.empty = void 0;
exports.values = exports.size = exports.set = exports.remove = exports.reduceWithIndex = exports.reduce = exports.mapWithIndex = exports.map = exports.make = exports.keys = exports.isSortedMap = exports.isNonEmpty = exports.isEmpty = exports.headOption = exports.has = exports.getOrder = exports.get = exports.from = exports.entries = exports.empty = void 0;

@@ -103,3 +103,3 @@ var Eq = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Equal"));

/**
* Gets the `Sortable<K>` that the `SortedMap<K, V>` is using.
* Gets the `Order<K>` that the `SortedMap<K, V>` is using.
*

@@ -113,3 +113,3 @@ * @since 1.0.0

const getSortable = self => RBT.getSortable(self.tree);
const getOrder = self => RBT.getOrder(self.tree);
/**

@@ -121,3 +121,3 @@ * @since 1.0.0

exports.getSortable = getSortable;
exports.getOrder = getOrder;

@@ -229,3 +229,3 @@ const set = (key, value) => self => {

const mapWithIndex = f => self => (0, _Function.pipe)(self, reduceWithIndex(empty(RBT.getSortable(self.tree)), (b, k, v) => set(k, f(k, v))(b)));
const mapWithIndex = f => self => (0, _Function.pipe)(self, reduceWithIndex(empty(RBT.getOrder(self.tree)), (b, k, v) => set(k, f(k, v))(b)));
/**

@@ -232,0 +232,0 @@ * @since 1.0.0

/**
* @since 1.0.0
*/
import type { Sortable } from "@fp-ts/core/Sortable";
import type { Order } from "@fp-ts/core/typeclass/Order";
import * as Eq from "@fp-ts/data/Equal";

@@ -34,3 +34,3 @@ import type { Predicate } from "@fp-ts/data/Predicate";

*/
export declare const empty: <A>(ord: Sortable<A>) => SortedSet<A>;
export declare const empty: <A>(O: Order<A>) => SortedSet<A>;
/**

@@ -100,3 +100,3 @@ * @since 1.0.0

*/
export declare const flatMap: <B>(ord: Sortable<B>) => <A>(f: (a: A) => Iterable<B>) => (self: SortedSet<A>) => SortedSet<B>;
export declare const flatMap: <B>(O: Order<B>) => <A>(f: (a: A) => Iterable<B>) => (self: SortedSet<A>) => SortedSet<B>;
/**

@@ -106,3 +106,3 @@ * @since 1.0.0

*/
export declare const map: <B>(ord: Sortable<B>) => <A>(f: (a: A) => B) => (self: SortedSet<A>) => SortedSet<B>;
export declare const map: <B>(O: Order<B>) => <A>(f: (a: A) => B) => (self: SortedSet<A>) => SortedSet<B>;
/**

@@ -109,0 +109,0 @@ * @since 1.0.0

@@ -60,3 +60,3 @@ "use strict";

const empty = ord => new SortedSetImpl(RBT.empty(ord));
const empty = O => new SortedSetImpl(RBT.empty(O));
/**

@@ -142,3 +142,3 @@ * @since 1.0.0

const union = that => self => {
const ord = RBT.getSortable(self.keyTree);
const ord = RBT.getOrder(self.keyTree);
let out = empty(ord);

@@ -165,3 +165,3 @@

const intersection = that => self => {
const ord = RBT.getSortable(self.keyTree);
const ord = RBT.getOrder(self.keyTree);
let out = empty(ord);

@@ -230,4 +230,4 @@

const flatMap = ord => f => self => {
let out = empty(ord);
const flatMap = O => f => self => {
let out = empty(O);
(0, _Function.pipe)(self, forEach(a => {

@@ -248,4 +248,4 @@ for (const b of f(a)) {

const map = ord => f => self => {
let out = empty(ord);
const map = O => f => self => {
let out = empty(O);
(0, _Function.pipe)(self, forEach(a => {

@@ -278,3 +278,3 @@ const b = f(a);

const filter = predicate => self => {
const ord = RBT.getSortable(self.keyTree);
const ord = RBT.getOrder(self.keyTree);
let out = empty(ord);

@@ -299,3 +299,3 @@

const partition = predicate => self => {
const ord = RBT.getSortable(self.keyTree);
const ord = RBT.getOrder(self.keyTree);
let right = empty(ord);

@@ -302,0 +302,0 @@ let left = empty(ord);

/**
* @since 1.0.0
*/
import type * as monoid from "@fp-ts/core/Monoid";
import * as semigroup from "@fp-ts/core/Semigroup";
import type * as sortable from "@fp-ts/core/Sortable";
import type * as monoid from "@fp-ts/core/typeclass/Monoid";
import type * as order from "@fp-ts/core/typeclass/Order";
import * as semigroup from "@fp-ts/core/typeclass/Semigroup";
import type { Refinement } from "@fp-ts/data/Refinement";

@@ -48,6 +48,2 @@ /**

/**
* @since 1.0.0
*/
export declare const concatAll: (collection: Iterable<string>) => string;
/**
* @example

@@ -57,5 +53,5 @@ * import * as S from '@fp-ts/data/String'

*
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Sortable.compare('a')), 1)
* assert.deepStrictEqual(pipe('a', S.Order.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Order.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Order.compare('a')), 1)
*

@@ -65,3 +61,3 @@ * @category instances

*/
export declare const Sortable: sortable.Sortable<string>;
export declare const Order: order.Order<string>;
/**

@@ -68,0 +64,0 @@ * @example

@@ -6,5 +6,5 @@ "use strict";

});
exports.trimRight = exports.trimLeft = exports.trim = exports.toUpperCase = exports.toLowerCase = exports.takeRight = exports.takeLeft = exports.stripMarginWith = exports.stripMargin = exports.startsWith = exports.split = exports.slice = exports.size = exports.replace = exports.linesWithSeparators = exports.linesIterator = exports.isString = exports.isEmpty = exports.includes = exports.endsWith = exports.empty = exports.concatAll = exports.concat = exports.Sortable = exports.Semigroup = exports.Monoid = void 0;
exports.trimRight = exports.trimLeft = exports.trim = exports.toUpperCase = exports.toLowerCase = exports.takeRight = exports.takeLeft = exports.stripMarginWith = exports.stripMargin = exports.startsWith = exports.split = exports.slice = exports.size = exports.replace = exports.linesWithSeparators = exports.linesIterator = exports.isString = exports.isEmpty = exports.includes = exports.endsWith = exports.empty = exports.concat = exports.Semigroup = exports.Order = exports.Monoid = void 0;
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroup"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));

@@ -20,5 +20,2 @@ var RA = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/ReadonlyArray"));

*/
// -------------------------------------------------------------------------------------
// instances
// -------------------------------------------------------------------------------------

@@ -70,15 +67,7 @@ /**

exports.empty = empty;
const Monoid = {
combine: Semigroup.combine,
combineMany: Semigroup.combineMany,
combineAll: all => Semigroup.combineMany(all)(empty),
const Monoid = { ...Semigroup,
combineAll: collection => Semigroup.combineMany(collection)(empty),
empty
};
/**
* @since 1.0.0
*/
exports.Monoid = Monoid;
const concatAll = Monoid.combineAll;
/**
* @example

@@ -88,5 +77,5 @@ * import * as S from '@fp-ts/data/String'

*
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Sortable.compare('a')), 1)
* assert.deepStrictEqual(pipe('a', S.Order.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Order.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Order.compare('a')), 1)
*

@@ -97,9 +86,6 @@ * @category instances

exports.concatAll = concatAll;
const Sortable = {
exports.Monoid = Monoid;
const Order = {
compare: that => self => self < that ? -1 : self > that ? 1 : 0
}; // -------------------------------------------------------------------------------------
// refinements
// -------------------------------------------------------------------------------------
};
/**

@@ -116,3 +102,3 @@ * @example

exports.Sortable = Sortable;
exports.Order = Order;

@@ -119,0 +105,0 @@ const isString = u => typeof u === "string";

@@ -6,4 +6,4 @@ /**

*/
import type { FlatMap } from "@fp-ts/core/FlatMap";
import type { Kind, TypeClass, TypeLambda } from "@fp-ts/core/HKT";
import type { FlatMap } from "@fp-ts/core/typeclass/FlatMap";
import type * as O from "@fp-ts/data/Option";

@@ -17,3 +17,3 @@ import type { Predicate } from "@fp-ts/data/Predicate";

export interface FromOption<F extends TypeLambda> extends TypeClass<F> {
readonly fromOption: <A, S>(fa: O.Option<A>) => Kind<F, S, unknown, never, never, A>;
readonly fromOption: <A>(fa: O.Option<A>) => Kind<F, unknown, never, never, A>;
}

@@ -24,3 +24,3 @@ /**

*/
export declare const fromNullable: <F extends TypeLambda>(F: FromOption<F>) => <A, S>(a: A) => Kind<F, S, unknown, never, never, NonNullable<A>>;
export declare const fromNullable: <F extends TypeLambda>(F: FromOption<F>) => <A>(a: A) => Kind<F, unknown, never, never, NonNullable<A>>;
/**

@@ -31,4 +31,4 @@ * @category lifting

export declare const liftPredicate: <F extends TypeLambda>(F: FromOption<F>) => {
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): <S>(c: C) => Kind<F, S, unknown, never, never, B>;
<B_1 extends A_1, A_1 = B_1>(predicate: Predicate<A_1>): <S_1>(b: B_1) => Kind<F, S_1, unknown, never, never, B_1>;
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): (c: C) => Kind<F, unknown, never, never, B>;
<B_1 extends A_1, A_1 = B_1>(predicate: Predicate<A_1>): (b: B_1) => Kind<F, unknown, never, never, B_1>;
};

@@ -39,3 +39,3 @@ /**

*/
export declare const liftOption: <F extends TypeLambda>(F: FromOption<F>) => <A extends readonly unknown[], B>(f: (...a: A) => O.Option<B>) => <S>(...a: A) => Kind<F, S, unknown, never, never, B>;
export declare const liftOption: <F extends TypeLambda>(F: FromOption<F>) => <A extends readonly unknown[], B>(f: (...a: A) => O.Option<B>) => (...a: A) => Kind<F, unknown, never, never, B>;
/**

@@ -45,3 +45,3 @@ * @category lifting

*/
export declare const liftNullable: <F extends TypeLambda>(F: FromOption<F>) => <A extends readonly unknown[], B>(f: (...a: A) => B | null | undefined) => <S, R, O, E>(...a: A) => Kind<F, S, R, O, E, NonNullable<B>>;
export declare const liftNullable: <F extends TypeLambda>(F: FromOption<F>) => <A extends readonly unknown[], B>(f: (...a: A) => B | null | undefined) => <R, O, E>(...a: A) => Kind<F, R, O, E, NonNullable<B>>;
/**

@@ -51,3 +51,3 @@ * @category sequencing

*/
export declare const flatMapNullable: <F extends TypeLambda>(F: FromOption<F>, C: FlatMap<F>) => <A, B>(f: (a: A) => B | null | undefined) => <S, R, O, E>(self: Kind<F, S, R, O, E, A>) => Kind<F, S, R, O, E, NonNullable<B>>;
export declare const flatMapNullable: <F extends TypeLambda>(F: FromOption<F>, C: FlatMap<F>) => <A, B>(f: (a: A) => B | null | undefined) => <R, O, E>(self: Kind<F, R, O, E, A>) => Kind<F, R, O, E, NonNullable<B>>;
//# sourceMappingURL=FromOption.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc