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.9 to 0.0.10

_mjs/internal/Option.mjs

2

Boolean.d.ts

@@ -8,3 +8,3 @@ /**

import type { LazyArg } from "@fp-ts/data/Function";
import type { Refinement } from "@fp-ts/data/Refinement";
import type { Refinement } from "@fp-ts/data/Predicate";
/**

@@ -11,0 +11,0 @@ * @category refinements

@@ -8,5 +8,5 @@ /**

import * as Equal from "@fp-ts/data/Equal";
import type { NonEmptyIterable } from "@fp-ts/data/NonEmpty";
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 { Predicate, Refinement } from "@fp-ts/data/Predicate";
declare const TypeId: unique symbol;

@@ -19,3 +19,9 @@ /**

/**
* @category model
* @since 1.0.0
*/
export interface NonEmptyChunk<A> extends Chunk<A>, NonEmptyIterable<A> {
}
/**
* @since 1.0.0
* @category models

@@ -124,2 +130,8 @@ */

/**
* @category mutations
* @since 1.0.0
*/
export declare function prependAllNonEmpty<B>(that: NonEmptyChunk<B>): <A>(self: Chunk<A>) => NonEmptyChunk<A | B>;
export declare function prependAllNonEmpty<B>(that: Chunk<B>): <A>(self: NonEmptyChunk<A>) => NonEmptyChunk<A | B>;
/**
* Concatenates the two chunks

@@ -151,3 +163,6 @@ *

*/
export declare const filter: <A>(f: (a: A) => boolean) => (self: Iterable<A>) => Chunk<A>;
export declare const filter: {
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): (self: Chunk<C>) => Chunk<B>;
<B extends A, A = B>(predicate: Predicate<A>): (self: Chunk<B>) => Chunk<B>;
};
/**

@@ -173,3 +188,3 @@ * Returns a filtered and mapped subset of the elements.

*/
export declare const elem: <A>(a: A) => (self: Chunk<A>) => boolean;
export declare const elem: <B>(b: B) => <A>(self: Chunk<A>) => boolean;
/**

@@ -260,3 +275,3 @@ * Filter out optional values

*/
export declare const grouped: (n: number) => <A>(self: Chunk<A>) => Chunk<Chunk<A>>;
export declare const chunksOf: (n: number) => <A>(self: Chunk<A>) => Chunk<Chunk<A>>;
/**

@@ -291,3 +306,3 @@ * Returns the first element of this chunk if it exists.

*/
export declare const isNonEmpty: <A>(self: Chunk<A>) => boolean;
export declare const isNonEmpty: <A>(self: Chunk<A>) => self is NonEmptyChunk<A>;
/**

@@ -299,3 +314,3 @@ * Folds over the elements in this chunk from the left.

*/
export declare const reduce: <A, S>(s: S, f: (s: S, a: A) => S) => (self: Chunk<A>) => S;
export declare const reduce: <A, B>(b: B, f: (s: B, a: A) => B) => (self: Chunk<A>) => B;
/**

@@ -337,3 +352,3 @@ * Folds over the elements in this chunk from the left.

/**
* Build a chunk from a sequence of elements.
* Builds a `NonEmptyChunk` from an non-empty collection of elements.
*

@@ -343,7 +358,14 @@ * @since 1.0.0

*/
export declare const make: <Elem extends readonly any[]>(...elements: Elem) => Chunk<Elem[number]>;
export declare const make: <As extends readonly [any, ...any[]]>(...as: As) => NonEmptyChunk<As[number]>;
/**
* Builds a `NonEmptyChunk` from a single element.
*
* @since 1.0.0
* @category constructors
*/
export declare const singleton: <A>(a: A) => NonEmptyChunk<A>;
/**
* Return a Chunk of length n with element i initialized with f(i).
*
* Note. n is normalized to a non negative integer.
* **Note**. `n` is normalized to an integer >= 1.
*

@@ -353,3 +375,3 @@ * @since 1.0.0

*/
export declare const makeBy: <A>(f: (i: number) => A) => (n: number) => Chunk<A>;
export declare const makeBy: <A>(f: (i: number) => A) => (n: number) => NonEmptyChunk<A>;
/**

@@ -375,3 +397,3 @@ * Returns an effect whose success is mapped by the specified f function.

*/
export declare function mapAccum<A, B, S>(s: S, f: (s: S, a: A) => readonly [S, B]): (self: Chunk<A>) => readonly [S, Chunk<B>];
export declare function mapAccum<S, A, B>(s: S, f: (s: S, a: A) => readonly [S, B]): (self: Chunk<A>) => readonly [S, Chunk<B>];
/**

@@ -410,5 +432,5 @@ * Separate elements based on a predicate that also exposes the index of the element.

*/
export declare const separate: <A, B>(fa: Chunk<Either<A, B>>) => readonly [Chunk<A>, Chunk<B>];
export declare const separate: <A, B>(self: Chunk<Either<A, B>>) => readonly [Chunk<A>, Chunk<B>];
/**
* Build a chunk with an integer range with both min/max included.
* Create a non empty `Chunk` containing a range of integers, including both endpoints.
*

@@ -418,3 +440,3 @@ * @category constructors

*/
export declare const range: (min: number, max: number) => Chunk<number>;
export declare const range: (start: number, end: number) => NonEmptyChunk<number>;
/**

@@ -428,9 +450,2 @@ * Reverse a Chunk, creating a new Chunk.

/**
* Creates a Chunk of a single element
*
* @since 1.0.0
* @category constructors
*/
export declare const single: <A>(a: A) => Chunk<A>;
/**
* Retireves the size of the chunk

@@ -437,0 +452,0 @@ *

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

});
exports.filterMapWithIndex = exports.filterMapWhile = exports.filterMap = exports.filter = exports.every = exports.empty = exports.elem = exports.dropWhile = exports.dropRight = exports.drop = exports.dedupeAdjacent = exports.dedupe = exports.crossWith = exports.cross = exports.correspondsTo = exports.concat = exports.compact = exports.append = void 0;
exports.filterMapWithIndex = exports.filterMapWhile = exports.filterMap = exports.filter = exports.every = exports.empty = exports.elem = exports.dropWhile = exports.dropRight = exports.drop = exports.dedupeAdjacent = exports.dedupe = exports.crossWith = exports.cross = exports.correspondsTo = exports.concat = exports.compact = exports.chunksOf = exports.append = void 0;
exports.findFirst = findFirst;
exports.findFirstIndex = void 0;
exports.findLast = findLast;
exports.map = exports.makeBy = exports.make = exports.last = exports.join = exports.isNonEmpty = exports.isEmpty = exports.isChunk = exports.intersection = exports.head = exports.grouped = exports.get = exports.fromIterable = exports.forEach = exports.flatten = exports.flatMap = exports.findLastIndex = void 0;
exports.map = exports.makeBy = exports.make = exports.last = exports.join = exports.isNonEmpty = exports.isEmpty = exports.isChunk = exports.intersection = exports.head = exports.get = exports.fromIterable = exports.forEach = exports.flatten = exports.flatMap = exports.findLastIndex = void 0;
exports.mapAccum = mapAccum;
exports.unfold = exports.toReadonlyArray = exports.takeWhile = exports.takeRight = exports.take = exports.tail = exports.splitWhere = exports.splitAt = exports.split = exports.sort = exports.some = exports.size = exports.single = exports.separate = exports.reverse = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRight = exports.reduce = exports.range = exports.prepend = exports.partitionWithIndex = exports.partitionMap = exports.partition = exports.mapWithIndex = void 0;
exports.prepend = exports.partitionWithIndex = exports.partitionMap = exports.partition = exports.mapWithIndex = void 0;
exports.prependAllNonEmpty = prependAllNonEmpty;
exports.unfold = exports.toReadonlyArray = exports.takeWhile = exports.takeRight = exports.take = exports.tail = exports.splitWhere = exports.splitAt = exports.split = exports.sort = exports.some = exports.size = exports.singleton = exports.separate = exports.reverse = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRight = exports.reduce = exports.range = void 0;
exports.union = union;

@@ -285,3 +287,3 @@ exports.zipWithIndexOffset = exports.zipWithIndex = exports.zipWith = exports.zipAllWith = exports.zipAll = exports.zip = exports.unzip = exports.unsafeLast = exports.unsafeHead = exports.unsafeGet = exports.unsafeFromArray = void 0;

const get = n => self => n >= self.length ? O.none : O.some(unsafeGet(n)(self));
const get = n => self => n < 0 || n >= self.length ? O.none : O.some(unsafeGet(n)(self));
/**

@@ -585,2 +587,8 @@ * Wraps an array into a chunk without copying, unsafe on mutable arrays

};
exports.dropWhile = dropWhile;
function prependAllNonEmpty(that) {
return concat(that);
}
/**

@@ -594,4 +602,2 @@ * Concatenates the two chunks

exports.dropWhile = dropWhile;
const concat = that => self => {

@@ -783,3 +789,3 @@ if (self.backing._tag === "IEmpty") {

const elem = a => self => (0, _Function.pipe)(toReadonlyArray(self), RA.elem(a));
const elem = b => self => (0, _Function.pipe)(toReadonlyArray(self), RA.elem(b));
/**

@@ -855,3 +861,3 @@ * Filter out optional values

const findFirstIndex = f => self => RA.findIndex(f)(toReadonlyArray(self));
const findFirstIndex = f => self => RA.findFirstIndex(f)(toReadonlyArray(self));
/**

@@ -904,4 +910,3 @@ * Find the first index for which a predicate holds

exports.flatMap = flatMap;
const flatten = self => (0, _Function.pipe)(self, flatMap(_Function.identity));
const flatten = /*#__PURE__*/flatMap(_Function.identity);
/**

@@ -914,3 +919,2 @@ * Iterate over the chunk applying `f`.

exports.flatten = flatten;

@@ -929,3 +933,3 @@

const grouped = n => self => {
const chunksOf = n => self => {
const gr = [];

@@ -956,5 +960,4 @@ let current = [];

exports.grouped = grouped;
const head = self => get(0)(self);
exports.chunksOf = chunksOf;
const head = /*#__PURE__*/get(0);
/**

@@ -969,3 +972,2 @@ * Creates a Chunk of unique values that are included in all given Chunks.

exports.head = head;

@@ -1006,3 +1008,3 @@

const reduce = (s, f) => self => (0, _Function.pipe)(toReadonlyArray(self), RA.reduce(s, f));
const reduce = (b, f) => self => (0, _Function.pipe)(toReadonlyArray(self), RA.reduce(b, f));
/**

@@ -1064,3 +1066,3 @@ * Folds over the elements in this chunk from the left.

/**
* Build a chunk from a sequence of elements.
* Builds a `NonEmptyChunk` from an non-empty collection of elements.
*

@@ -1074,7 +1076,21 @@ * @since 1.0.0

const make = (...elements) => unsafeFromArray(elements);
const make = (...as) => unsafeFromArray(as);
/**
* Builds a `NonEmptyChunk` from a single element.
*
* @since 1.0.0
* @category constructors
*/
exports.make = make;
const singleton = a => new ChunkImpl({
_tag: "ISingleton",
a
});
/**
* Return a Chunk of length n with element i initialized with f(i).
*
* Note. n is normalized to a non negative integer.
* **Note**. `n` is normalized to an integer >= 1.
*

@@ -1086,5 +1102,5 @@ * @since 1.0.0

exports.make = make;
exports.singleton = singleton;
const makeBy = f => n => unsafeFromArray(RA.makeBy(f)(n));
const makeBy = f => n => make(...RA.makeBy(f)(n));
/**

@@ -1179,5 +1195,5 @@ * Returns an effect whose success is mapped by the specified f function.

const separate = fa => (0, _Function.pipe)(fa, toReadonlyArray, RA.separate, ([l, r]) => [unsafeFromArray(l), unsafeFromArray(r)]);
const separate = self => (0, _Function.pipe)(self, toReadonlyArray, RA.separate, ([l, r]) => [unsafeFromArray(l), unsafeFromArray(r)]);
/**
* Build a chunk with an integer range with both min/max included.
* Create a non empty `Chunk` containing a range of integers, including both endpoints.
*

@@ -1191,11 +1207,3 @@ * @category constructors

const range = (min, max) => {
const builder = [];
for (let i = min; i <= max; i++) {
builder.push(i);
}
return unsafeFromArray(builder);
};
const range = (start, end) => start <= end ? makeBy(i => start + i)(end - start + 1) : singleton(start);
/**

@@ -1213,16 +1221,2 @@ * Reverse a Chunk, creating a new Chunk.

/**
* Creates a Chunk of a single element
*
* @since 1.0.0
* @category constructors
*/
exports.reverse = reverse;
const single = a => new ChunkImpl({
_tag: "ISingleton",
a
});
/**
* Retireves the size of the chunk

@@ -1235,3 +1229,3 @@ *

exports.single = single;
exports.reverse = reverse;

@@ -1238,0 +1232,0 @@ const size = self => self.length;

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

readonly _S: (_: Service) => Service;
[Symbol.iterator](): Generator<Tag<Service>, Service>;
}

@@ -21,0 +22,0 @@ /**

@@ -12,3 +12,3 @@ /**

* `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.
* dictates that `Left` is used for failure and `Right` is used for success.
*

@@ -21,23 +21,19 @@ * @since 1.0.0

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 type * 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 * as semiAlternative from "@fp-ts/core/typeclass/SemiAlternative";
import * as semiApplicative from "@fp-ts/core/typeclass/SemiApplicative";
import * as semiCoproduct from "@fp-ts/core/typeclass/SemiCoproduct";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as semiProduct from "@fp-ts/core/typeclass/SemiProduct";
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 { Predicate, Refinement } from "@fp-ts/data/Predicate";
/**

@@ -72,16 +68,25 @@ * @category models

/**
* @category type lambdas
* Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias
* of this structure.
*
* @category constructors
* @since 1.0.0
*/
export interface EitherTypeLambdaFix<E> extends TypeLambda {
readonly type: Either<E, this["Out1"]>;
}
export declare const right: <A>(a: A) => Either<never, A>;
/**
* @category type lambdas
* Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this
* structure.
*
* @category constructors
* @since 1.0.0
*/
export interface ValidatedT<F extends TypeLambda, E> extends TypeLambda {
readonly type: Kind<F, this["In"], this["Out2"], E, this["Target"]>;
}
export declare const left: <E>(e: E) => Either<E, never>;
/**
* Alias of `right`.
*
* @category constructors
* @since 1.0.0
*/
export declare const of: <A>(a: A) => Either<never, A>;
/**
* Returns `true` if the specified value is an instance of `Either`, `false`

@@ -95,2 +100,16 @@ * otherwise.

/**
* Returns `true` if the either is an instance of `Left`, `false` otherwise.
*
* @category guards
* @since 1.0.0
*/
export declare const isLeft: <E, A>(self: Either<E, A>) => self is Left<E>;
/**
* Returns `true` if the either is an instance of `Right`, `false` otherwise.
*
* @category guards
* @since 1.0.0
*/
export declare const isRight: <E, A>(self: Either<E, A>) => self is Right<A>;
/**
* Returns an effect whose Right is mapped by the specified `f` function.

@@ -113,2 +132,3 @@ *

/**
* @category mapping
* @since 1.0.0

@@ -133,3 +153,3 @@ */

*/
export declare const flap: <A>(a: A) => <E, B>(fab: Either<E, (a: A) => B>) => Either<E, B>;
export declare const flap: <A>(a: A) => <E, B>(self: Either<E, (a: A) => B>) => Either<E, B>;
/**

@@ -141,3 +161,3 @@ * Maps the Right value of this effect to the specified constant value.

*/
export declare const as: <B>(b: B) => <E>(self: Either<E, unknown>) => Either<E, B>;
export declare const as: <B>(b: B) => <E, _>(self: Either<E, _>) => Either<E, B>;
/**

@@ -149,3 +169,3 @@ * Returns the effect Eithering from mapping the Right of this effect to unit.

*/
export declare const asUnit: <R, O, E, _>(self: Either<E, _>) => Either<E, void>;
export declare const asUnit: <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, {

@@ -182,14 +202,2 @@ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;

/**
* 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

@@ -214,2 +222,3 @@ * @since 1.0.0

/**
* @category sequencing
* @since 1.0.0

@@ -226,11 +235,11 @@ */

*/
export declare const flatten: <E1, E2, A>(mma: Either<E1, Either<E2, A>>) => Either<E1 | E2, A>;
export declare const flatten: <E1, E2, A>(self: 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>;
export declare const andThen: <E2, B>(that: Either<E2, B>) => <E1, _>(self: Either<E1, _>) => Either<E1 | E2, 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>;
export declare const composeKleisliArrow: <B, E2, C>(bfc: (b: B) => Either<E2, C>) => <A, E1>(afb: (a: A) => Either<E1, B>) => (a: A) => Either<E1 | E2, C>;
/**

@@ -249,8 +258,2 @@ * @category instances

/**
* 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

@@ -262,3 +265,3 @@ * produced by the effect.

*/
export declare const andThenDiscard: <R2, O2, E2, _>(that: Either<E2, _>) => <R1, O1, E1, A>(self: Either<E1, A>) => Either<E2 | E1, A>;
export declare const andThenDiscard: <E2, _>(that: Either<E2, _>) => <E1, A>(self: Either<E1, A>) => Either<E1 | E2, A>;
/**

@@ -274,5 +277,6 @@ * @category instances

/**
* @category error handling
* @since 1.0.0
*/
export declare const productMany: <E, A>(collection: Iterable<Either<E, A>>) => (self: Either<E, A>) => Either<E, [A, ...A[]]>;
export declare const productMany: <E, A>(collection: Iterable<Either<E, A>>) => (self: Either<E, A>) => Either<E, readonly [A, ...A[]]>;
/**

@@ -282,3 +286,3 @@ * @category instances

*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<EitherTypeLambda>;
export declare const SemiProduct: semiProduct.SemiProduct<EitherTypeLambda>;
/**

@@ -290,3 +294,3 @@ * A variant of `bind` that sequentially ignores the scope.

*/
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, {
export declare const andThenBind: <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 N | keyof A]: K extends keyof A ? A[K] : B;

@@ -297,3 +301,3 @@ }>;

*/
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]>;
export declare const productFlatten: <E2, B>(that: Either<E2, B>) => <E1, A extends ReadonlyArray<any>>(self: Either<E1, A>) => Either<E1 | E2, readonly [...A, B]>;
/**

@@ -328,8 +332,18 @@ * @since 1.0.0

*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<EitherTypeLambda>;
export declare const SemiApplicative: semiApplicative.SemiApplicative<EitherTypeLambda>;
/**
* @category lifting
* Semigroup returning the left-most `Left` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Semigroup`.
*
* | x | y | x |> combine(y) |
* | ---------| ---------| -----------------------|
* | left(a) | left(b) | left(a) |
* | left(a) | right(2) | left(a) |
* | right(1) | left(b) | left(b) |
* | right(1) | right(2) | right(1 |> combine(2)) |
*
* @category combining
* @since 1.0.0
*/
export declare const liftSemigroup: <A>(S: Semigroup<A>) => <E>() => Semigroup<Either<E, A>>;
export declare const getFirstLeftSemigroup: <A, E>(S: Semigroup<A>) => Semigroup<Either<E, A>>;
/**

@@ -348,3 +362,3 @@ * @category lifting

*/
export declare const ap: <E2, A>(fa: Either<E2, A>) => <E1, B>(self: Either<E1, (a: A) => B>) => Either<E2 | E1, B>;
export declare const ap: <E2, A>(fa: Either<E2, A>) => <E1, B>(self: Either<E1, (a: A) => B>) => Either<E1 | E2, B>;
/**

@@ -356,98 +370,117 @@ * @category instances

/**
* Monoid returning the left-most `Left` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Monoid`.
*
* The `empty` value is `right(M.empty)`.
*
* @category combining
* @since 1.0.0
*/
export declare const liftMonoid: <A, E>(M: Monoid<A>) => Monoid<Either<E, A>>;
export declare const getFirstLeftMonoid: <A, E>(M: Monoid<A>) => Monoid<Either<E, A>>;
/**
* @category error handling
* @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>;
export declare const firstSuccessOf: <E, A>(collection: Iterable<Either<E, A>>) => (self: Either<E, A>) => Either<E, 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>;
export declare const SemiCoproduct: semiCoproduct.SemiCoproduct<EitherTypeLambda>;
/**
* Semigroup returning the left-most `Right` value.
*
* | x | y | x |> combine(y) |
* | ---------| ---------| ----------------|
* | left(a) | left(b) | left(b) |
* | left(a) | right(2) | right(2) |
* | right(1) | left(b) | right(1) |
* | right(1) | right(2) | right(1) |
*
* @category combining
* @since 1.0.0
*/
export declare const getSemigroup: <A>() => Semigroup<Either<never, A>>;
export declare const getFirstRightSemigroup: <E, A>() => Semigroup<Either<E, A>>;
/**
* Returns the wrapped value if it's a `Right` or a default value if is a `Left`.
*
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.getOrElse(0)
* ),
* 1
* )
* assert.deepStrictEqual(
* pipe(
* E.left('error'),
* E.getOrElse(0)
* ),
* 0
* )
*
* @category getters
* @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>>;
export declare const getOrElse: <B>(onLeft: B) => <E, A>(self: Either<E, A>) => B | A;
/**
* @category instances
* Recovers from all errors.
*
* @category error handling
* @since 1.0.0
*/
export declare const NonEmptyAlternative: nonEmptyAlternative.NonEmptyAlternative<EitherTypeLambda>;
export declare const catchAll: <E1, E2, B>(onLeft: (e: E1) => Either<E2, B>) => <A>(self: Either<E1, A>) => Either<E2, B | A>;
/**
* @category folding
* Executes this effect and returns its value, if it succeeds, but otherwise
* executes the specified effect.
*
* | x | y | x |> orElse(y) |
* | ---------- | ---------- | ---------------|
* | left(a) | left(b) | left(b) |
* | left(a) | right(2) | right(2) |
* | right(1) | left(b) | right(1) |
* | right(1) | right(2) | right(1) |
*
* @category error handling
* @since 1.0.0
*/
export declare const reduce: <B, A>(b: B, f: (b: B, a: A) => B) => <E>(self: Either<E, A>) => B;
export declare const orElse: <E2, B>(that: Either<E2, B>) => <E1, A>(self: Either<E1, A>) => Either<E2, B | A>;
/**
* @category folding
* Returns an effect that will produce the value of this effect, unless it
* fails, in which case, it will produce the value of the specified effect.
*
* @category error handling
* @since 1.0.0
*/
export declare const reduceRight: <B, A>(b: B, f: (b: B, a: A) => B) => <E>(self: Either<E, A>) => B;
export declare const orElseEither: <E2, B>(that: Either<E2, B>) => <E1, A>(self: Either<E1, A>) => Either<E2, Either<A, B>>;
/**
* @category instances
* Executes this effect and returns its value, if it succeeds, but otherwise
* fails with the specified error.
*
* @category error handling
* @since 1.0.0
*/
export declare const Foldable: foldable.Foldable<EitherTypeLambda>;
export declare const orElseFail: <E2>(onLeft: E2) => <E1, A>(self: Either<E1, A>) => Either<E2, A>;
/**
* @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.
* Executes this effect and returns its value, if it succeeds, but otherwise
* succeeds with the specified value.
*
* @category refinements
* @category error handling
* @since 1.0.0
*/
export declare const isLeft: <E, A>(self: Either<E, A>) => self is Left<E>;
export declare const orElseSucceed: <B>(onLeft: B) => <E, A>(self: Either<E, A>) => Either<E, B | A>;
/**
* Returns `true` if the either is an instance of `Right`, `false` otherwise.
*
* @category refinements
* @category instances
* @since 1.0.0
*/
export declare const isRight: <E, A>(self: Either<E, A>) => self is Right<A>;
export declare const SemiAlternative: semiAlternative.SemiAlternative<EitherTypeLambda>;
/**
* Constructs a new `Either` holding a `Left` value. This usually represents a Left, due to the right-bias of this
* structure.
*
* @category constructors
* @category instances
* @since 1.0.0
*/
export declare const left: <E>(e: E) => Either<E, never>;
export declare const Foldable: foldable.Foldable<EitherTypeLambda>;
/**

@@ -461,3 +494,3 @@ * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the first function,

*
* const onError = (errors: ReadonlyArray<string>): string => `Errors: ${errors.join(', ')}`
* const onLeft = (errors: ReadonlyArray<string>): string => `Errors: ${errors.join(', ')}`
*

@@ -469,3 +502,3 @@ * const onRight = (value: number): string => `Ok: ${value}`

* E.right(1),
* E.match(onError , onRight)
* E.match(onLeft , onRight)
* ),

@@ -477,3 +510,3 @@ * 'Ok: 1'

* E.left(['error 1', 'error 2']),
* E.match(onError , onRight)
* E.match(onLeft , onRight)
* ),

@@ -486,30 +519,4 @@ * 'Errors: error 1, error 2'

*/
export declare const match: <E, B, A, C = B>(onError: (e: E) => B, onRight: (a: A) => C) => (self: Either<E, A>) => B | C;
export declare const match: <E, B, A, C = B>(onLeft: (e: E) => B, onRight: (a: A) => C) => (self: Either<E, A>) => B | C;
/**
* Returns the wrapped value if it's a `Right` or a default value if is a `Left`.
*
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.getOrElse(0)
* ),
* 1
* )
* assert.deepStrictEqual(
* pipe(
* E.left('error'),
* E.getOrElse(0)
* ),
* 0
* )
*
* @category error handling
* @since 1.0.0
*/
export declare const getOrElse: <B>(onError: B) => <A>(self: Either<unknown, A>) => B | A;
/**
* Takes a lazy default and a nullable value, if the value is not nully, turn it into a `Right`, if the value is nully use

@@ -541,2 +548,10 @@ * the provided default as a `Left`.

/**
* Returns a `Refinement` from a `Either` returning function.
* This function ensures that a `Refinement` definition is type-safe.
*
* @category conversions
* @since 1.0.0
*/
export declare const toRefinement: <A, E, B extends A>(f: (a: A) => Either<E, B>) => Refinement<A, B>;
/**
* Constructs a new `Either` from a function that might throw.

@@ -562,3 +577,2 @@ *

*
* @see {@link liftThrowable}
* @category interop

@@ -569,89 +583,28 @@ * @since 1.0.0

/**
* Lifts a function that may throw to one returning a `Either`.
*
* @category interop
* @since 1.0.0
*/
export declare const liftThrowable: <A extends readonly unknown[], B, E>(f: (...a: A) => B, onThrow: (error: unknown) => E) => (...a: A) => Either<E, B>;
export declare const getOrThrow: <E>(onLeft: (e: E) => unknown) => <A>(self: Either<E, A>) => A;
/**
* @category conversions
* @since 1.0.0
*/
export declare const toUnion: <E, A>(fa: Either<E, A>) => E | A;
/**
* @since 1.0.0
*/
export declare const reverse: <E, A>(ma: Either<E, A>) => Either<A, E>;
/**
* Recovers from all errors.
* Lifts a function that may throw to one returning a `Either`.
*
* @category error handling
* @category interop
* @since 1.0.0
*/
export declare const catchAll: <E1, E2, B>(onError: (e: E1) => Either<E2, B>) => <A>(self: Either<E1, A>) => Either<E2, A | B>;
export declare const liftThrowable: <A extends readonly unknown[], B, E>(f: (...a: A) => B, onThrow: (error: unknown) => E) => (...a: A) => Either<E, B>;
/**
* Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to
* types of kind `* -> *`.
*
* In case of `Either` returns the left-most non-`Left` value (or the right-most `Left` value if both values are `Left`).
*
* | x | y | pipe(x, orElse(y) |
* | ---------- | ---------- | ------------------|
* | left(a) | left(b) | left(b) |
* | left(a) | right(2) | right(2) |
* | right(1) | left(b) | right(1) |
* | right(1) | right(2) | right(1) |
*
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.left('a'),
* E.orElse(E.left('b'))
* ),
* E.left('b')
* )
* assert.deepStrictEqual(
* pipe(
* E.left('a'),
* E.orElse(E.right(2))
* ),
* E.right(2)
* )
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.orElse(E.left('b'))
* ),
* E.right(1)
* )
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.orElse(E.right(2))
* ),
* E.right(1)
* )
*
* @category error handling
* @category getters
* @since 1.0.0
*/
export declare const orElse: <E2, B>(that: Either<E2, B>) => <E1, A>(self: Either<E1, A>) => Either<E2, A | B>;
export declare const merge: <E, A>(self: Either<E, A>) => E | A;
/**
* @category filtering
* @category mutations
* @since 1.0.0
*/
export declare const compact: <E>(onNone: E) => <A>(self: Either<E, Option<A>>) => Either<E, A>;
export declare const reverse: <E, A>(self: Either<E, A>) => Either<A, E>;
/**
* @category instances
* @since 1.0.0
*/
export declare const getCompactable: <E>(onNone: E) => compactable.Compactable<ValidatedT<EitherTypeLambda, E>>;
/**
* @category filtering
* @since 1.0.0
*/
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 compact: <E2>(onNone: E2) => <E1, A>(self: Either<E1, Option<A>>) => Either<E2 | E1, A>;
/**

@@ -662,4 +615,4 @@ * @category filtering

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>;
<C extends A, B extends A, E2, A = C>(refinement: Refinement<A, B>, onFalse: E2): <E1>(self: Either<E1, C>) => Either<E1 | E2, B>;
<B extends A, E2, A = B>(predicate: Predicate<A>, onFalse: E2): <E1>(self: Either<E1, B>) => Either<E1 | E2, B>;
};

@@ -670,16 +623,13 @@ /**

*/
export declare const filterMap: <A, B, E>(f: (a: A) => Option<B>, onNone: E) => (self: Either<E, A>) => Either<E, B>;
export declare const filterMap: <A, B, E2>(f: (a: A) => Option<B>, onNone: E2) => <E1>(self: Either<E1, A>) => Either<E2 | E1, B>;
/**
* @category filtering
* @category traversing
* @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>];
};
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>(self: Either<E, A>) => Kind<F, FR, FO, FE, Either<E, B>>;
/**
* @category filtering
* @category traversing
* @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>];
export declare const sequence: <F extends TypeLambda>(F: applicative.Applicative<F>) => <E, FR, FO, FE, A>(self: Either<E, Kind<F, FR, FO, FE, A>>) => Kind<F, FR, FO, FE, Either<E, A>>;
/**

@@ -689,3 +639,3 @@ * @category instances

*/
export declare const getFilterable: <E>(onEmpty: E) => filterable.Filterable<ValidatedT<EitherTypeLambda, E>>;
export declare const Traversable: traversable.Traversable<EitherTypeLambda>;
/**

@@ -695,26 +645,32 @@ * @category traversing

*/
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>>;
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>>;
/**
* @category traversing
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
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>>;
export declare const tap: <A, E2, _>(f: (a: A) => Either<E2, _>) => <E1>(self: Either<E1, A>) => Either<E1 | E2, A>;
/**
* @category instances
* @category debugging
* @since 1.0.0
*/
export declare const Traversable: traversable.Traversable<EitherTypeLambda>;
export declare const inspectRight: <A>(onRight: (a: A) => void) => <E>(self: Either<E, A>) => Either<E, A>;
/**
* @category traversing
* Returns an effect that effectfully "peeks" at the failure of this effect.
*
* @category error handling
* @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>) => <TE>(self: Either<TE, A>) => Kind<F, R, O, E, Either<TE, A>>;
export declare const tapError: <E1, E2, _>(onLeft: (e: E1) => Either<E2, _>) => <A>(self: Either<E1, A>) => Either<E1 | E2, A>;
/**
* Returns an effect that effectfully "peeks" at the Left of this effect.
*
* @category error handling
* @category debugging
* @since 1.0.0
*/
export declare const tapError: <E1, E2>(onError: (e: E1) => Either<E2, unknown>) => <A>(self: Either<E1, A>) => Either<E1 | E2, A>;
export declare const inspectLeft: <E>(onLeft: (e: E) => void) => <A>(self: Either<E, A>) => Either<E, A>;
/**
* @category conversions
* @since 1.0.0
*/
export declare const fromIterable: <E>(onEmpty: E) => <A>(collection: Iterable<A>) => Either<E, A>;
/**
* @example

@@ -725,16 +681,4 @@ * import * as E from '@fp-ts/data/Either'

*
* assert.deepStrictEqual(
* pipe(
* O.some(1),
* E.fromOption('error')
* ),
* E.right(1)
* )
* assert.deepStrictEqual(
* pipe(
* O.none,
* E.fromOption('error')
* ),
* E.left('error')
* )
* assert.deepStrictEqual(pipe(O.some(1), E.fromOption('error')), E.right(1))
* assert.deepStrictEqual(pipe(O.none, E.fromOption('error')), E.left('error'))
*

@@ -744,3 +688,3 @@ * @category conversions

*/
export declare const fromOption: <E>(onNone: E) => <A>(fa: Option<A>) => Either<E, A>;
export declare const fromOption: <E>(onNone: E) => <A>(self: Option<A>) => Either<E, A>;
/**

@@ -756,3 +700,3 @@ * Converts a `Either` to an `Option` discarding the Right.

*
* @category conversions
* @category getters
* @since 1.0.0

@@ -771,3 +715,3 @@ */

*
* @category conversions
* @category getters
* @since 1.0.0

@@ -777,11 +721,11 @@ */

/**
* @category conversions
* @category getters
* @since 1.0.0
*/
export declare const toNull: <E, A>(self: Either<E, A>) => A | null;
export declare const getOrNull: <E, A>(self: Either<E, A>) => A | null;
/**
* @category conversions
* @category getters
* @since 1.0.0
*/
export declare const toUndefined: <E, A>(self: Either<E, A>) => A | undefined;
export declare const getOrUndefined: <E, A>(self: Either<E, A>) => A | undefined;
/**

@@ -829,3 +773,3 @@ * @example

*/
export declare const elem: <B>(a: B) => <A, E>(ma: Either<E, A>) => boolean;
export declare const elem: <B>(b: B) => <E, A>(self: Either<E, A>) => boolean;
/**

@@ -845,3 +789,3 @@ * Returns `false` if `Left` or returns the Either of the application of the given predicate to the `Right` value.

*/
export declare const exists: <A>(predicate: Predicate<A>) => (ma: Either<unknown, A>) => boolean;
export declare const exists: <A>(predicate: Predicate<A>) => <E>(self: Either<E, A>) => boolean;
//# sourceMappingURL=Either.d.ts.map

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

});
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;
exports.unit = exports.tupled = exports.tuple = exports.traverseTap = exports.traverse = exports.toRefinement = exports.tapError = exports.tap = exports.struct = exports.sequence = exports.right = exports.reverse = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.orElseSucceed = exports.orElseFail = exports.orElseEither = exports.orElse = exports.of = exports.merge = exports.match = exports.mapLeft = 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.inspectRight = exports.inspectLeft = exports.imap = exports.getRight = exports.getOrUndefined = exports.getOrThrow = exports.getOrNull = exports.getOrElse = exports.getLeft = exports.getFirstRightSemigroup = exports.getFirstLeftSemigroup = exports.getFirstLeftMonoid = exports.fromThrowable = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.flatten = exports.flatMapOption = exports.flatMapNullable = exports.flatMap = exports.flap = exports.firstSuccessOf = exports.filterMap = exports.filter = exports.exists = exports.elem = exports.composeKleisliArrow = exports.compact = exports.catchAll = exports.bindTo = exports.bind = exports.bimap = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThenBind = exports.andThen = exports.Traversable = exports.SemiProduct = exports.SemiCoproduct = exports.SemiApplicative = exports.SemiAlternative = exports.Product = exports.Pointed = exports.Of = exports.Monad = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Do = exports.Covariant = exports.Chainable = exports.Bicovariant = exports.Applicative = void 0;

@@ -15,26 +15,18 @@ var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));

var compactable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Compactable"));
var covariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Covariant"));
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 of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var nonEmptyCoproduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyCoproduct"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var semiApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiApplicative"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var semiCoproduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiCoproduct"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var semiProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiProduct"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));

@@ -46,6 +38,6 @@

var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Common"));
var either = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Either"));
var option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Option"));
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); }

@@ -56,2 +48,29 @@

/**
* Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias
* of this structure.
*
* @category constructors
* @since 1.0.0
*/
const right = either.right;
/**
* Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this
* structure.
*
* @category constructors
* @since 1.0.0
*/
exports.right = right;
const left = either.left;
/**
* Alias of `right`.
*
* @category constructors
* @since 1.0.0
*/
exports.left = left;
const of = right;
/**
* Returns `true` if the specified value is an instance of `Either`, `false`

@@ -63,4 +82,24 @@ * otherwise.

*/
exports.of = of;
const isEither = either.isEither;
/**
* Returns `true` if the either is an instance of `Left`, `false` otherwise.
*
* @category guards
* @since 1.0.0
*/
exports.isEither = isEither;
const isLeft = either.isLeft;
/**
* Returns `true` if the either is an instance of `Right`, `false` otherwise.
*
* @category guards
* @since 1.0.0
*/
exports.isLeft = isLeft;
const isRight = either.isRight;
/**
* Returns an effect whose Right is mapped by the specified `f` function.

@@ -72,3 +111,3 @@ *

exports.isEither = isEither;
exports.isRight = isRight;

@@ -94,2 +133,3 @@ const map = f => self => isRight(self) ? right(f(self.right)) : self;

/**
* @category mapping
* @since 1.0.0

@@ -174,6 +214,3 @@ */

/**
* Constructs a new `Either` holding a `Right` value. This usually represents a Rightful value due to the right bias
* of this structure.
*
* @category constructors
* @category instances
* @since 1.0.0

@@ -183,15 +220,2 @@ */

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 = {

@@ -223,2 +247,3 @@ of

/**
* @category sequencing
* @since 1.0.0

@@ -275,10 +300,2 @@ */

/**
* 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

@@ -291,3 +308,3 @@ * produced by the effect.

exports.tap = tap;
exports.bind = bind;
const andThenDiscard = /*#__PURE__*/chainable.andThenDiscard(Chainable);

@@ -311,2 +328,3 @@ /**

/**
* @category error handling
* @since 1.0.0

@@ -342,3 +360,3 @@ */

exports.productMany = productMany;
const NonEmptyProduct = { ...Invariant,
const SemiProduct = { ...Invariant,
product,

@@ -354,4 +372,4 @@ productMany

exports.NonEmptyProduct = NonEmptyProduct;
const bindEither = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
exports.SemiProduct = SemiProduct;
const andThenBind = /*#__PURE__*/semiProduct.andThenBind(SemiProduct);
/**

@@ -361,4 +379,4 @@ * @since 1.0.0

exports.bindEither = bindEither;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
exports.andThenBind = andThenBind;
const productFlatten = /*#__PURE__*/semiProduct.productFlatten(SemiProduct);
/**

@@ -391,3 +409,3 @@ * @since 1.0.0

const Product = { ...Of,
...NonEmptyProduct,
...SemiProduct,
productAll

@@ -413,13 +431,22 @@ };

exports.struct = struct;
const NonEmptyApplicative = { ...NonEmptyProduct,
const SemiApplicative = { ...SemiProduct,
...Covariant
};
/**
* @category lifting
* Semigroup returning the left-most `Left` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Semigroup`.
*
* | x | y | x |> combine(y) |
* | ---------| ---------| -----------------------|
* | left(a) | left(b) | left(a) |
* | left(a) | right(2) | left(a) |
* | right(1) | left(b) | left(b) |
* | right(1) | right(2) | right(1 |> combine(2)) |
*
* @category combining
* @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)));
exports.SemiApplicative = SemiApplicative;
const getFirstLeftSemigroup = /*#__PURE__*/semiApplicative.liftSemigroup(SemiApplicative);
/**

@@ -430,5 +457,4 @@ * @category lifting

exports.liftSemigroup = liftSemigroup;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
exports.getFirstLeftSemigroup = getFirstLeftSemigroup;
const lift2 = /*#__PURE__*/semiApplicative.lift2(SemiApplicative);
/**

@@ -440,3 +466,3 @@ * @category lifting

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
const lift3 = /*#__PURE__*/semiApplicative.lift3(SemiApplicative);
/**

@@ -447,3 +473,3 @@ * @since 1.0.0

exports.lift3 = lift3;
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
const ap = /*#__PURE__*/semiApplicative.ap(SemiApplicative);
/**

@@ -455,6 +481,12 @@ * @category instances

exports.ap = ap;
const Applicative = { ...NonEmptyApplicative,
const Applicative = { ...SemiApplicative,
...Product
};
/**
* Monoid returning the left-most `Left` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Monoid`.
*
* The `empty` value is `right(M.empty)`.
*
* @category combining
* @since 1.0.0

@@ -464,18 +496,11 @@ */

exports.Applicative = Applicative;
const liftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
const getFirstLeftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
/**
* @category error handling
* @since 1.0.0
*/
exports.liftMonoid = liftMonoid;
exports.getFirstLeftMonoid = getFirstLeftMonoid;
const coproduct = that => self => isRight(self) ? self : that;
/**
* @since 1.0.0
*/
exports.coproduct = coproduct;
const coproductMany = collection => self => {
const firstSuccessOf = collection => self => {
let out = self;

@@ -501,38 +526,75 @@

exports.coproductMany = coproductMany;
const NonEmptyCoproduct = { ...Invariant,
coproduct,
coproductMany
exports.firstSuccessOf = firstSuccessOf;
const SemiCoproduct = { ...Invariant,
coproduct: that => self => isRight(self) ? self : that,
coproductMany: firstSuccessOf
};
/**
* Semigroup returning the left-most `Right` value.
*
* | x | y | x |> combine(y) |
* | ---------| ---------| ----------------|
* | left(a) | left(b) | left(b) |
* | left(a) | right(2) | right(2) |
* | right(1) | left(b) | right(1) |
* | right(1) | right(2) | right(1) |
*
* @category combining
* @since 1.0.0
*/
exports.NonEmptyCoproduct = NonEmptyCoproduct;
const getSemigroup = /*#__PURE__*/nonEmptyCoproduct.getSemigroup(NonEmptyCoproduct);
exports.SemiCoproduct = SemiCoproduct;
const getFirstRightSemigroup = /*#__PURE__*/semiCoproduct.getSemigroup(SemiCoproduct);
/**
* Returns the wrapped value if it's a `Right` or a default value if is a `Left`.
*
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.getOrElse(0)
* ),
* 1
* )
* assert.deepStrictEqual(
* pipe(
* E.left('error'),
* E.getOrElse(0)
* ),
* 0
* )
*
* @category getters
* @since 1.0.0
*/
exports.getSemigroup = getSemigroup;
const coproductEither = /*#__PURE__*/nonEmptyCoproduct.coproductEither(NonEmptyCoproduct);
/**
* @category instances
* @since 1.0.0
*/
exports.getFirstRightSemigroup = getFirstRightSemigroup;
exports.coproductEither = coproductEither;
const NonEmptyAlternative = { ...Covariant,
...NonEmptyCoproduct
};
const getOrElse = onLeft => self => isLeft(self) ? onLeft : self.right;
/**
* @category folding
* Recovers from all errors.
*
* @category error handling
* @since 1.0.0
*/
exports.NonEmptyAlternative = NonEmptyAlternative;
const reduce = (b, f) => self => isLeft(self) ? b : f(b, self.right);
exports.getOrElse = getOrElse;
const catchAll = onLeft => self => isLeft(self) ? onLeft(self.left) : self;
/**
* @category folding
* Executes this effect and returns its value, if it succeeds, but otherwise
* executes the specified effect.
*
* | x | y | x |> orElse(y) |
* | ---------- | ---------- | ---------------|
* | left(a) | left(b) | left(b) |
* | left(a) | right(2) | right(2) |
* | right(1) | left(b) | right(1) |
* | right(1) | right(2) | right(1) |
*
* @category error handling
* @since 1.0.0

@@ -542,7 +604,10 @@ */

exports.reduce = reduce;
exports.catchAll = catchAll;
const reduceRight = (b, f) => self => isLeft(self) ? b : f(b, self.right);
const orElse = that => self => isLeft(self) ? that : self;
/**
* @category instances
* Returns an effect that will produce the value of this effect, unless it
* fails, in which case, it will produce the value of the specified effect.
*
* @category error handling
* @since 1.0.0

@@ -552,79 +617,48 @@ */

exports.reduceRight = reduceRight;
const Foldable = {
reduce
};
/**
* @category folding
* @since 1.0.0
*/
exports.orElse = orElse;
exports.Foldable = Foldable;
const foldMap = /*#__PURE__*/foldable.foldMap(Foldable);
const orElseEither = that => self => isLeft(self) ? (0, _Function.pipe)(that, map(right)) : (0, _Function.pipe)(self, map(left));
/**
* @category conversions
* Executes this effect and returns its value, if it succeeds, but otherwise
* fails with the specified error.
*
* @category error handling
* @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.orElseEither = orElseEither;
exports.toReadonlyArrayWith = toReadonlyArrayWith;
const reduceKind = /*#__PURE__*/foldable.reduceKind(Foldable);
const orElseFail = onLeft => orElse(left(onLeft));
/**
* @category folding
* Executes this effect and returns its value, if it succeeds, but otherwise
* succeeds with the specified value.
*
* @category error handling
* @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.
*
* @category refinements
* @since 1.0.0
*/
exports.orElseFail = orElseFail;
exports.foldMapKind = foldMapKind;
const isLeft = either.isLeft;
const orElseSucceed = onLeft => orElse(right(onLeft));
/**
* Returns `true` if the either is an instance of `Right`, `false` otherwise.
*
* @category refinements
* @category instances
* @since 1.0.0
*/
exports.isLeft = isLeft;
const isRight = either.isRight;
exports.orElseSucceed = orElseSucceed;
const SemiAlternative = { ...Covariant,
...SemiCoproduct
};
/**
* Constructs a new `Either` holding a `Left` value. This usually represents a Left, due to the right-bias of this
* structure.
*
* @category constructors
* @category instances
* @since 1.0.0
*/
exports.isRight = isRight;
const left = either.left; // -------------------------------------------------------------------------------------
// pattern matching
// -------------------------------------------------------------------------------------
exports.SemiAlternative = SemiAlternative;
const Foldable = {
reduce: (b, f) => self => isLeft(self) ? b : f(b, self.right)
};
/**

@@ -638,3 +672,3 @@ * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the first function,

*
* const onError = (errors: ReadonlyArray<string>): string => `Errors: ${errors.join(', ')}`
* const onLeft = (errors: ReadonlyArray<string>): string => `Errors: ${errors.join(', ')}`
*

@@ -646,3 +680,3 @@ * const onRight = (value: number): string => `Ok: ${value}`

* E.right(1),
* E.match(onError , onRight)
* E.match(onLeft , onRight)
* ),

@@ -654,3 +688,3 @@ * 'Ok: 1'

* E.left(['error 1', 'error 2']),
* E.match(onError , onRight)
* E.match(onLeft , onRight)
* ),

@@ -664,36 +698,6 @@ * 'Errors: error 1, error 2'

exports.left = left;
exports.Foldable = Foldable;
const match = (onError, onRight) => self => isLeft(self) ? onError(self.left) : onRight(self.right);
const match = (onLeft, onRight) => self => isLeft(self) ? onLeft(self.left) : onRight(self.right);
/**
* Returns the wrapped value if it's a `Right` or a default value if is a `Left`.
*
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.getOrElse(0)
* ),
* 1
* )
* assert.deepStrictEqual(
* pipe(
* E.left('error'),
* E.getOrElse(0)
* ),
* 0
* )
*
* @category error handling
* @since 1.0.0
*/
exports.match = match;
const getOrElse = onError => self => isLeft(self) ? onError : self.right;
/**
* Takes a lazy default and a nullable value, if the value is not nully, turn it into a `Right`, if the value is nully use

@@ -715,3 +719,3 @@ * the provided default as a `Left`.

exports.getOrElse = getOrElse;
exports.match = match;
const fromNullable = either.fromNullable;

@@ -725,6 +729,3 @@ /**

const liftNullable = (f, onNullable) => {
const from = fromNullable(onNullable);
return (...a) => from(f(...a));
};
const liftNullable = (f, onNullable) => (...a) => fromNullable(onNullable)(f(...a));
/**

@@ -740,2 +741,14 @@ * @category sequencing

/**
* Returns a `Refinement` from a `Either` returning function.
* This function ensures that a `Refinement` definition is type-safe.
*
* @category conversions
* @since 1.0.0
*/
exports.flatMapNullable = flatMapNullable;
const toRefinement = f => a => isRight(f(a));
/**
* Constructs a new `Either` from a function that might throw.

@@ -761,3 +774,2 @@ *

*
* @see {@link liftThrowable}
* @category interop

@@ -768,3 +780,3 @@ * @since 1.0.0

exports.flatMapNullable = flatMapNullable;
exports.toRefinement = toRefinement;

@@ -779,4 +791,2 @@ const fromThrowable = (f, onThrow) => {

/**
* Lifts a function that may throw to one returning a `Either`.
*
* @category interop

@@ -789,22 +799,13 @@ * @since 1.0.0

const liftThrowable = (f, onThrow) => (...a) => fromThrowable(() => f(...a), onThrow);
/**
* @category conversions
* @since 1.0.0
*/
const getOrThrow = onLeft => self => {
if (isRight(self)) {
return self.right;
}
exports.liftThrowable = liftThrowable;
const toUnion = /*#__PURE__*/match(_Function.identity, _Function.identity);
throw onLeft(self.left);
};
/**
* @since 1.0.0
*/
exports.toUnion = toUnion;
const reverse = ma => isLeft(ma) ? right(ma.left) : left(ma.right);
/**
* Recovers from all errors.
* Lifts a function that may throw to one returning a `Either`.
*
* @category error handling
* @category interop
* @since 1.0.0

@@ -814,52 +815,7 @@ */

exports.reverse = reverse;
exports.getOrThrow = getOrThrow;
const catchAll = onError => self => isLeft(self) ? onError(self.left) : self;
const liftThrowable = (f, onThrow) => (...a) => fromThrowable(() => f(...a), onThrow);
/**
* Identifies an associative operation on a type constructor. It is similar to `Semigroup`, except that it applies to
* types of kind `* -> *`.
*
* In case of `Either` returns the left-most non-`Left` value (or the right-most `Left` value if both values are `Left`).
*
* | x | y | pipe(x, orElse(y) |
* | ---------- | ---------- | ------------------|
* | left(a) | left(b) | left(b) |
* | left(a) | right(2) | right(2) |
* | right(1) | left(b) | right(1) |
* | right(1) | right(2) | right(1) |
*
* @example
* import * as E from '@fp-ts/data/Either'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.deepStrictEqual(
* pipe(
* E.left('a'),
* E.orElse(E.left('b'))
* ),
* E.left('b')
* )
* assert.deepStrictEqual(
* pipe(
* E.left('a'),
* E.orElse(E.right(2))
* ),
* E.right(2)
* )
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.orElse(E.left('b'))
* ),
* E.right(1)
* )
* assert.deepStrictEqual(
* pipe(
* E.right(1),
* E.orElse(E.right(2))
* ),
* E.right(1)
* )
*
* @category error handling
* @category getters
* @since 1.0.0

@@ -869,28 +825,13 @@ */

exports.catchAll = catchAll;
const orElse = that => fa => isLeft(fa) ? that : fa;
exports.liftThrowable = liftThrowable;
const merge = /*#__PURE__*/match(_Function.identity, _Function.identity);
/**
* @category filtering
* @category mutations
* @since 1.0.0
*/
exports.merge = merge;
exports.orElse = orElse;
const compact = e => self => isLeft(self) ? self : internal.isNone(self.right) ? left(e) : right(self.right.value);
const reverse = self => isLeft(self) ? right(self.left) : left(self.right);
/**
* @category instances
* @since 1.0.0
*/
exports.compact = compact;
const getCompactable = onNone => {
return {
compact: compact(onNone)
};
};
/**
* @category filtering

@@ -901,7 +842,5 @@ * @since 1.0.0

exports.getCompactable = getCompactable;
exports.reverse = reverse;
const separate = onEmpty => compactable.separate({ ...Covariant,
...getCompactable(onEmpty)
});
const compact = onNone => self => isLeft(self) ? self : option.isNone(self.right) ? left(onNone) : right(self.right.value);
/**

@@ -913,5 +852,5 @@ * @category filtering

exports.separate = separate;
exports.compact = compact;
const filter = (predicate, onFalse) => filterable.filter(getFilterable(onFalse))(predicate);
const filter = (predicate, onFalse) => self => isLeft(self) ? self : predicate(self.right) ? self : left(onFalse);
/**

@@ -927,6 +866,6 @@ * @category filtering

const ob = f(a);
return internal.isNone(ob) ? left(onNone) : right(ob.value);
return option.isNone(ob) ? left(onNone) : right(ob.value);
}));
/**
* @category filtering
* @category traversing
* @since 1.0.0

@@ -938,5 +877,5 @@ */

const partition = (predicate, onFalse) => filterable.partition(getFilterable(onFalse))(predicate);
const traverse = F => f => self => isLeft(self) ? F.of(left(self.left)) : (0, _Function.pipe)(f(self.right), F.map(right));
/**
* @category filtering
* @category traversing
* @since 1.0.0

@@ -946,5 +885,4 @@ */

exports.partition = partition;
const partitionMap = (f, onEmpty) => filterable.partitionMap(getFilterable(onEmpty))(f);
exports.traverse = traverse;
const sequence = /*#__PURE__*/traversable.sequence(traverse);
/**

@@ -955,9 +893,6 @@ * @category instances

exports.partitionMap = partitionMap;
const getFilterable = onEmpty => {
return {
filterMap: f => filterMap(f, onEmpty)
};
exports.sequence = sequence;
const Traversable = {
traverse,
sequence
};

@@ -969,47 +904,73 @@ /**

exports.Traversable = Traversable;
const traverseTap = /*#__PURE__*/traversable.traverseTap(Traversable);
/**
* Returns an effect that effectfully "peeks" at the success of this effect.
*
* @since 1.0.0
*/
exports.getFilterable = getFilterable;
const traverse = F => f => ta => isLeft(ta) ? F.of(left(ta.left)) : (0, _Function.pipe)(f(ta.right), F.map(right));
exports.traverseTap = traverseTap;
const tap = /*#__PURE__*/chainable.tap(Chainable);
/**
* @category traversing
* @category debugging
* @since 1.0.0
*/
exports.tap = tap;
exports.traverse = traverse;
const sequence = /*#__PURE__*/traversable.sequence(traverse);
const inspectRight = onRight => self => {
if (isRight(self)) {
onRight(self.right);
}
return self;
};
/**
* @category instances
* Returns an effect that effectfully "peeks" at the failure of this effect.
*
* @category error handling
* @since 1.0.0
*/
exports.sequence = sequence;
const Traversable = {
traverse,
sequence
exports.inspectRight = inspectRight;
const tapError = onLeft => self => {
if (isRight(self)) {
return self;
}
const out = onLeft(self.left);
return isLeft(out) ? out : self;
};
/**
* @category traversing
* @category debugging
* @since 1.0.0
*/
exports.Traversable = Traversable;
const traverseTap = /*#__PURE__*/traversable.traverseTap(Traversable);
exports.tapError = tapError;
const inspectLeft = onLeft => self => {
if (isLeft(self)) {
onLeft(self.left);
}
return self;
};
/**
* Returns an effect that effectfully "peeks" at the Left of this effect.
*
* @category error handling
* @category conversions
* @since 1.0.0
*/
exports.traverseTap = traverseTap;
const tapError = onError => self => {
if (isRight(self)) {
return self;
exports.inspectLeft = inspectLeft;
const fromIterable = onEmpty => collection => {
for (const a of collection) {
return right(a);
}
const out = onError(self.left);
return isLeft(out) ? out : self;
return left(onEmpty);
};

@@ -1022,16 +983,4 @@ /**

*
* assert.deepStrictEqual(
* pipe(
* O.some(1),
* E.fromOption('error')
* ),
* E.right(1)
* )
* assert.deepStrictEqual(
* pipe(
* O.none,
* E.fromOption('error')
* ),
* E.left('error')
* )
* assert.deepStrictEqual(pipe(O.some(1), E.fromOption('error')), E.right(1))
* assert.deepStrictEqual(pipe(O.none, E.fromOption('error')), E.left('error'))
*

@@ -1043,3 +992,3 @@ * @category conversions

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

@@ -1056,3 +1005,3 @@ /**

*
* @category conversions
* @category getters
* @since 1.0.0

@@ -1073,3 +1022,3 @@ */

*
* @category conversions
* @category getters
* @since 1.0.0

@@ -1081,3 +1030,3 @@ */

/**
* @category conversions
* @category getters
* @since 1.0.0

@@ -1087,10 +1036,10 @@ */

exports.getRight = getRight;
const toNull = /*#__PURE__*/getOrElse(null);
const getOrNull = /*#__PURE__*/getOrElse(null);
/**
* @category conversions
* @category getters
* @since 1.0.0
*/
exports.toNull = toNull;
const toUndefined = /*#__PURE__*/getOrElse(undefined);
exports.getOrNull = getOrNull;
const getOrUndefined = /*#__PURE__*/getOrElse(undefined);
/**

@@ -1120,3 +1069,3 @@ * @example

exports.toUndefined = toUndefined;
exports.getOrUndefined = getOrUndefined;

@@ -1151,3 +1100,3 @@ const liftPredicate = (predicate, onFalse) => b => predicate(b) ? right(b) : left(onFalse);

const elem = a => ma => isLeft(ma) ? false : (0, _Equal.equals)(ma.right)(a);
const elem = b => self => isLeft(self) ? false : (0, _Equal.equals)(self.right)(b);
/**

@@ -1171,5 +1120,5 @@ * Returns `false` if `Left` or returns the Either of the application of the given predicate to the `Right` value.

const exists = predicate => ma => isLeft(ma) ? false : predicate(ma.right);
const exists = predicate => self => isLeft(self) ? false : predicate(self.right);
exports.exists = exists;
//# sourceMappingURL=Either.js.map

@@ -8,4 +8,3 @@ /**

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 { Predicate, Refinement } from "@fp-ts/data/Predicate";
declare const TypeId: unique symbol;

@@ -12,0 +11,0 @@ /**

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

import type { Equal } from "@fp-ts/data/Equal";
import type { Predicate } from "@fp-ts/data/Predicate";
import type { Refinement } from "@fp-ts/data/Refinement";
import type { Predicate, Refinement } from "@fp-ts/data/Predicate";
declare const TypeId: unique symbol;

@@ -9,0 +8,0 @@ /**

@@ -14,12 +14,11 @@ /**

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 * as semiAlternative from "@fp-ts/core/typeclass/SemiAlternative";
import * as semiApplicative from "@fp-ts/core/typeclass/SemiApplicative";
import type * as semiCoproduct from "@fp-ts/core/typeclass/SemiCoproduct";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as semiProduct from "@fp-ts/core/typeclass/SemiProduct";
import * as traversable from "@fp-ts/core/typeclass/Traversable";
import type { Either } from "@fp-ts/data/Either";
/**

@@ -38,4 +37,11 @@ * @category models

/**
* @category type lambdas
* @since 1.0.0
*/
export interface IdentityTypeLambdaFix<A> extends TypeLambda {
readonly type: Identity<A>;
}
/**
* @since 1.0.0
*/
export declare const map: <A, B>(f: (a: A) => B) => (self: A) => B;

@@ -184,3 +190,3 @@ /**

*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<IdentityTypeLambda>;
export declare const SemiProduct: semiProduct.SemiProduct<IdentityTypeLambda>;
/**

@@ -192,3 +198,3 @@ * A variant of `bind` that sequentially ignores the scope.

*/
export declare const bindIdentity: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: Identity<B>) => (self: Identity<A>) => Identity<{
export declare const andThenBind: <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;

@@ -225,3 +231,3 @@ }>;

*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<IdentityTypeLambda>;
export declare const SemiApplicative: semiApplicative.SemiApplicative<IdentityTypeLambda>;
/**

@@ -260,27 +266,11 @@ * @category instances

/**
* @since 1.0.0
*/
export declare const coproduct: <B>(that: Identity<B>) => <A>(self: Identity<A>) => Identity<B | A>;
/**
* @since 1.0.0
*/
export declare const coproductMany: <A>(collection: Iterable<A>) => (self: Identity<A>) => Identity<A>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyCoproduct: nonEmptyCoproduct.NonEmptyCoproduct<IdentityTypeLambda>;
export declare const getSemiCoproduct: <A>(S: Semigroup<A>) => semiCoproduct.SemiCoproduct<IdentityTypeLambdaFix<A>>;
/**
* @since 1.0.0
*/
export declare const getSemigroup: <A>() => Semigroup<Identity<A>>;
/**
* @since 1.0.0
*/
export declare const coproductEither: <B>(that: Identity<B>) => <A>(self: Identity<A>) => Identity<Either<A, B>>;
/**
* @category instances
* @since 1.0.0
*/
export declare const NonEmptyAlternative: nonEmptyAlternative.NonEmptyAlternative<IdentityTypeLambda>;
export declare const getSemiAlternative: <A>(S: Semigroup<A>) => semiAlternative.SemiAlternative<IdentityTypeLambdaFix<A>>;
/**

@@ -287,0 +277,0 @@ * @category folding

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

});
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;
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.getSemiCoproduct = exports.getSemiAlternative = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMap = exports.flap = exports.composeKleisliArrow = exports.bindTo = exports.bind = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThenBind = exports.andThen = exports.Traversable = exports.SemiProduct = exports.SemiApplicative = exports.Product = exports.Pointed = exports.Of = exports.Monad = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Do = exports.Covariant = exports.Chainable = exports.Applicative = void 0;

@@ -21,12 +21,10 @@ var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));

var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var nonEmptyCoproduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyCoproduct"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var semiApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiApplicative"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));
var semiProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiProduct"));
var product_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Product"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));

@@ -250,3 +248,3 @@

exports.productMany = productMany;
const NonEmptyProduct = { ...Invariant,
const SemiProduct = { ...Invariant,
product,

@@ -262,4 +260,4 @@ productMany

exports.NonEmptyProduct = NonEmptyProduct;
const bindIdentity = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
exports.SemiProduct = SemiProduct;
const andThenBind = /*#__PURE__*/semiProduct.andThenBind(SemiProduct);
/**

@@ -269,4 +267,4 @@ * @since 1.0.0

exports.bindIdentity = bindIdentity;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
exports.andThenBind = andThenBind;
const productFlatten = /*#__PURE__*/semiProduct.productFlatten(SemiProduct);
/**

@@ -287,3 +285,3 @@ * @since 1.0.0

const Product = { ...Of,
...NonEmptyProduct,
...SemiProduct,
productAll

@@ -309,3 +307,3 @@ };

exports.struct = struct;
const NonEmptyApplicative = { ...NonEmptyProduct,
const SemiApplicative = { ...SemiProduct,
...Covariant

@@ -318,4 +316,4 @@ };

exports.NonEmptyApplicative = NonEmptyApplicative;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
exports.SemiApplicative = SemiApplicative;
const liftSemigroup = /*#__PURE__*/semiApplicative.liftSemigroup(SemiApplicative);
/**

@@ -329,3 +327,3 @@ * Lifts a binary function into `Identity`.

exports.liftSemigroup = liftSemigroup;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
const lift2 = /*#__PURE__*/semiApplicative.lift2(SemiApplicative);
/**

@@ -339,3 +337,3 @@ * Lifts a ternary function into `Identity`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
const lift3 = /*#__PURE__*/semiApplicative.lift3(SemiApplicative);
/**

@@ -346,3 +344,3 @@ * @since 1.0.0

exports.lift3 = lift3;
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
const ap = /*#__PURE__*/semiApplicative.ap(SemiApplicative);
/**

@@ -354,3 +352,3 @@ * @category instances

exports.ap = ap;
const Applicative = { ...NonEmptyApplicative,
const Applicative = { ...SemiApplicative,
...Product

@@ -365,2 +363,3 @@ };

/**
* @category instances
* @since 1.0.0

@@ -371,12 +370,8 @@ */

const coproduct = () => _Function.identity;
const getSemiCoproduct = S => ({
imap: Invariant.imap,
coproduct: S.combine,
coproductMany: S.combineMany
});
/**
* @since 1.0.0
*/
exports.coproduct = coproduct;
const coproductMany = () => _Function.identity;
/**
* @category instances

@@ -387,35 +382,15 @@ * @since 1.0.0

exports.coproductMany = coproductMany;
const NonEmptyCoproduct = { ...Invariant,
coproduct,
coproductMany
};
/**
* @since 1.0.0
*/
exports.getSemiCoproduct = getSemiCoproduct;
exports.NonEmptyCoproduct = NonEmptyCoproduct;
const getSemigroup = /*#__PURE__*/nonEmptyCoproduct.getSemigroup(NonEmptyCoproduct);
const getSemiAlternative = S => ({ ...getSemiCoproduct(S),
map: Covariant.map
});
/**
* @category folding
* @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.getSemiAlternative = getSemiAlternative;
exports.NonEmptyAlternative = NonEmptyAlternative;
const reduce = (b, f) => self => f(b, self);

@@ -422,0 +397,0 @@ /**

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

import * as chunk from "@fp-ts/data/Chunk";
import * as const_ from "@fp-ts/data/Const";
import * as context from "@fp-ts/data/Context";

@@ -17,3 +16,2 @@ import * as differ from "@fp-ts/data/Differ";

import * as either from "@fp-ts/data/Either";
import * as endomorphism from "@fp-ts/data/Endomorphism";
import * as equal from "@fp-ts/data/Equal";

@@ -31,2 +29,3 @@ import * as _function from "@fp-ts/data/Function";

import * as mutableRef from "@fp-ts/data/mutable/MutableRef";
import * as nonEmpty from "@fp-ts/data/NonEmpty";
import * as number from "@fp-ts/data/Number";

@@ -40,3 +39,2 @@ import * as option from "@fp-ts/data/Option";

import * as redBlackTree from "@fp-ts/data/RedBlackTree";
import * as refinement from "@fp-ts/data/Refinement";
import * as safeEval from "@fp-ts/data/SafeEval";

@@ -46,3 +44,6 @@ import * as sortedMap from "@fp-ts/data/SortedMap";

import * as string from "@fp-ts/data/String";
import * as fromOption from "@fp-ts/data/typeclasses/FromOption";
import * as these from "@fp-ts/data/These";
import * as covariantWithIndex from "@fp-ts/data/typeclass/CovariantWithIndex";
import * as filterableWithIndex from "@fp-ts/data/typeclass/FilterableWithIndex";
import * as seq from "@fp-ts/data/typeclass/Seq";
import * as weakIterableMap from "@fp-ts/data/weak/WeakIterableMap";

@@ -69,11 +70,11 @@ export {

*/
const_,
context,
/**
* @since 1.0.0
*/
context,
contextPatch,
/**
* @since 1.0.0
*/
contextPatch,
covariantWithIndex,
/**

@@ -94,6 +95,2 @@ * @since 1.0.0

*/
endomorphism,
/**
* @since 1.0.0
*/
equal,

@@ -103,3 +100,3 @@ /**

*/
fromOption,
filterableWithIndex,
/**

@@ -156,2 +153,6 @@ * @since 1.0.0

*/
nonEmpty,
/**
* @since 1.0.0
*/
number,

@@ -193,7 +194,7 @@ /**

*/
refinement,
safeEval,
/**
* @since 1.0.0
*/
safeEval,
seq,
/**

@@ -214,3 +215,7 @@ * @since 1.0.0

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

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

});
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.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;
exports.weakIterableMap = exports.these = exports.string = exports.sortedSet = exports.sortedMap = exports.seq = exports.safeEval = exports.redBlackTree = exports.readonlyArray = exports.random = exports.queue = exports.predicate = exports.ordering = exports.orPatch = exports.option = exports.number = exports.nonEmpty = 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.filterableWithIndex = exports.equal = exports.either = exports.duration = exports.differ = exports.covariantWithIndex = exports.contextPatch = exports.context = exports.chunkPatch = exports.chunk = exports.boolean = void 0;

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

var const_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Const"));
exports.const_ = const_;
var context = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Context"));

@@ -58,6 +54,2 @@

var endomorphism = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Endomorphism"));
exports.endomorphism = endomorphism;
var equal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Equal"));

@@ -111,2 +103,6 @@

var nonEmpty = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/NonEmpty"));
exports.nonEmpty = nonEmpty;
var number = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Number"));

@@ -144,6 +140,2 @@

var refinement = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Refinement"));
exports.refinement = refinement;
var safeEval = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/SafeEval"));

@@ -165,6 +157,18 @@

var fromOption = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/FromOption"));
var these = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/These"));
exports.fromOption = fromOption;
exports.these = these;
var covariantWithIndex = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclass/CovariantWithIndex"));
exports.covariantWithIndex = covariantWithIndex;
var filterableWithIndex = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclass/FilterableWithIndex"));
exports.filterableWithIndex = filterableWithIndex;
var seq = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclass/Seq"));
exports.seq = seq;
var weakIterableMap = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/weak/WeakIterableMap"));

@@ -171,0 +175,0 @@

@@ -6,43 +6,4 @@ "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.fromIterable = exports.empty = exports.Do = void 0;
exports.toNonEmptyArray = exports.tail = exports.isNonEmpty = exports.head = exports.has = exports.fromNonEmptyReadonlyArray = exports.fromIterable = exports.empty = exports.Do = void 0;
// -------------------------------------------------------------------------------------
// Option
// -------------------------------------------------------------------------------------
/** @internal */
const isOption = u => typeof u === "object" && u != null && "_tag" in u && (u["_tag"] === "None" || u["_tag"] === "Some");
/** @internal */
exports.isOption = isOption;
const isNone = fa => fa._tag === "None";
/** @internal */
exports.isNone = isNone;
const isSome = fa => fa._tag === "Some";
/** @internal */
exports.isSome = isSome;
const none = {
_tag: "None"
};
/** @internal */
exports.none = none;
const some = a => ({
_tag: "Some",
value: a
});
/** @internal */
exports.some = some;
const fromNullableToOption = a => a == null ? none : some(a); // -------------------------------------------------------------------------------------
// ReadonlyArray

@@ -52,5 +13,2 @@ // -------------------------------------------------------------------------------------

/** @internal */
exports.fromNullableToOption = fromNullableToOption;
const empty = [];

@@ -57,0 +15,0 @@ /** @internal */

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

});
exports.TagTypeId = exports.TagImpl = exports.ContextTypeId = exports.ContextImpl = void 0;
exports.TagTypeId = exports.TagImpl = exports.SingleShotGen = exports.ContextTypeId = exports.ContextImpl = void 0;
exports.add = add;

@@ -47,2 +47,6 @@ exports.empty = empty;

[Symbol.iterator]() {
return new SingleShotGen(this);
}
}

@@ -53,2 +57,39 @@ /** @internal */

exports.TagImpl = TagImpl;
class SingleShotGen {
constructor(self) {
this.self = self;
this.called = false;
}
next(a) {
return this.called ? {
value: a,
done: true
} : (this.called = true, {
value: this.self,
done: false
});
}
return(a) {
return {
value: a,
done: true
};
}
throw(e) {
throw e;
}
[Symbol.iterator]() {
return new SingleShotGen(this.self);
}
}
/** @internal */
exports.SingleShotGen = SingleShotGen;
const ContextTypeId = /*#__PURE__*/Symbol.for("@fp-ts/data/Context");

@@ -55,0 +96,0 @@ /** @internal */

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

var _ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Common"));
var option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Option"));

@@ -52,3 +52,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); }

const getLeft = self => isRight(self) ? _.none : _.some(self.left);
const getLeft = self => isRight(self) ? option.none : option.some(self.left);
/** @internal */

@@ -59,3 +59,3 @@

const getRight = self => isLeft(self) ? _.none : _.some(self.right);
const getRight = self => isLeft(self) ? option.none : option.some(self.right);
/** @internal */

@@ -72,5 +72,5 @@

const fromOption = onNone => fa => _.isNone(fa) ? left(onNone) : right(fa.value);
const fromOption = onNone => fa => option.isNone(fa) ? left(onNone) : right(fa.value);
exports.fromOption = fromOption;
//# sourceMappingURL=Either.js.map

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

var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var semiProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiProduct"));

@@ -703,3 +703,3 @@ var E = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Either"));

exports.product = product;
const productMany = /*#__PURE__*/nonEmptyProduct.productMany(Covariant, product);
const productMany = /*#__PURE__*/semiProduct.productMany(Covariant, product);
/** @internal */

@@ -706,0 +706,0 @@

@@ -16,4 +16,2 @@ /**

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 * as of_ from "@fp-ts/core/typeclass/Of";

@@ -23,3 +21,5 @@ import type { Order } from "@fp-ts/core/typeclass/Order";

import * as product_ from "@fp-ts/core/typeclass/Product";
import * as semiApplicative from "@fp-ts/core/typeclass/SemiApplicative";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as semiProduct from "@fp-ts/core/typeclass/SemiProduct";
import * as traversable from "@fp-ts/core/typeclass/Traversable";

@@ -30,4 +30,3 @@ import * as traversableFilterable from "@fp-ts/core/typeclass/TraversableFilterable";

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 { Predicate, Refinement } from "@fp-ts/data/Predicate";
declare type LCons<A> = Cons<A>;

@@ -355,7 +354,7 @@ declare type LNil<A> = Nil<A>;

*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<ListTypeLambda>;
export declare const SemiProduct: semiProduct.SemiProduct<ListTypeLambda>;
/**
* @since 1.0.0
*/
export declare const bindList: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: List<B>) => (self: List<A>) => List<{
export declare const andThenBind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: List<B>) => (self: List<A>) => List<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;

@@ -392,3 +391,3 @@ }>;

*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<ListTypeLambda>;
export declare const SemiApplicative: semiApplicative.SemiApplicative<ListTypeLambda>;
/**

@@ -455,3 +454,3 @@ * @since 1.0.0

*/
export declare const compact: <A>(self: List<Option<A>>) => List<A>;
export declare const compact: <A>(self: Iterable<Option<A>>) => List<A>;
/**

@@ -469,3 +468,3 @@ * @since 1.0.0

*/
export declare const filterMap: <A, B>(f: (a: A) => Option<B>) => (self: List<A>) => List<B>;
export declare const filterMap: <A, B>(f: (a: A) => Option<B>) => (self: Iterable<A>) => List<B>;
/**

@@ -481,4 +480,4 @@ * @since 1.0.0

export declare const filter: {
<C extends A, B extends A, A = C>(refinement: (a: A) => a is B): (self: List<C>) => List<B>;
<B extends A, A = B>(predicate: (a: A) => boolean): (self: List<B>) => List<B>;
<C extends A, B extends A, A = C>(refinement: Refinement<A, B>): (self: List<C>) => List<B>;
<B extends A, A = B>(predicate: Predicate<A>): (self: List<B>) => List<B>;
};

@@ -485,0 +484,0 @@ /**

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

});
exports.unsafeTail = exports.unsafeLast = exports.unsafeHead = exports.unit = exports.tupled = exports.tuple = exports.traverseTap = exports.traversePartitionMap = exports.traversePartition = exports.traverseFilterMap = exports.traverseFilter = exports.traverse = exports.toReadonlyArrayWith = exports.toReadonlyArray = exports.tap = exports.take = exports.tail = exports.struct = exports.splitAt = exports.sort = exports.some = exports.sequence = exports.separate = exports.reverse = exports.reduceRightKind = exports.reduceRight = exports.reduceKind = exports.reduce = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.prependAll = exports.prepend = exports.partitionMap = exports.partition = exports.of = exports.nil = exports.map = exports.make = exports.liftSemigroup = exports.liftMonoid = exports.lift3 = exports.lift2 = exports.let = exports.isNil = exports.isList = exports.isCons = exports.imap = exports.head = exports.fromIterable = exports.forEach = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMap = exports.flap = exports.findFirst = exports.filterMap = exports.filter = exports.every = exports.empty = exports.drop = exports.cons = exports.concat = exports.composeKleisliArrow = exports.compact = exports.bindTo = exports.bindList = exports.bind = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThen = exports.TraversableFilterable = exports.Traversable = exports.Product = exports.Pointed = exports.Of = exports.NonEmptyProduct = exports.NonEmptyApplicative = exports.Monad = exports.List = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Filterable = exports.Do = exports.Covariant = exports.Compactable = exports.Chainable = exports.Applicative = void 0;
exports.unsafeTail = exports.unsafeLast = exports.unsafeHead = exports.unit = exports.tupled = exports.tuple = exports.traverseTap = exports.traversePartitionMap = exports.traversePartition = exports.traverseFilterMap = exports.traverseFilter = exports.traverse = exports.toReadonlyArrayWith = exports.toReadonlyArray = exports.tap = exports.take = exports.tail = exports.struct = exports.splitAt = exports.sort = exports.some = exports.sequence = exports.separate = exports.reverse = exports.reduceRightKind = exports.reduceRight = exports.reduceKind = exports.reduce = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.prependAll = exports.prepend = exports.partitionMap = exports.partition = exports.of = exports.nil = exports.map = exports.make = exports.liftSemigroup = exports.liftMonoid = exports.lift3 = exports.lift2 = exports.let = exports.isNil = exports.isList = exports.isCons = exports.imap = exports.head = exports.fromIterable = exports.forEach = exports.foldMapKind = exports.foldMap = exports.flatten = exports.flatMap = exports.flap = exports.findFirst = exports.filterMap = exports.filter = exports.every = exports.empty = exports.drop = exports.cons = exports.concat = exports.composeKleisliArrow = exports.compact = exports.bindTo = exports.bind = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThenBind = exports.andThen = exports.TraversableFilterable = exports.Traversable = exports.SemiProduct = exports.SemiApplicative = exports.Product = exports.Pointed = exports.Of = exports.Monad = exports.List = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Filterable = exports.Do = exports.Covariant = exports.Compactable = exports.Chainable = exports.Applicative = void 0;

@@ -25,6 +25,2 @@ var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));

var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));

@@ -34,2 +30,6 @@

var semiApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiApplicative"));
var semiProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiProduct"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));

@@ -428,3 +428,3 @@

exports.productMany = productMany;
const NonEmptyProduct = { ...Invariant,
const SemiProduct = { ...Invariant,
product,

@@ -437,4 +437,4 @@ productMany

exports.NonEmptyProduct = NonEmptyProduct;
const bindList = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
exports.SemiProduct = SemiProduct;
const andThenBind = /*#__PURE__*/semiProduct.andThenBind(SemiProduct);
/**

@@ -444,4 +444,4 @@ * @since 1.0.0

exports.bindList = bindList;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
exports.andThenBind = andThenBind;
const productFlatten = /*#__PURE__*/semiProduct.productFlatten(SemiProduct);
/**

@@ -459,3 +459,3 @@ * @since 1.0.0

exports.productAll = productAll;
const Product = { ...NonEmptyProduct,
const Product = { ...SemiProduct,
...Of,

@@ -482,3 +482,3 @@ productAll

exports.struct = struct;
const NonEmptyApplicative = { ...NonEmptyProduct,
const SemiApplicative = { ...SemiProduct,
...Covariant

@@ -490,4 +490,4 @@ };

exports.NonEmptyApplicative = NonEmptyApplicative;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
exports.SemiApplicative = SemiApplicative;
const liftSemigroup = /*#__PURE__*/semiApplicative.liftSemigroup(SemiApplicative);
/**

@@ -498,3 +498,3 @@ * @since 1.0.0

exports.liftSemigroup = liftSemigroup;
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
const ap = /*#__PURE__*/semiApplicative.ap(SemiApplicative);
/**

@@ -505,3 +505,3 @@ * @since 1.0.0

exports.ap = ap;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
const lift2 = /*#__PURE__*/semiApplicative.lift2(SemiApplicative);
/**

@@ -512,3 +512,3 @@ * @since 1.0.0

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
const lift3 = /*#__PURE__*/semiApplicative.lift3(SemiApplicative);
/**

@@ -520,3 +520,3 @@ * @since 1.0.0

exports.lift3 = lift3;
const Applicative = { ...NonEmptyApplicative,
const Applicative = { ...SemiApplicative,
...Product

@@ -523,0 +523,0 @@ };

@@ -9,3 +9,3 @@ /**

import type { Ordering } from "@fp-ts/data/Ordering";
import type { Refinement } from "@fp-ts/data/Refinement";
import type { Refinement } from "@fp-ts/data/Predicate";
/**

@@ -12,0 +12,0 @@ * @category refinements

@@ -24,10 +24,6 @@ /**

import * as flatMap_ from "@fp-ts/core/typeclass/FlatMap";
import * as foldable from "@fp-ts/core/typeclass/Foldable";
import type * 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";

@@ -37,8 +33,11 @@ import type { Order } from "@fp-ts/core/typeclass/Order";

import * as product_ from "@fp-ts/core/typeclass/Product";
import type * as semiAlternative from "@fp-ts/core/typeclass/SemiAlternative";
import * as semiApplicative from "@fp-ts/core/typeclass/SemiApplicative";
import * as semiCoproduct from "@fp-ts/core/typeclass/SemiCoproduct";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as semiProduct from "@fp-ts/core/typeclass/SemiProduct";
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 { Predicate } from "@fp-ts/data/Predicate";
import type { Refinement } from "@fp-ts/data/Refinement";
import type { Predicate, Refinement } from "@fp-ts/data/Predicate";
/**

@@ -72,5 +71,12 @@ * @category models

/**
* `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value.
*
* @category constructors
* @since 1.0.0
*/
export declare const none: Option<never>;
/**
* @category constructors
* @since 1.0.0
*/
export declare const some: <A>(a: A) => Option<A>;

@@ -93,2 +99,56 @@ /**

/**
* Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise
* returns the value wrapped in a `Some`.
*
* @example
* import { none, some, fromNullable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(fromNullable(undefined), none)
* assert.deepStrictEqual(fromNullable(null), none)
* assert.deepStrictEqual(fromNullable(1), some(1))
*
* @category conversions
* @since 1.0.0
*/
export declare const fromNullable: <A>(a: A) => Option<NonNullable<A>>;
/**
* Returns a `Refinement` from a `Option` returning function.
* This function ensures that a `Refinement` definition is type-safe.
*
* @category conversions
* @since 1.0.0
*/
export declare const toRefinement: <A, B extends A>(f: (a: A) => Option<B>) => Refinement<A, B>;
/**
* Converts an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a
* `Some`.
*
* @example
* import { none, some, fromThrowable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(
* fromThrowable(() => {
* throw new Error()
* }),
* none
* )
* assert.deepStrictEqual(fromThrowable(() => 1), some(1))
*
* @category interop
* @since 1.0.0
*/
export declare const fromThrowable: <A>(f: () => A) => Option<A>;
/**
* Lifts a function that may throw to one returning a `Option`.
*
* @category interop
* @since 1.0.0
*/
export declare const liftThrowable: <A extends readonly unknown[], B>(f: (...a: A) => B) => (...a: A) => Option<B>;
/**
* @category interop
* @since 1.0.0
*/
export declare const getOrThrow: (onError: unknown) => <A>(self: Option<A>) => A;
/**
* Returns an effect whose success is mapped by the specified `f` function.

@@ -155,2 +215,3 @@ *

/**
* @category constructors
* @since 1.0.0

@@ -219,2 +280,12 @@ */

/**
* @category debugging
* @since 1.0.0
*/
export declare const inspectSome: <A>(onSome: (a: A) => void) => (self: Option<A>) => Option<A>;
/**
* @category debugging
* @since 1.0.0
*/
export declare const inspectNone: (onNone: () => void) => <A>(self: Option<A>) => Option<A>;
/**
* Sequences the specified effect after this effect, but ignores the value

@@ -244,3 +315,3 @@ * produced by the effect.

*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<OptionTypeLambda>;
export declare const SemiProduct: semiProduct.SemiProduct<OptionTypeLambda>;
/**

@@ -252,3 +323,3 @@ * A variant of `bind` that sequentially ignores the scope.

*/
export declare const bindOption: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: Option<B>) => (self: Option<A>) => Option<{
export declare const andThenBind: <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;

@@ -285,3 +356,3 @@ }>;

*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<OptionTypeLambda>;
export declare const SemiApplicative: semiApplicative.SemiApplicative<OptionTypeLambda>;
/**

@@ -332,5 +403,9 @@ * Monoid returning the left-most non-`None` value. If both operands are `Some`s then the inner values are

/**
* Semigroup returning the left-most `None` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Semigroup`.
*
* @category combining
* @since 1.0.0
*/
export declare const liftSemigroup: <A>(S: Semigroup<A>) => Semigroup<Option<A>>;
export declare const getFirstNoneSemigroup: <A>(S: Semigroup<A>) => Semigroup<Option<A>>;
/**

@@ -342,5 +417,11 @@ * @category instances

/**
* Monoid returning the left-most `None` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Monoid`.
*
* The `empty` value is `some(M.empty)`.
*
* @category combining
* @since 1.0.0
*/
export declare const liftMonoid: <A>(M: Monoid<A>) => Monoid<Option<A>>;
export declare const getFirstNoneMonoid: <A>(M: Monoid<A>) => Monoid<Option<A>>;
/**

@@ -351,5 +432,6 @@ * @since 1.0.0

/**
* @category error handling
* @since 1.0.0
*/
export declare const coproductMany: <A>(collection: Iterable<Option<A>>) => (self: Option<A>) => Option<A>;
export declare const firstSomeOf: <A>(collection: Iterable<Option<A>>) => (self: Option<A>) => Option<A>;
/**

@@ -359,7 +441,10 @@ * @category instances

*/
export declare const NonEmptyCoproduct: nonEmptyCoproduct.NonEmptyCoproduct<OptionTypeLambda>;
export declare const SemiCoproduct: semiCoproduct.SemiCoproduct<OptionTypeLambda>;
/**
* Semigroup returning the left-most `Some` value.
*
* @category combining
* @since 1.0.0
*/
export declare const getSemigroup: <A>() => Semigroup<Option<A>>;
export declare const getFirstSomeSemigroup: <A>() => Semigroup<Option<A>>;
/**

@@ -386,3 +471,3 @@ * @since 1.0.0

*/
export declare const NonEmptyAlternative: nonEmptyAlternative.NonEmptyAlternative<OptionTypeLambda>;
export declare const SemiAlternative: semiAlternative.SemiAlternative<OptionTypeLambda>;
/**

@@ -394,12 +479,2 @@ * @category instances

/**
* @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

@@ -410,36 +485,8 @@ * @since 1.0.0

/**
* @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>;
/**
* Alias of `flatten`.
*
* @category filtering
* @since 1.0.0
*/
export declare const compact: <A>(foa: Option<Option<A>>) => Option<A>;
export declare const compact: <A>(self: Option<Option<A>>) => Option<A>;
/**

@@ -459,3 +506,3 @@ * @category instances

*/
export declare const filterMap: <A, B>(f: (a: A) => Option<B>) => (fa: Option<A>) => Option<B>;
export declare const filterMap: <A, B>(f: (a: A) => Option<B>) => (self: Option<A>) => Option<B>;
/**

@@ -475,15 +522,2 @@ * @category instances

/**
* @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

@@ -517,3 +551,3 @@ * @since 1.0.0

*
* @category refinements
* @category guards
* @since 1.0.0

@@ -531,3 +565,3 @@ */

*
* @category refinements
* @category guards
* @since 1.0.0

@@ -537,9 +571,2 @@ */

/**
* `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value.
*
* @category constructors
* @since 1.0.0
*/
export declare const none: Option<never>;
/**
* @category conversions

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

* some(1),
* match(() => 'a none', a => `a some containing ${a}`)
* match('a none', a => `a some containing ${a}`)
* ),

@@ -588,3 +615,3 @@ * 'a some containing 1'

* none,
* match(() => 'a none', a => `a some containing ${a}`)
* match('a none', a => `a some containing ${a}`)
* ),

@@ -597,3 +624,3 @@ * 'a none'

*/
export declare const match: <B, A, C = B>(onNone: LazyArg<B>, onSome: (a: A) => C) => (ma: Option<A>) => B | C;
export declare const match: <B, A, C = B>(onNone: B, onSome: (a: A) => C) => (self: Option<A>) => B | C;
/**

@@ -606,16 +633,4 @@ * Extracts the value out of the structure, if it exists. Otherwise returns the given default value

*
* assert.strictEqual(
* pipe(
* some(1),
* getOrElse(0)
* ),
* 1
* )
* assert.strictEqual(
* pipe(
* none,
* getOrElse(0)
* ),
* 0
* )
* assert.strictEqual(pipe(some(1), getOrElse(0)), 1)
* assert.strictEqual(pipe(none, getOrElse(0)), 0)
*

@@ -627,44 +642,2 @@ * @category error handling

/**
* Converts an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a
* `Some`.
*
* @example
* import { none, some, fromThrowable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(
* fromThrowable(() => {
* throw new Error()
* }),
* none
* )
* assert.deepStrictEqual(fromThrowable(() => 1), some(1))
*
* @category interop
* @see {@link liftThrowable}
* @since 1.0.0
*/
export declare const fromThrowable: <A>(f: () => A) => Option<A>;
/**
* Lifts a function that may throw to one returning a `Option`.
*
* @category interop
* @since 1.0.0
*/
export declare const liftThrowable: <A extends readonly unknown[], B>(f: (...a: A) => B) => (...a: A) => Option<B>;
/**
* Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise
* returns the value wrapped in a `Some`.
*
* @example
* import { none, some, fromNullable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(fromNullable(undefined), none)
* assert.deepStrictEqual(fromNullable(null), none)
* assert.deepStrictEqual(fromNullable(1), some(1))
*
* @category conversions
* @since 1.0.0
*/
export declare const fromNullable: <A>(a: A) => Option<NonNullable<A>>;
/**
* Returns a *smart constructor* from a function that returns a nullable value.

@@ -733,3 +706,3 @@ *

*/
export declare const flatMapNullable: <A, B>(f: (a: A) => B | null | undefined) => (ma: Option<A>) => Option<NonNullable<B>>;
export declare const flatMapNullable: <A, B>(f: (a: A) => B | null | undefined) => (self: Option<A>) => Option<NonNullable<B>>;
/**

@@ -739,19 +712,7 @@ * Extracts the value out of the structure, if it exists. Otherwise returns `null`.

* @example
* import { some, none, toNull } from '@fp-ts/data/Option'
* import { some, none, getOrNull } from '@fp-ts/data/Option'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.strictEqual(
* pipe(
* some(1),
* toNull
* ),
* 1
* )
* assert.strictEqual(
* pipe(
* none,
* toNull
* ),
* null
* )
* assert.strictEqual(pipe(some(1), getOrNull), 1)
* assert.strictEqual(pipe(none, getOrNull), null)
*

@@ -761,3 +722,3 @@ * @category conversions

*/
export declare const toNull: <A>(self: Option<A>) => A | null;
export declare const getOrNull: <A>(self: Option<A>) => A | null;
/**

@@ -767,19 +728,7 @@ * Extracts the value out of the structure, if it exists. Otherwise returns `undefined`.

* @example
* import { some, none, toUndefined } from '@fp-ts/data/Option'
* import { some, none, getOrUndefined } from '@fp-ts/data/Option'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.strictEqual(
* pipe(
* some(1),
* toUndefined
* ),
* 1
* )
* assert.strictEqual(
* pipe(
* none,
* toUndefined
* ),
* undefined
* )
* assert.strictEqual(pipe(some(1), getOrUndefined), 1)
* assert.strictEqual(pipe(none, getOrUndefined), undefined)
*

@@ -789,3 +738,3 @@ * @category conversions

*/
export declare const toUndefined: <A>(self: Option<A>) => A | undefined;
export declare const getOrUndefined: <A>(self: Option<A>) => A | undefined;
/**

@@ -844,3 +793,3 @@ * Lazy version of `orElse`.

*
* @category instance operations
* @category error handling
* @since 1.0.0

@@ -850,2 +799,18 @@ */

/**
* Returns an effect that will produce the value of this effect, unless it
* fails, in which case, it will produce the value of the specified effect.
*
* @category error handling
* @since 1.0.0
*/
export declare const orElseEither: <B>(that: Option<B>) => <A>(self: Option<A>) => Option<Either<A, B>>;
/**
* Executes this effect and returns its value, if it succeeds, but otherwise
* succeeds with the specified value.
*
* @category error handling
* @since 1.0.0
*/
export declare const orElseSucceed: <B>(onNone: B) => <A>(self: Option<A>) => Option<B | A>;
/**
* The `Order` instance allows `Option` values to be compared with

@@ -869,2 +834,3 @@ * `compare`, whenever there is an `Order` instance for

*
* @category sorting
* @since 1.0.0

@@ -914,3 +880,3 @@ */

*/
export declare const elem: <A>(a: A) => (ma: Option<A>) => boolean;
export declare const elem: <B>(b: B) => <A>(self: Option<A>) => boolean;
/**

@@ -947,3 +913,3 @@ * Returns `true` if the predicate is satisfied by the wrapped value

*/
export declare const exists: <A>(predicate: Predicate<A>) => (ma: Option<A>) => boolean;
export declare const exists: <A>(predicate: Predicate<A>) => (self: Option<A>) => boolean;
//# sourceMappingURL=Option.d.ts.map

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

});
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;
exports.zero = exports.unit = exports.tupled = exports.tuple = exports.traverseTap = exports.traverse = exports.toRefinement = exports.toEither = exports.tap = exports.struct = exports.some = exports.sequence = exports.separate = exports.productMany = exports.productFlatten = exports.productAll = exports.product = exports.orElseSucceed = exports.orElseEither = exports.orElse = exports.of = exports.none = exports.match = exports.map = exports.liftThrowable = exports.liftPredicate = exports.liftOrder = exports.liftNullable = exports.liftEither = exports.lift3 = exports.lift2 = exports.let = exports.isSome = exports.isOption = exports.isNone = exports.inspectSome = exports.inspectNone = exports.imap = exports.getOrUndefined = exports.getOrThrow = exports.getOrNull = exports.getOrElse = exports.getMonoid = exports.getFirstSomeSemigroup = exports.getFirstNoneSemigroup = exports.getFirstNoneMonoid = exports.fromThrowable = exports.fromNullable = exports.fromIterable = exports.fromEither = exports.flatten = exports.flatMapNullable = exports.flatMapEither = exports.flatMap = exports.flap = exports.firstSomeOf = exports.filterMap = exports.filter = exports.exists = exports.elem = exports.coproductEither = exports.coproductAll = exports.coproduct = exports.composeKleisliArrow = exports.compact = exports.catchAll = exports.bindTo = exports.bind = exports.asUnit = exports.as = exports.ap = exports.andThenDiscard = exports.andThenBind = exports.andThen = exports.Traversable = exports.SemiProduct = exports.SemiCoproduct = exports.SemiApplicative = exports.SemiAlternative = exports.Product = exports.Pointed = exports.Of = 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;

@@ -21,12 +21,4 @@ var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));

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"));

@@ -38,2 +30,8 @@

var semiApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiApplicative"));
var semiCoproduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiCoproduct"));
var semiProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiProduct"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));

@@ -49,2 +47,4 @@

var option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Option"));
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); }

@@ -55,7 +55,16 @@

/**
* `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value.
*
* @category constructors
* @since 1.0.0
*/
const some = internal.some;
const none = option.none;
/**
* @category constructors
* @since 1.0.0
*/
exports.none = none;
const some = option.some;
/**
* Returns `true` if the specified value is an instance of `Option`, `false`

@@ -76,4 +85,87 @@ * otherwise.

exports.some = some;
const isOption = internal.isOption;
const isOption = option.isOption;
/**
* Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise
* returns the value wrapped in a `Some`.
*
* @example
* import { none, some, fromNullable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(fromNullable(undefined), none)
* assert.deepStrictEqual(fromNullable(null), none)
* assert.deepStrictEqual(fromNullable(1), some(1))
*
* @category conversions
* @since 1.0.0
*/
exports.isOption = isOption;
const fromNullable = option.fromNullable;
/**
* Returns a `Refinement` from a `Option` returning function.
* This function ensures that a `Refinement` definition is type-safe.
*
* @category conversions
* @since 1.0.0
*/
exports.fromNullable = fromNullable;
const toRefinement = f => a => isSome(f(a));
/**
* Converts an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a
* `Some`.
*
* @example
* import { none, some, fromThrowable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(
* fromThrowable(() => {
* throw new Error()
* }),
* none
* )
* assert.deepStrictEqual(fromThrowable(() => 1), some(1))
*
* @category interop
* @since 1.0.0
*/
exports.toRefinement = toRefinement;
const fromThrowable = f => {
try {
return some(f());
} catch (e) {
return none;
}
};
/**
* Lifts a function that may throw to one returning a `Option`.
*
* @category interop
* @since 1.0.0
*/
exports.fromThrowable = fromThrowable;
const liftThrowable = f => (...a) => fromThrowable(() => f(...a));
/**
* @category interop
* @since 1.0.0
*/
exports.liftThrowable = liftThrowable;
const getOrThrow = onError => self => {
if (isSome(self)) {
return self.value;
}
throw onError;
};
/**
* Returns an effect whose success is mapped by the specified `f` function.

@@ -85,4 +177,5 @@ *

exports.isOption = isOption;
exports.getOrThrow = getOrThrow;
const map = f => self => isNone(self) ? none : some(f(self.value));

@@ -156,2 +249,3 @@ /**

/**
* @category constructors
* @since 1.0.0

@@ -254,2 +348,31 @@ */

/**
* @category debugging
* @since 1.0.0
*/
exports.tap = tap;
const inspectSome = onSome => self => {
if (isSome(self)) {
onSome(self.value);
}
return self;
};
/**
* @category debugging
* @since 1.0.0
*/
exports.inspectSome = inspectSome;
const inspectNone = onNone => self => {
if (isNone(self)) {
onNone();
}
return self;
};
/**
* Sequences the specified effect after this effect, but ignores the value

@@ -262,3 +385,4 @@ * produced by the effect.

exports.tap = tap;
exports.inspectNone = inspectNone;
const andThenDiscard = /*#__PURE__*/chainable.andThenDiscard(Chainable);

@@ -312,3 +436,3 @@ /**

exports.productMany = productMany;
const NonEmptyProduct = { ...Invariant,
const SemiProduct = { ...Invariant,
product,

@@ -324,4 +448,4 @@ productMany

exports.NonEmptyProduct = NonEmptyProduct;
const bindOption = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
exports.SemiProduct = SemiProduct;
const andThenBind = /*#__PURE__*/semiProduct.andThenBind(SemiProduct);
/**

@@ -331,4 +455,4 @@ * @since 1.0.0

exports.bindOption = bindOption;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
exports.andThenBind = andThenBind;
const productFlatten = /*#__PURE__*/semiProduct.productFlatten(SemiProduct);
/**

@@ -361,3 +485,3 @@ * @since 1.0.0

const Product = { ...Of,
...NonEmptyProduct,
...SemiProduct,
productAll

@@ -383,3 +507,3 @@ };

exports.struct = struct;
const NonEmptyApplicative = { ...NonEmptyProduct,
const SemiApplicative = { ...SemiProduct,
...Covariant

@@ -413,3 +537,3 @@ };

exports.NonEmptyApplicative = NonEmptyApplicative;
exports.SemiApplicative = SemiApplicative;

@@ -451,3 +575,3 @@ const getMonoid = Semigroup => {

exports.getMonoid = getMonoid;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
const lift2 = /*#__PURE__*/semiApplicative.lift2(SemiApplicative);
/**

@@ -461,3 +585,3 @@ * Lifts a ternary function into `Option`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
const lift3 = /*#__PURE__*/semiApplicative.lift3(SemiApplicative);
/**

@@ -468,4 +592,8 @@ * @since 1.0.0

exports.lift3 = lift3;
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
const ap = /*#__PURE__*/semiApplicative.ap(SemiApplicative);
/**
* Semigroup returning the left-most `None` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Semigroup`.
*
* @category combining
* @since 1.0.0

@@ -475,3 +603,3 @@ */

exports.ap = ap;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
const getFirstNoneSemigroup = /*#__PURE__*/semiApplicative.liftSemigroup(SemiApplicative);
/**

@@ -482,7 +610,13 @@ * @category instances

exports.liftSemigroup = liftSemigroup;
const Applicative = { ...NonEmptyApplicative,
exports.getFirstNoneSemigroup = getFirstNoneSemigroup;
const Applicative = { ...SemiApplicative,
...Product
};
/**
* Monoid returning the left-most `None` value. If both operands are `Right`s then the inner values
* are concatenated using the provided `Monoid`.
*
* The `empty` value is `some(M.empty)`.
*
* @category combining
* @since 1.0.0

@@ -492,3 +626,3 @@ */

exports.Applicative = Applicative;
const liftMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
const getFirstNoneMonoid = /*#__PURE__*/applicative.liftMonoid(Applicative);
/**

@@ -498,6 +632,7 @@ * @since 1.0.0

exports.liftMonoid = liftMonoid;
exports.getFirstNoneMonoid = getFirstNoneMonoid;
const coproduct = that => self => isSome(self) ? self : that;
/**
* @category error handling
* @since 1.0.0

@@ -509,3 +644,3 @@ */

const coproductMany = collection => self => {
const firstSomeOf = collection => self => {
let out = self;

@@ -531,13 +666,16 @@

exports.coproductMany = coproductMany;
const NonEmptyCoproduct = { ...Invariant,
exports.firstSomeOf = firstSomeOf;
const SemiCoproduct = { ...Invariant,
coproduct,
coproductMany
coproductMany: firstSomeOf
};
/**
* Semigroup returning the left-most `Some` value.
*
* @category combining
* @since 1.0.0
*/
exports.NonEmptyCoproduct = NonEmptyCoproduct;
const getSemigroup = /*#__PURE__*/nonEmptyCoproduct.getSemigroup(NonEmptyCoproduct);
exports.SemiCoproduct = SemiCoproduct;
const getFirstSomeSemigroup = /*#__PURE__*/semiCoproduct.getSemigroup(SemiCoproduct);
/**

@@ -547,4 +685,4 @@ * @since 1.0.0

exports.getSemigroup = getSemigroup;
const coproductEither = /*#__PURE__*/nonEmptyCoproduct.coproductEither(NonEmptyCoproduct);
exports.getFirstSomeSemigroup = getFirstSomeSemigroup;
const coproductEither = /*#__PURE__*/semiCoproduct.coproductEither(SemiCoproduct);
/**

@@ -560,3 +698,3 @@ * @since 1.0.0

if (internal.isNonEmpty(options)) {
return NonEmptyCoproduct.coproductMany(internal.tail(options))(internal.head(options));
return SemiCoproduct.coproductMany(internal.tail(options))(internal.head(options));
}

@@ -581,3 +719,3 @@

exports.zero = zero;
const Coproduct = { ...NonEmptyCoproduct,
const Coproduct = { ...SemiCoproduct,
zero,

@@ -592,4 +730,4 @@ coproductAll

exports.Coproduct = Coproduct;
const NonEmptyAlternative = { ...Covariant,
...NonEmptyCoproduct
const SemiAlternative = { ...Covariant,
...SemiCoproduct
};

@@ -601,8 +739,8 @@ /**

exports.NonEmptyAlternative = NonEmptyAlternative;
const Alternative = { ...NonEmptyAlternative,
exports.SemiAlternative = SemiAlternative;
const Alternative = { ...SemiAlternative,
...Coproduct
};
/**
* @category folding
* @category instances
* @since 1.0.0

@@ -612,25 +750,9 @@ */

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
reduce: (b, f) => self => isNone(self) ? b : f(b, self.value)
};
/**
* @category folding
* Alias of `flatten`.
*
* @category filtering
* @since 1.0.0

@@ -640,44 +762,2 @@ */

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;

@@ -709,3 +789,3 @@ /**

const filterMap = f => fa => isNone(fa) ? none : f(fa.value);
const filterMap = f => self => isNone(self) ? none : f(self.value);
/**

@@ -729,3 +809,3 @@ * @category instances

/**
* @category filtering
* @category traversing
* @since 1.0.0

@@ -735,17 +815,3 @@ */

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));

@@ -786,3 +852,3 @@ /**

*
* @category refinements
* @category guards
* @since 1.0.0

@@ -792,3 +858,3 @@ */

exports.traverseTap = traverseTap;
const isNone = internal.isNone;
const isNone = option.isNone;
/**

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

*
* @category refinements
* @category guards
* @since 1.0.0

@@ -809,7 +875,5 @@ */

exports.isNone = isNone;
const isSome = internal.isSome;
const isSome = option.isSome;
/**
* `None` doesn't have a constructor, instead you can use it directly as a value. Represents a missing value.
*
* @category constructors
* @category conversions
* @since 1.0.0

@@ -819,10 +883,3 @@ */

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

@@ -870,3 +927,3 @@ for (const a of collection) {

* some(1),
* match(() => 'a none', a => `a some containing ${a}`)
* match('a none', a => `a some containing ${a}`)
* ),

@@ -879,3 +936,3 @@ * 'a some containing 1'

* none,
* match(() => 'a none', a => `a some containing ${a}`)
* match('a none', a => `a some containing ${a}`)
* ),

@@ -891,3 +948,3 @@ * 'a none'

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

@@ -900,16 +957,4 @@ * Extracts the value out of the structure, if it exists. Otherwise returns the given default value

*
* assert.strictEqual(
* pipe(
* some(1),
* getOrElse(0)
* ),
* 1
* )
* assert.strictEqual(
* pipe(
* none,
* getOrElse(0)
* ),
* 0
* )
* assert.strictEqual(pipe(some(1), getOrElse(0)), 1)
* assert.strictEqual(pipe(none, getOrElse(0)), 0)
*

@@ -925,61 +970,2 @@ * @category error handling

/**
* Converts an exception into an `Option`. If `f` throws, returns `None`, otherwise returns the output wrapped in a
* `Some`.
*
* @example
* import { none, some, fromThrowable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(
* fromThrowable(() => {
* throw new Error()
* }),
* none
* )
* assert.deepStrictEqual(fromThrowable(() => 1), some(1))
*
* @category interop
* @see {@link liftThrowable}
* @since 1.0.0
*/
exports.getOrElse = getOrElse;
const fromThrowable = f => {
try {
return some(f());
} catch (e) {
return none;
}
};
/**
* Lifts a function that may throw to one returning a `Option`.
*
* @category interop
* @since 1.0.0
*/
exports.fromThrowable = fromThrowable;
const liftThrowable = f => (...a) => fromThrowable(() => f(...a));
/**
* Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise
* returns the value wrapped in a `Some`.
*
* @example
* import { none, some, fromNullable } from '@fp-ts/data/Option'
*
* assert.deepStrictEqual(fromNullable(undefined), none)
* assert.deepStrictEqual(fromNullable(null), none)
* assert.deepStrictEqual(fromNullable(1), some(1))
*
* @category conversions
* @since 1.0.0
*/
exports.liftThrowable = liftThrowable;
const fromNullable = internal.fromNullableToOption;
/**
* Returns a *smart constructor* from a function that returns a nullable value.

@@ -1004,4 +990,5 @@ *

exports.fromNullable = fromNullable;
exports.getOrElse = getOrElse;
const liftNullable = f => (...a) => fromNullable(f(...a));

@@ -1056,3 +1043,3 @@ /**

const flatMapNullable = f => ma => isNone(ma) ? none : fromNullable(f(ma.value));
const flatMapNullable = f => self => isNone(self) ? none : fromNullable(f(self.value));
/**

@@ -1062,19 +1049,7 @@ * Extracts the value out of the structure, if it exists. Otherwise returns `null`.

* @example
* import { some, none, toNull } from '@fp-ts/data/Option'
* import { some, none, getOrNull } from '@fp-ts/data/Option'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.strictEqual(
* pipe(
* some(1),
* toNull
* ),
* 1
* )
* assert.strictEqual(
* pipe(
* none,
* toNull
* ),
* null
* )
* assert.strictEqual(pipe(some(1), getOrNull), 1)
* assert.strictEqual(pipe(none, getOrNull), null)
*

@@ -1087,3 +1062,3 @@ * @category conversions

exports.flatMapNullable = flatMapNullable;
const toNull = /*#__PURE__*/getOrElse(null);
const getOrNull = /*#__PURE__*/getOrElse(null);
/**

@@ -1093,19 +1068,7 @@ * Extracts the value out of the structure, if it exists. Otherwise returns `undefined`.

* @example
* import { some, none, toUndefined } from '@fp-ts/data/Option'
* import { some, none, getOrUndefined } from '@fp-ts/data/Option'
* import { pipe } from '@fp-ts/data/Function'
*
* assert.strictEqual(
* pipe(
* some(1),
* toUndefined
* ),
* 1
* )
* assert.strictEqual(
* pipe(
* none,
* toUndefined
* ),
* undefined
* )
* assert.strictEqual(pipe(some(1), getOrUndefined), 1)
* assert.strictEqual(pipe(none, getOrUndefined), undefined)
*

@@ -1116,4 +1079,4 @@ * @category conversions

exports.toNull = toNull;
const toUndefined = /*#__PURE__*/getOrElse(undefined);
exports.getOrNull = getOrNull;
const getOrUndefined = /*#__PURE__*/getOrElse(undefined);
/**

@@ -1126,3 +1089,3 @@ * Lazy version of `orElse`.

exports.toUndefined = toUndefined;
exports.getOrUndefined = getOrUndefined;

@@ -1176,3 +1139,3 @@ const catchAll = that => self => isNone(self) ? that() : self;

*
* @category instance operations
* @category error handling
* @since 1.0.0

@@ -1186,2 +1149,26 @@ */

/**
* Returns an effect that will produce the value of this effect, unless it
* fails, in which case, it will produce the value of the specified effect.
*
* @category error handling
* @since 1.0.0
*/
exports.orElse = orElse;
const orElseEither = that => self => isNone(self) ? (0, _Function.pipe)(that, map(either.right)) : (0, _Function.pipe)(self, map(either.left));
/**
* Executes this effect and returns its value, if it succeeds, but otherwise
* succeeds with the specified value.
*
* @category error handling
* @since 1.0.0
*/
exports.orElseEither = orElseEither;
const orElseSucceed = onNone => orElse(some(onNone));
/**
* The `Order` instance allows `Option` values to be compared with

@@ -1205,2 +1192,3 @@ * `compare`, whenever there is an `Order` instance for

*
* @category sorting
* @since 1.0.0

@@ -1210,3 +1198,3 @@ */

exports.orElse = orElse;
exports.orElseSucceed = orElseSucceed;

@@ -1268,3 +1256,3 @@ const liftOrder = O => order.fromCompare(that => self => isSome(self) ? isSome(that) ? O.compare(that.value)(self.value) : 1 : -1);

const elem = a => ma => isNone(ma) ? false : (0, _Equal.equals)(ma.value)(a);
const elem = b => self => isNone(self) ? false : (0, _Equal.equals)(self.value)(b);
/**

@@ -1305,5 +1293,5 @@ * Returns `true` if the predicate is satisfied by the wrapped value

const exists = predicate => ma => isNone(ma) ? false : predicate(ma.value);
const exists = predicate => self => isNone(self) ? false : predicate(self.value);
exports.exists = exists;
//# sourceMappingURL=Option.js.map
{
"name": "@fp-ts/data",
"version": "0.0.9",
"version": "0.0.10",
"license": "MIT",

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

"dependencies": {
"@fp-ts/core": "^0.0.7"
"@fp-ts/core": "^0.0.8"
},

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

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

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";
import * as semiProduct from "@fp-ts/core/typeclass/SemiProduct";
/**

@@ -30,6 +30,26 @@ * @category models

*/
export interface Refinement<A, B extends A> {
(a: A): a is B;
}
/**
* @category constructors
* @since 1.0.0
*/
export declare const id: <A>() => Refinement<A, A>;
/**
* @since 1.0.0
*/
export declare const compose: <A, B extends A, C extends B>(bc: Refinement<B, C>) => (ab: Refinement<A, B>) => Refinement<A, C>;
/**
* @since 1.0.0
*/
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 imap: <A, B>(to: (a: A) => B, from: (b: B) => A) => (self: Predicate<A>) => Predicate<B>;

@@ -53,9 +73,4 @@ /**

/**
* @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>;

@@ -74,2 +89,6 @@ /**

*/
export declare const unit: Predicate<void>;
/**
* @since 1.0.0
*/
export declare const product: <B>(that: Predicate<B>) => <A>(self: Predicate<A>) => Predicate<readonly [A, B]>;

@@ -84,3 +103,3 @@ /**

*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<PredicateTypeLambda>;
export declare const SemiProduct: semiProduct.SemiProduct<PredicateTypeLambda>;
/**

@@ -98,3 +117,3 @@ * @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<{
export declare const andThenBind: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, self: Predicate<B>) => (self: Predicate<A>) => Predicate<{
readonly [K in N | keyof A]: K extends keyof A ? A[K] : B;

@@ -105,3 +124,3 @@ }>;

*/
export declare const tuple: <T extends ReadonlyArray<Predicate<any>>>(...tuple: T) => Predicate<Readonly<{
export declare const tuple: <T extends ReadonlyArray<Predicate<any>>>(...predicates: T) => Predicate<Readonly<{
[I in keyof T]: [T[I]] extends [Predicate<infer A>] ? A : never;

@@ -112,3 +131,3 @@ }>>;

*/
export declare const struct: <R extends Record<string, Predicate<any>>>(r: R) => Predicate<{
export declare const struct: <R extends Record<string, Predicate<any>>>(predicates: R) => Predicate<{
readonly [K in keyof R]: [R[K]] extends [Predicate<infer A>] ? A : never;

@@ -119,3 +138,3 @@ }>;

*/
export declare const not: <A>(predicate: Predicate<A>) => Predicate<A>;
export declare const not: <A>(self: Predicate<A>) => Predicate<A>;
/**

@@ -122,0 +141,0 @@ * @since 1.0.0

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

});
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;
exports.unit = exports.tupled = exports.tuple = exports.struct = exports.productMany = exports.productAll = exports.product = exports.or = exports.of = exports.not = exports.imap = exports.id = exports.getSemigroupAny = exports.getSemigroupAll = exports.getMonoidAny = exports.getMonoidAll = exports.contramap = exports.compose = exports.bindTo = exports.any = exports.andThenBind = exports.and = exports.all = exports.SemiProduct = exports.Product = exports.Of = exports.Invariant = exports.Do = exports.Contravariant = void 0;

@@ -13,4 +13,2 @@ var contravariant = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Contravariant"));

var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));

@@ -22,2 +20,4 @@

var semiProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiProduct"));
var _Function = /*#__PURE__*/require("@fp-ts/data/Function");

@@ -32,5 +32,6 @@

/**
* @category constructors
* @since 1.0.0
*/
const contramap = f => self => (0, _Function.flow)(f, self);
const id = () => _ => true;
/**

@@ -41,5 +42,28 @@ * @since 1.0.0

exports.id = id;
const compose = bc => ab => i => ab(i) && bc(i);
/**
* @since 1.0.0
*/
exports.compose = compose;
const contramap = f => self => b => self(f(b));
/**
* @category instances
* @since 1.0.0
*/
exports.contramap = contramap;
const imap = /*#__PURE__*/contravariant.imap(contramap);
const Contravariant = /*#__PURE__*/contravariant.make(contramap);
/**
* @since 1.0.0
*/
exports.Contravariant = Contravariant;
const imap = Contravariant.imap;
/**
* @category instances

@@ -67,3 +91,2 @@ * @since 1.0.0

/**
* @category instances
* @since 1.0.0

@@ -73,12 +96,4 @@ */

exports.bindTo = bindTo;
const Contravariant = { ...Invariant,
contramap
};
/**
* @since 1.0.0
*/
exports.Contravariant = Contravariant;
const of = _ => () => true;
const of = _ => id();
/**

@@ -105,3 +120,9 @@ * @category instances

exports.Do = Do;
const unit = /*#__PURE__*/of_.unit(Of);
/**
* @since 1.0.0
*/
exports.unit = unit;
const product = that => self => ([a, b]) => self(a) && that(b);

@@ -139,3 +160,4 @@ /**

exports.productMany = productMany;
const NonEmptyProduct = { ...Contravariant,
const SemiProduct = {
imap,
product,

@@ -148,3 +170,3 @@ productMany

exports.NonEmptyProduct = NonEmptyProduct;
exports.SemiProduct = SemiProduct;

@@ -169,4 +191,7 @@ const productAll = collection => as => {

exports.productAll = productAll;
const Product = { ...NonEmptyProduct,
...Of,
const Product = {
imap,
product,
productMany,
of,
productAll

@@ -179,3 +204,3 @@ };

exports.Product = Product;
const bindPredicate = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
const andThenBind = /*#__PURE__*/semiProduct.andThenBind(SemiProduct);
/**

@@ -185,3 +210,3 @@ * @since 1.0.0

exports.bindPredicate = bindPredicate;
exports.andThenBind = andThenBind;
const tuple = /*#__PURE__*/product_.tuple(Product);

@@ -200,3 +225,3 @@ /**

const not = predicate => a => !predicate(a);
const not = self => a => !self(a);
/**

@@ -240,3 +265,3 @@ * @since 1.0.0

combineMany: S.combineMany,
combineAll: all => S.combineMany(all)(_Function.constFalse),
combineAll: collection => S.combineMany(collection)(_Function.constFalse),
empty: _Function.constFalse

@@ -267,3 +292,3 @@ };

combineMany: S.combineMany,
combineAll: all => S.combineMany(all)(_Function.constTrue),
combineAll: collection => S.combineMany(collection)(_Function.constTrue),
empty: _Function.constTrue

@@ -270,0 +295,0 @@ };

@@ -7,4 +7,3 @@ /**

import type * as O from "@fp-ts/data/Option";
import type { Predicate } from "@fp-ts/data/Predicate";
import type { Refinement } from "@fp-ts/data/Refinement";
import type { Predicate, Refinement } from "@fp-ts/data/Predicate";
declare const TypeId: unique symbol;

@@ -11,0 +10,0 @@ /**

@@ -16,4 +16,2 @@ /**

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 * as of_ from "@fp-ts/core/typeclass/Of";

@@ -24,3 +22,5 @@ import * as order from "@fp-ts/core/typeclass/Order";

import type * as product_ from "@fp-ts/core/typeclass/Product";
import * as semiApplicative from "@fp-ts/core/typeclass/SemiApplicative";
import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup";
import * as semiProduct from "@fp-ts/core/typeclass/SemiProduct";
import * as traversable from "@fp-ts/core/typeclass/Traversable";

@@ -31,5 +31,3 @@ import * as traversableFilterable from "@fp-ts/core/typeclass/TraversableFilterable";

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 * as fromOption_ from "@fp-ts/data/typeclasses/FromOption";
import type { Predicate, Refinement } from "@fp-ts/data/Predicate";
/**

@@ -46,3 +44,3 @@ * @category type lambdas

*/
export declare type NonEmptyReadonlyArray<A> = readonly [A, ...ReadonlyArray<A>];
export declare type NonEmptyReadonlyArray<A> = readonly [A, ...Array<A>];
/**

@@ -203,8 +201,15 @@ * Builds a `NonEmptyReadonlyArray` from an non-empty collection of elements.

*/
export declare const head: <A>(self: readonly A[]) => Option<A>;
export declare const head: <A>(self: ReadonlyArray<A>) => Option<A>;
/**
* Gets an element unsafely, will throw on out of bounds.
*
* @since 1.0.0
* @category unsafe
*/
export declare const unsafeGet: (index: number) => <A>(self: readonly A[]) => A;
/**
* @category getters
* @since 1.0.0
*/
export declare const headNonEmpty: <A>(self: readonly [A, ...A[]]) => A;
export declare const headNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => A;
/**

@@ -318,3 +323,3 @@ * Get the last element in a `ReadonlyArray`, or `None` if the `ReadonlyArray` is empty.

*/
export declare const findIndex: <A>(predicate: Predicate<A>) => (as: readonly A[]) => Option<number>;
export declare const findFirstIndex: <A>(predicate: Predicate<A>) => (as: readonly A[]) => Option<number>;
/**

@@ -704,3 +709,3 @@ * Returns the index of the last element of the list which matches the predicate

*/
export declare const flap: <A>(a: A) => <B>(fab: ReadonlyArray<(a: A) => B>) => ReadonlyArray<B>;
export declare const flap: <A>(a: A) => <B>(self: ReadonlyArray<(a: A) => B>) => ReadonlyArray<B>;
/**

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

*/
export declare const compact: <A>(self: ReadonlyArray<Option<A>>) => ReadonlyArray<A>;
export declare const compact: <A>(self: Iterable<Option<A>>) => ReadonlyArray<A>;
/**

@@ -794,3 +799,3 @@ * @category instances

*/
export declare const separate: <A, B>(fe: ReadonlyArray<Either<A, B>>) => readonly [ReadonlyArray<A>, ReadonlyArray<B>];
export declare const separate: <A, B>(self: readonly Either<A, B>[]) => readonly [readonly A[], readonly B[]];
/**

@@ -857,3 +862,3 @@ * @category instances

*/
export declare const traverseNonEmpty: <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[]]>;
export declare const traverseNonEmpty: <F extends TypeLambda>(F: semiApplicative.SemiApplicative<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[]]>;
/**

@@ -863,3 +868,3 @@ * @category traversing

*/
export declare const traverseNonEmptyWithIndex: <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[]]>;
export declare const traverseNonEmptyWithIndex: <F extends TypeLambda>(F: semiApplicative.SemiApplicative<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[]]>;
/**

@@ -884,3 +889,3 @@ * @category traversing

*/
export declare const sequenceNonEmpty: <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[]]>;
export declare const sequenceNonEmpty: <F extends TypeLambda>(F: semiApplicative.SemiApplicative<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[]]>;
/**

@@ -902,3 +907,3 @@ * @since 1.0.0

*/
export declare const NonEmptyProduct: nonEmptyProduct.NonEmptyProduct<ReadonlyArrayTypeLambda>;
export declare const SemiProduct: semiProduct.SemiProduct<ReadonlyArrayTypeLambda>;
/**

@@ -910,3 +915,3 @@ * A variant of `bind` that sequentially ignores the scope.

*/
export declare const bindReadonlyArray: <N extends string, A extends object, B>(name: Exclude<N, keyof A>, fb: ReadonlyArray<B>) => (self: ReadonlyArray<A>) => ReadonlyArray<{
export declare const andThenBind: <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;

@@ -918,3 +923,3 @@ }>;

*/
export declare const NonEmptyApplicative: nonEmptyApplicative.NonEmptyApplicative<ReadonlyArrayTypeLambda>;
export declare const SemiApplicative: semiApplicative.SemiApplicative<ReadonlyArrayTypeLambda>;
/**

@@ -1049,7 +1054,2 @@ * @since 1.0.0

/**
* @category instances
* @since 1.0.0
*/
export declare const FromOption: fromOption_.FromOption<ReadonlyArrayTypeLambda>;
/**
* @category lifting

@@ -1066,3 +1066,3 @@ * @since 1.0.0

*/
export declare const liftOption: <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => Option<B>) => (...a: A) => ReadonlyArray<B>;
export declare const liftOption: <A extends readonly unknown[], B>(f: (...a: A) => Option<B>) => (...a: A) => readonly B[];
/**

@@ -1072,3 +1072,3 @@ * @category conversions

*/
export declare const fromNullable: <A>(a: A) => ReadonlyArray<NonNullable<A>>;
export declare const fromNullable: <A>(a: A) => readonly NonNullable<A>[];
/**

@@ -1078,3 +1078,3 @@ * @category lifting

*/
export declare const liftNullable: <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => B | null | undefined) => (...a: A) => ReadonlyArray<NonNullable<B>>;
export declare const liftNullable: <A extends readonly unknown[], B>(f: (...a: A) => B | null | undefined) => (...a: A) => readonly NonNullable<B>[];
/**

@@ -1084,3 +1084,3 @@ * @category sequencing

*/
export declare const flatMapNullable: <A, B>(f: (a: A) => B | null | undefined) => (self: ReadonlyArray<A>) => ReadonlyArray<NonNullable<B>>;
export declare const flatMapNullable: <A, B>(f: (a: A) => B | null | undefined) => (self: readonly A[]) => readonly NonNullable<B>[];
/**

@@ -1128,2 +1128,6 @@ * @category lifting

*/
export declare const join: (sep: string) => (self: ReadonlyArray<string>) => string;
/**
* @since 1.0.0
*/
export declare const productFlatten: <B>(that: ReadonlyArray<B>) => <A extends ReadonlyArray<unknown>>(self: ReadonlyArray<A>) => ReadonlyArray<readonly [...A, B]>;

@@ -1130,0 +1134,0 @@ /**

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

});
exports.appendAll = exports.append = exports.ap = 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.appendAll = exports.append = exports.ap = exports.andThenBind = exports.TraversableFilterable = exports.Traversable = exports.SemiProduct = exports.SemiApplicative = exports.Product = exports.Pointed = exports.Of = exports.Monad = exports.Invariant = exports.Foldable = exports.FlatMap = exports.Filterable = exports.Do = exports.Covariant = exports.Compactable = exports.Chainable = exports.Applicative = void 0;
exports.appendAllNonEmpty = appendAllNonEmpty;
exports.dropRight = exports.drop = exports.difference = exports.deleteAt = exports.composeKleisliArrow = exports.compact = exports.chunksOfNonEmpty = exports.chunksOf = exports.chopNonEmpty = exports.chop = exports.bindReadonlyArray = exports.bind = exports.as = void 0;
exports.dropRight = exports.drop = exports.difference = exports.deleteAt = exports.composeKleisliArrow = exports.compact = exports.chunksOfNonEmpty = exports.chunksOf = exports.chopNonEmpty = exports.chop = exports.bind = exports.as = void 0;
exports.dropWhile = dropWhile;

@@ -15,5 +15,5 @@ exports.empty = exports.elem = void 0;

exports.findFirst = findFirst;
exports.findIndex = void 0;
exports.findFirstIndex = void 0;
exports.findLast = findLast;
exports.liftSemigroup = exports.liftPredicate = exports.liftOrder = exports.liftOption = exports.liftNullable = exports.liftMonoid = exports.liftEither = exports.lift3 = exports.lift2 = exports.let = exports.lefts = exports.lastNonEmpty = exports.last = exports.isNonEmpty = exports.isEmpty = exports.intersperseNonEmpty = exports.intersperse = exports.intersection = exports.intercalateNonEmpty = exports.intercalate = exports.insertAt = exports.initNonEmpty = exports.init = exports.imap = exports.headNonEmpty = exports.head = exports.has = exports.groupBy = exports.group = exports.getUnionSemigroup = exports.getUnionMonoid = exports.getSemigroup = exports.getMonoid = exports.getIntersectionSemigroup = exports.get = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.fromEither = exports.foldMapWithIndex = exports.foldMapNonEmptyWithIndex = exports.foldMapNonEmpty = exports.foldMapKind = exports.foldMap = exports.flattenNonEmpty = exports.flatten = exports.flatMapWithIndex = exports.flatMapNullable = exports.flatMapNonEmptyWithIndex = exports.flatMapNonEmpty = exports.flatMap = exports.flap = exports.findLastIndex = void 0;
exports.liftSemigroup = exports.liftPredicate = exports.liftOrder = exports.liftOption = exports.liftNullable = exports.liftMonoid = exports.liftEither = exports.lift3 = exports.lift2 = exports.let = exports.lefts = exports.lastNonEmpty = exports.last = exports.join = exports.isNonEmpty = exports.isEmpty = exports.intersperseNonEmpty = exports.intersperse = exports.intersection = exports.intercalateNonEmpty = exports.intercalate = exports.insertAt = exports.initNonEmpty = exports.init = exports.imap = exports.headNonEmpty = exports.head = exports.has = exports.groupBy = exports.group = exports.getUnionSemigroup = exports.getUnionMonoid = exports.getSemigroup = exports.getMonoid = exports.getIntersectionSemigroup = exports.get = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.fromEither = exports.foldMapWithIndex = exports.foldMapNonEmptyWithIndex = exports.foldMapNonEmpty = exports.foldMapKind = exports.foldMap = exports.flattenNonEmpty = exports.flatten = exports.flatMapWithIndex = exports.flatMapNullable = exports.flatMapNonEmptyWithIndex = exports.flatMapNonEmpty = exports.flatMap = exports.flap = exports.findLastIndex = void 0;
exports.prependAll = exports.prepend = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partition = exports.of = exports.modifyNonEmptyLast = exports.modifyNonEmptyHead = exports.modifyAt = exports.min = exports.max = exports.matchRight = exports.match = exports.mapWithIndex = exports.mapNonEmptyWithIndex = exports.mapNonEmpty = exports.map = exports.makeBy = exports.make = void 0;

@@ -27,3 +27,3 @@ exports.prependAllNonEmpty = prependAllNonEmpty;

exports.unionNonEmpty = unionNonEmpty;
exports.zipWith = exports.zipNonEmptyWith = exports.zipNonEmpty = exports.zip = exports.updateNonEmptyLast = exports.updateNonEmptyHead = exports.updateAt = exports.unzipNonEmpty = exports.unzip = exports.unprepend = exports.uniqNonEmpty = exports.uniq = void 0;
exports.zipWith = exports.zipNonEmptyWith = exports.zipNonEmpty = exports.zip = exports.updateNonEmptyLast = exports.updateNonEmptyHead = exports.updateAt = exports.unzipNonEmpty = exports.unzip = exports.unsafeGet = exports.unprepend = exports.uniqNonEmpty = exports.uniq = void 0;

@@ -42,6 +42,2 @@ var applicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Applicative"));

var nonEmptyApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyApplicative"));
var nonEmptyProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/NonEmptyProduct"));
var of_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Of"));

@@ -51,4 +47,8 @@

var semiApplicative = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiApplicative"));
var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));
var semiProduct = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/SemiProduct"));
var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Traversable"));

@@ -66,6 +66,8 @@

var option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Option"));
var string = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/String"));
var number = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Number"));
var fromOption_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/typeclasses/FromOption"));
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); }

@@ -143,3 +145,3 @@

const fromOption = o => internal.isNone(o) ? empty : [o.value];
const fromOption = o => option.isNone(o) ? empty : [o.value];
/**

@@ -305,3 +307,3 @@ * @category conversions

const get = i => self => isOutOfBound(i, self) ? internal.none : internal.some(self[i]);
const get = i => self => isOutOfBound(i, self) ? option.none : option.some(self[i]);
/**

@@ -338,4 +340,19 @@ * Produces a couple of the first element of the array, and a new array of the remaining elements, if any.

exports.unappend = unappend;
const head = /*#__PURE__*/get(0);
/**
* Gets an element unsafely, will throw on out of bounds.
*
* @since 1.0.0
* @category unsafe
*/
const head = self => isNonEmpty(self) ? internal.some(self[0]) : internal.none;
exports.head = head;
const unsafeGet = index => self => {
if (isOutOfBound(index, self)) {
throw new Error(`Index out of bounds`);
}
return self[index];
};
/**

@@ -347,5 +364,4 @@ * @category getters

exports.head = head;
const headNonEmpty = self => self[0];
exports.unsafeGet = unsafeGet;
const headNonEmpty = /*#__PURE__*/unsafeGet(0);
/**

@@ -358,6 +374,5 @@ * Get the last element in a `ReadonlyArray`, or `None` if the `ReadonlyArray` is empty.

exports.headNonEmpty = headNonEmpty;
const last = self => isNonEmpty(self) ? internal.some(lastNonEmpty(self)) : internal.none;
const last = self => isNonEmpty(self) ? option.some(lastNonEmpty(self)) : option.none;
/**

@@ -382,3 +397,3 @@ * @category getters

const tail = self => isNonEmpty(self) ? internal.some(tailNonEmpty(self)) : internal.none;
const tail = self => isNonEmpty(self) ? option.some(tailNonEmpty(self)) : option.none;
/**

@@ -403,3 +418,3 @@ * @category getters

const init = self => isNonEmpty(self) ? internal.some(initNonEmpty(self)) : internal.none;
const init = self => isNonEmpty(self) ? option.some(initNonEmpty(self)) : option.none;
/**

@@ -518,3 +533,3 @@ * Get all but the last element of a non empty array, creating a new array.

const findIndex = predicate => as => {
const findFirstIndex = predicate => as => {
const len = as.length;

@@ -524,7 +539,7 @@

if (predicate(as[i])) {
return internal.some(i);
return option.some(i);
}
}
return internal.none;
return option.none;
};

@@ -539,3 +554,3 @@ /**

exports.findIndex = findIndex;
exports.findFirstIndex = findFirstIndex;

@@ -547,7 +562,7 @@ const findLastIndex = predicate => as => {

if (predicate(as[i])) {
return internal.some(i);
return option.some(i);
}
}
return internal.none;
return option.none;
};

@@ -563,7 +578,7 @@

if (predicate(as[i])) {
return internal.some(as[i]);
return option.some(as[i]);
}
}
return internal.none;
return option.none;
};

@@ -578,7 +593,7 @@ }

if (predicate(as[i])) {
return internal.some(as[i]);
return option.some(as[i]);
}
}
return internal.none;
return option.none;
};

@@ -596,3 +611,3 @@ }

if (i < 0 || i > self.length) {
return internal.none;
return option.none;
}

@@ -603,6 +618,6 @@

out.splice(i, 0, a);
return internal.some(out);
return option.some(out);
}
return internal.some([a]);
return option.some([a]);
};

@@ -633,3 +648,3 @@ /**

if (isOutOfBound(i, self)) {
return internal.none;
return option.none;
}

@@ -641,3 +656,3 @@

out[i] = next;
return internal.some(out);
return option.some(out);
};

@@ -660,3 +675,3 @@

const deleteAt = i => self => isOutOfBound(i, self) ? internal.none : internal.some(unsafeDeleteAt(i, self));
const deleteAt = i => self => isOutOfBound(i, self) ? option.none : option.some(unsafeDeleteAt(i, self));
/**

@@ -1451,3 +1466,3 @@ * Reverse a `ReadonlyArray`, creating a new `ReadonlyArray`.

if (internal.isSome(o)) {
if (option.isSome(o)) {
out.push(o.value);

@@ -1492,7 +1507,7 @@ }

const separate = fa => {
const separate = self => {
const left = [];
const right = [];
for (const e of fa) {
for (const e of self) {
if (either.isLeft(e)) {

@@ -1531,3 +1546,3 @@ left.push(e.left);

const filterWithIndex = predicate => filterMapWithIndex((b, i) => predicate(b, i) ? internal.some(b) : internal.none);
const filterWithIndex = predicate => filterMapWithIndex((b, i) => predicate(b, i) ? option.some(b) : option.none);
/**

@@ -1682,3 +1697,3 @@ * @category filtering

exports.product = product;
const productMany = /*#__PURE__*/nonEmptyProduct.productMany(Covariant, product);
const productMany = /*#__PURE__*/semiProduct.productMany(Covariant, product);
/**

@@ -1706,3 +1721,3 @@ * @since 1.0.0

exports.productAll = productAll;
const NonEmptyProduct = { ...Invariant,
const SemiProduct = { ...Invariant,
product,

@@ -1718,4 +1733,4 @@ productMany

exports.NonEmptyProduct = NonEmptyProduct;
const bindReadonlyArray = /*#__PURE__*/nonEmptyProduct.bindKind(NonEmptyProduct);
exports.SemiProduct = SemiProduct;
const andThenBind = /*#__PURE__*/semiProduct.andThenBind(SemiProduct);
/**

@@ -1726,4 +1741,4 @@ * @category instances

exports.bindReadonlyArray = bindReadonlyArray;
const NonEmptyApplicative = { ...NonEmptyProduct,
exports.andThenBind = andThenBind;
const SemiApplicative = { ...SemiProduct,
...Covariant

@@ -1735,4 +1750,4 @@ };

exports.NonEmptyApplicative = NonEmptyApplicative;
const ap = /*#__PURE__*/nonEmptyApplicative.ap(NonEmptyApplicative);
exports.SemiApplicative = SemiApplicative;
const ap = /*#__PURE__*/semiApplicative.ap(SemiApplicative);
/**

@@ -1746,3 +1761,3 @@ * Lifts a binary function into `ReadonlyArray`.

exports.ap = ap;
const lift2 = /*#__PURE__*/nonEmptyApplicative.lift2(NonEmptyApplicative);
const lift2 = /*#__PURE__*/semiApplicative.lift2(SemiApplicative);
/**

@@ -1756,3 +1771,3 @@ * Lifts a ternary function into `ReadonlyArray`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/nonEmptyApplicative.lift3(NonEmptyApplicative);
const lift3 = /*#__PURE__*/semiApplicative.lift3(SemiApplicative);
/**

@@ -1764,3 +1779,3 @@ * @category lifting

exports.lift3 = lift3;
const liftSemigroup = /*#__PURE__*/nonEmptyApplicative.liftSemigroup(NonEmptyApplicative);
const liftSemigroup = /*#__PURE__*/semiApplicative.liftSemigroup(SemiApplicative);
/**

@@ -1773,3 +1788,3 @@ * @category instances

const Product = { ...Of,
...NonEmptyProduct,
...SemiProduct,
productAll

@@ -1783,3 +1798,3 @@ };

exports.Product = Product;
const Applicative = { ...NonEmptyApplicative,
const Applicative = { ...SemiApplicative,
...Product

@@ -1947,3 +1962,3 @@ };

/**
* @category instances
* @category lifting
* @since 1.0.0

@@ -1953,12 +1968,4 @@ */

exports.traversePartition = traversePartition;
const FromOption = {
fromOption
};
/**
* @category lifting
* @since 1.0.0
*/
exports.FromOption = FromOption;
const liftPredicate = /*#__PURE__*/fromOption_.liftPredicate(FromOption);
const liftPredicate = predicate => b => predicate(b) ? [b] : empty;
/**

@@ -1969,4 +1976,6 @@ * @category lifting

exports.liftPredicate = liftPredicate;
const liftOption = /*#__PURE__*/fromOption_.liftOption(FromOption);
const liftOption = f => (...a) => fromOption(f(...a));
/**

@@ -1977,4 +1986,6 @@ * @category conversions

exports.liftOption = liftOption;
const fromNullable = /*#__PURE__*/fromOption_.fromNullable(FromOption);
const fromNullable = a => a == null ? empty : [a];
/**

@@ -1985,4 +1996,6 @@ * @category lifting

exports.fromNullable = fromNullable;
const liftNullable = /*#__PURE__*/fromOption_.liftNullable(FromOption);
const liftNullable = f => (...a) => fromNullable(f(...a));
/**

@@ -1993,4 +2006,6 @@ * @category sequencing

exports.liftNullable = liftNullable;
const flatMapNullable = /*#__PURE__*/fromOption_.flatMapNullable(FromOption, FlatMap);
const flatMapNullable = f => self => isNonEmpty(self) ? fromNullable(f(headNonEmpty(self))) : empty;
/**

@@ -2001,2 +2016,3 @@ * @category lifting

exports.flatMapNullable = flatMapNullable;

@@ -2058,3 +2074,3 @@

exports.intercalateNonEmpty = intercalateNonEmpty;
const productFlatten = /*#__PURE__*/nonEmptyProduct.productFlatten(NonEmptyProduct);
const join = /*#__PURE__*/intercalate(string.Monoid);
/**

@@ -2064,2 +2080,8 @@ * @since 1.0.0

exports.join = join;
const productFlatten = /*#__PURE__*/semiProduct.productFlatten(SemiProduct);
/**
* @since 1.0.0
*/
exports.productFlatten = productFlatten;

@@ -2103,3 +2125,3 @@

while (internal.isSome(o = f(next))) {
while (option.isSome(o = f(next))) {
const [a, b] = o.value;

@@ -2106,0 +2128,0 @@ out.push(a);

@@ -6,4 +6,3 @@ /**

import * as Eq from "@fp-ts/data/Equal";
import type { Predicate } from "@fp-ts/data/Predicate";
import type { Refinement } from "@fp-ts/data/Refinement";
import type { Predicate, Refinement } from "@fp-ts/data/Predicate";
declare const TypeId: unique symbol;

@@ -10,0 +9,0 @@ /**

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

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";
import type * as semigroup from "@fp-ts/core/typeclass/Semigroup";
import type { Refinement } from "@fp-ts/data/Predicate";
/**

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

*/
export declare const empty = "";
export declare const empty: "";
/**

@@ -34,0 +34,0 @@ * `string` monoid under concatenation.

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

var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/typeclass/Semigroup"));
var string = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/String"));

@@ -24,3 +24,3 @@ var RA = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/ReadonlyArray"));

*/
const concat = that => self => self + that;
const concat = string.concat;
/**

@@ -39,5 +39,4 @@ * `string` semigroup under concatenation.

exports.concat = concat;
const Semigroup = /*#__PURE__*/semigroup.fromCombine(concat);
const Semigroup = string.Semigroup;
/**

@@ -50,3 +49,3 @@ * An empty `string`.

exports.Semigroup = Semigroup;
const empty = "";
const empty = string.empty;
/**

@@ -69,6 +68,3 @@ * `string` monoid under concatenation.

exports.empty = empty;
const Monoid = { ...Semigroup,
combineAll: collection => Semigroup.combineMany(collection)(empty),
empty
};
const Monoid = string.Monoid;
/**

@@ -75,0 +71,0 @@ * @example

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