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.2 to 0.0.3

_mjs/Const.mjs

8

Chunk.js

@@ -20,4 +20,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var MRef = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/mutable/MutableRef"));

@@ -128,8 +126,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return isChunk(that) && Equal.equals(toArray(this), toArray(that));
}
[Hash.symbol]() {
return Hash.evaluate(toArray(this));
[Equal.symbolHash]() {
return Equal.hash(toArray(this));
}

@@ -136,0 +134,0 @@

@@ -10,4 +10,2 @@ "use strict";

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

@@ -29,7 +27,7 @@

[Hash.symbol]() {
return Hash.evaluate(this.millis);
[Equal.symbolHash]() {
return Equal.hash(this.millis);
}
[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return isDuration(that) && this.millis === that.millis;

@@ -36,0 +34,0 @@ }

@@ -1,12 +0,11 @@

import * as DH from "@fp-ts/data/Hash";
/**
* @since 1.0.0
* @category models
* @category symbols
*/
export declare const Equal: EqualConstructor;
export declare const symbolHash: unique symbol;
/**
* @since 1.0.0
* @category symbol
* @category symbols
*/
export declare const symbol: EqualConstructor["symbol"];
export declare const symbolEqual: unique symbol;
/**

@@ -16,12 +15,11 @@ * @since 1.0.0

*/
export interface Equal extends DH.Hash {
readonly [Equal.symbol]: (that: unknown) => boolean;
export interface Equal {
[symbolEqual](that: unknown): boolean;
[symbolHash](): number;
}
/**
* @since 1.0.0
* @category models
* @category equality
*/
export interface EqualConstructor {
readonly symbol: unique symbol;
}
export declare function equals<B>(that: B): <A>(self: A) => boolean;
/**

@@ -31,8 +29,23 @@ * @since 1.0.0

*/
export declare function equals<B>(that: B): <A>(self: A) => boolean;
export declare function equals<A, B>(self: A, that: B): boolean;
/**
* @since 1.0.0
* @category equality
* @category hashing
*/
export declare function equals<A, B>(self: A, that: B): boolean;
export declare const hash: <A>(self: A) => number;
/**
* @since 1.0.0
* @category hashing
*/
export declare const hashRandom: <A extends object>(self: A) => number;
/**
* @since 1.0.0
* @category hashing
*/
export declare const hashCombine: (b: number) => (self: number) => number;
/**
* @since 1.0.0
* @category hashing
*/
export declare const hashOptimize: (n: number) => number;
//# sourceMappingURL=Equal.d.ts.map

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

});
exports.Equal = void 0;
exports.equals = equals;
exports.symbol = void 0;
exports.symbolHash = exports.symbolEqual = exports.hashRandom = exports.hashOptimize = exports.hashCombine = exports.hash = void 0;
var _Function = /*#__PURE__*/require("@fp-ts/data/Function");
var DH = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var _Random = /*#__PURE__*/require("@fp-ts/data/internal/Random");
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); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
/**

@@ -25,15 +20,13 @@ * @since 1.0.0

* @since 1.0.0
* @category models
* @category symbols
*/
const Equal = {
symbol: /*#__PURE__*/Symbol.for("@fp-ts/data/DeepEqual")
};
const symbolHash = /*#__PURE__*/Symbol.for("@fp-ts/data/DeepEqual/hash");
/**
* @since 1.0.0
* @category symbol
* @category symbols
*/
exports.Equal = Equal;
const symbol = Equal.symbol;
exports.symbol = symbol;
exports.symbolHash = symbolHash;
const symbolEqual = /*#__PURE__*/Symbol.for("@fp-ts/data/DeepEqual/equal");
exports.symbolEqual = symbolEqual;

@@ -47,8 +40,53 @@ function equals() {

}
/**
* @since 1.0.0
* @category hashing
*/
const hash = self => {
return hashOptimize(hashGeneric(self));
};
/**
* @since 1.0.0
* @category hashing
*/
exports.hash = hash;
const hashRandom = self => {
if (!CACHE.has(self)) {
const h = hashOptimize(pcgr.number());
CACHE.set(self, h);
}
return CACHE.get(self);
};
/**
* @since 1.0.0
* @category hashing
*/
exports.hashRandom = hashRandom;
const hashCombine = b => self => self * 53 ^ b;
/**
* @since 1.0.0
* @category hashing
*/
exports.hashCombine = hashCombine;
const hashOptimize = n => n & 0xbfffffff | n >>> 1 & 0x40000000;
exports.hashOptimize = hashOptimize;
function isDeepEqual(u) {
return typeof u === "object" && u !== null && Equal.symbol in u;
return typeof u === "object" && u !== null && symbolEqual in u && symbolHash in u;
}
function object(self, that) {
function compareObject(self, that) {
if ("_tag" in self) {

@@ -135,4 +173,4 @@ if ("_tag" in that) {

const hashSelf = DH.evaluate(self);
const hashThat = DH.evaluate(that);
const hashSelf = hash(self);
const hashThat = hash(that);

@@ -145,3 +183,3 @@ if (hashSelf !== hashThat) {

if (isDeepEqual(that)) {
return self[Equal.symbol](that);
return self[symbolEqual](that);
} else {

@@ -152,3 +190,3 @@ return false;

return object(self, that);
return compareObject(self, that);
}

@@ -160,4 +198,4 @@

if (isDeepEqual(that)) {
const hashSelf = DH.evaluate(self);
const hashThat = DH.evaluate(that);
const hashSelf = hash(self);
const hashThat = hash(that);

@@ -168,3 +206,3 @@ if (hashSelf !== hashThat) {

return self[Equal.symbol](that);
return self[symbolEqual](that);
} else {

@@ -184,2 +222,103 @@ return false;

}
/** @internal */
const pcgr = /*#__PURE__*/new _Random.PCGRandom();
function hashNumber(n) {
if (n !== n || n === Infinity) return 0;
let h = n | 0;
if (h !== n) h ^= n * 0xffffffff;
while (n > 0xffffffff) h ^= n /= 0xffffffff;
return n;
}
function hashString(str) {
let h = 5381,
i = str.length;
while (i) h = h * 33 ^ str.charCodeAt(--i);
return h;
}
const CACHE = /*#__PURE__*/new WeakMap();
function hashStructure(o) {
CACHE.set(o, hashNumber(pcgr.number()));
const keys = Object.keys(o);
let h = 12289;
for (let i = 0; i < keys.length; i++) {
h ^= (0, _Function.pipe)(hashString(keys[i]), hashCombine(hash(o[keys[i]])));
}
return h;
}
function hashArray(arr) {
let h = 6151;
for (let i = 0; i < arr.length; i++) {
h = (0, _Function.pipe)(h, hashCombine(hash(arr[i])));
}
return h;
}
const hashProtoMap = /*#__PURE__*/new Map([[Array.prototype, hashArray], [Object.prototype, hashStructure]]);
function hashObject(value) {
if (CACHE.has(value)) return CACHE.get(value);
let h;
if (isDeepEqual(value)) {
h = value[symbolHash]();
} else {
h = (hashProtoMap.get(Object.getPrototypeOf(value)) ?? hashProtoMap.get(Object.prototype))(value);
}
CACHE.set(value, h);
return h;
}
function hashGeneric(self) {
if (typeof self === "number") {
return hashNumber(self);
}
if (typeof self === "string") {
return hashString(self);
}
if (typeof self === "symbol") {
return hashString(String(self));
}
if (typeof self === "bigint") {
return hashString(self.toString(10));
}
if (typeof self === "undefined") {
return hashString("undefined");
}
if (typeof self === "object") {
if (self == null) {
return hashString("null");
}
return hashObject(self);
}
if (typeof self === "function") {
if (CACHE.has(self)) {
CACHE.set(self, isDeepEqual(self) ? self[symbolHash]() : hashNumber(pcgr.number()));
}
return CACHE.get(self);
}
}
//# sourceMappingURL=Equal.js.map

@@ -192,10 +192,2 @@ /**

*/
export declare const increment: (n: number) => number;
/**
* @since 1.0.0
*/
export declare const decrement: (n: number) => number;
/**
* @since 1.0.0
*/
export declare const absurd: <A>(_: never) => A;

@@ -202,0 +194,0 @@ /**

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

});
exports.flip = exports.decrement = exports.constant = exports.constVoid = exports.constUndefined = exports.constTrue = exports.constNull = exports.constFalse = exports.compose = exports.apply = exports.absurd = exports.SK = exports.Composable = exports.Category = void 0;
exports.flip = exports.constant = exports.constVoid = exports.constUndefined = exports.constTrue = exports.constNull = exports.constFalse = exports.compose = exports.apply = exports.absurd = exports.SK = exports.Composable = exports.Category = void 0;
exports.flow = flow;
exports.increment = exports.identity = exports.id = exports.hole = exports.getSemigroup = exports.getMonoid = void 0;
exports.identity = exports.id = exports.hole = exports.getSemigroup = exports.getMonoid = void 0;
exports.pipe = pipe;

@@ -266,18 +266,2 @@ exports.untupled = exports.unsafeCoerce = exports.tupled = void 0;

const increment = n => n + 1;
/**
* @since 1.0.0
*/
exports.increment = increment;
const decrement = n => n - 1;
/**
* @since 1.0.0
*/
exports.decrement = decrement;
const absurd = _ => {

@@ -284,0 +268,0 @@ throw new Error("Called `absurd` function which should be uncallable");

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

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

@@ -18,9 +19,11 @@ import * as differ from "@fp-ts/data/Differ";

import * as _function from "@fp-ts/data/Function";
import * as hash from "@fp-ts/data/Hash";
import * as hashMap from "@fp-ts/data/HashMap";
import * as hashSet from "@fp-ts/data/HashSet";
import * as identity from "@fp-ts/data/Identity";
import * as list from "@fp-ts/data/List";
import * as mutableHashMap from "@fp-ts/data/mutable/MutableHashMap";
import * as mutableHashSet from "@fp-ts/data/mutable/MutableHashSet";
import * as mutableList from "@fp-ts/data/mutable/MutableList";
import * as mutableListBuilder from "@fp-ts/data/mutable/MutableListBuilder";
import * as mutableQueue from "@fp-ts/data/mutable/MutableQueue";
import * as mutableRef from "@fp-ts/data/mutable/MutableRef";

@@ -70,2 +73,6 @@ import * as nonEmptyReadonlyArray from "@fp-ts/data/NonEmptyReadonlyArray";

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

@@ -107,6 +114,2 @@ /**

*/
hash,
/**
* @since 1.0.0
*/
hashMap,

@@ -128,2 +131,6 @@ /**

*/
identity,
/**
* @since 1.0.0
*/
list,

@@ -141,2 +148,6 @@ /**

*/
mutableList,
/**
* @since 1.0.0
*/
mutableListBuilder,

@@ -146,2 +157,6 @@ /**

*/
mutableQueue,
/**
* @since 1.0.0
*/
mutableRef,

@@ -148,0 +163,0 @@ /**

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

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

@@ -17,2 +17,6 @@ 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"));

@@ -62,6 +66,2 @@

var hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
exports.hash = hash;
var hashMap = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/HashMap"));

@@ -75,2 +75,6 @@

var identity = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Identity"));
exports.identity = identity;
var list = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/List"));

@@ -88,2 +92,6 @@

var mutableList = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/mutable/MutableList"));
exports.mutableList = mutableList;
var mutableListBuilder = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/mutable/MutableListBuilder"));

@@ -93,2 +101,6 @@

var mutableQueue = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/mutable/MutableQueue"));
exports.mutableQueue = mutableQueue;
var mutableRef = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/mutable/MutableRef"));

@@ -95,0 +107,0 @@

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

var _Equal = /*#__PURE__*/require("@fp-ts/data/Equal");
var Equal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Equal"));
var _Hash = /*#__PURE__*/require("@fp-ts/data/Hash");
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Option"));

@@ -40,8 +38,8 @@

[_Equal.Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[_Hash.Hash.symbol]() {
return (0, _Hash.random)(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -67,3 +65,3 @@

[_Equal.Equal.symbol](that) {
[Equal.symbolEqual](that) {
if (isContext(that)) {

@@ -84,4 +82,4 @@ if (this.unsafeMap.size === that.unsafeMap.size) {

[_Hash.Hash.symbol]() {
return (0, _Hash.evaluate)(this.unsafeMap.size);
[Equal.symbolHash]() {
return Equal.hash(this.unsafeMap.size);
}

@@ -88,0 +86,0 @@

@@ -32,4 +32,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
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,8 +54,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -64,0 +62,0 @@

@@ -49,4 +49,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var _bitwise = /*#__PURE__*/require("@fp-ts/data/internal/HashMap/bitwise");

@@ -89,7 +87,7 @@

[Hash.symbol]() {
let hash = Hash.evaluate("HashMap");
[Equal.symbolHash]() {
let hash = Equal.hash("HashMap");
for (const item of this) {
hash ^= Hash.combine(Hash.evaluate(item[0]))(Hash.evaluate(item[1]));
hash ^= Equal.hashCombine(Equal.hash(item[0]))(Equal.hash(item[1]));
}

@@ -100,3 +98,3 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
if (isHashMap(that)) {

@@ -108,3 +106,3 @@ if (that._size !== this._size) {

for (const item of this) {
const elem = (0, _Function.pipe)(that, getHash(item[0], Hash.evaluate(item[0])));
const elem = (0, _Function.pipe)(that, getHash(item[0], Equal.hash(item[0])));

@@ -237,3 +235,3 @@ if (Option.isNone(elem)) {

function get(key) {
return self => (0, _Function.pipe)(self, getHash(key, Hash.evaluate(key)));
return self => (0, _Function.pipe)(self, getHash(key, Equal.hash(key)));
}

@@ -306,3 +304,3 @@ /** @internal */

return self => {
const element = (0, _Function.pipe)(self, getHash(key, Hash.evaluate(key)));
const element = (0, _Function.pipe)(self, getHash(key, Equal.hash(key)));

@@ -321,3 +319,3 @@ if (Option.isNone(element)) {

return self => {
return Option.isSome((0, _Function.pipe)(self, getHash(key, Hash.evaluate(key))));
return Option.isSome((0, _Function.pipe)(self, getHash(key, Equal.hash(key))));
};

@@ -402,3 +400,3 @@ }

function modify(key, f) {
return self => modifyHash(key, Hash.evaluate(key), f)(self);
return self => modifyHash(key, Equal.hash(key), f)(self);
}

@@ -405,0 +403,0 @@ /** @internal */

@@ -35,4 +35,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var HM = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/HashMap"));

@@ -65,7 +63,7 @@

[Hash.symbol]() {
return Hash.combine(Hash.evaluate(this._keyMap))(Hash.evaluate("HashSet"));
[Equal.symbolHash]() {
return Equal.hashCombine(Equal.hash(this._keyMap))(Equal.hash("HashSet"));
}
[Equal.symbol](that) {
[Equal.symbolEqual](that) {
if (isHashSet(that)) {

@@ -72,0 +70,0 @@ return HM.size(this._keyMap) === HM.size(that._keyMap) && Equal.equals(this._keyMap, that._keyMap);

@@ -51,4 +51,2 @@ "use strict";

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

@@ -86,7 +84,7 @@

[DH.Hash.symbol]() {
return (0, _Function.pipe)(this, reduce(DH.evaluate(this._tag), (h, a) => (0, _Function.pipe)(h, DH.combine(DH.evaluate(a)))));
[DE.symbolHash]() {
return (0, _Function.pipe)(this, reduce(DE.hash(this._tag), (h, a) => (0, _Function.pipe)(h, DE.hashCombine(DE.hash(a)))));
}
[DE.Equal.symbol](that) {
[DE.symbolEqual](that) {
return isList(that) && that._tag === "Cons" ? DE.equals(that.head)(this.head) && DE.equals(that.tail)(this.tail) : false;

@@ -147,7 +145,7 @@ }

[DH.Hash.symbol]() {
return DH.evaluate(this._tag);
[DE.symbolHash]() {
return DE.hash(this._tag);
}
[DE.Equal.symbol](that) {
[DE.symbolEqual](that) {
return isList(that) && that._tag === "Nil";

@@ -154,0 +152,0 @@ }

@@ -14,4 +14,2 @@ "use strict";

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

@@ -34,7 +32,7 @@

[DH.Hash.symbol]() {
return DH.random(this);
[DE.symbolHash]() {
return DE.hashRandom(this);
}
[DE.Equal.symbol](that) {
[DE.symbolEqual](that) {
return this === that;

@@ -41,0 +39,0 @@ }

@@ -34,4 +34,2 @@ "use strict";

var DH = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var II = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/internal/Iterable"));

@@ -75,7 +73,7 @@

[DH.Hash.symbol]() {
return (0, _Function.pipe)(DH.evaluate(this._id), DH.combine(DH.evaluate(this._in)), DH.combine(DH.evaluate(this._out)));
[DE.symbolHash]() {
return (0, _Function.pipe)(DE.hash(this._id), DE.hashCombine(DE.hash(this._in)), DE.hashCombine(DE.hash(this._out)));
}
[DE.Equal.symbol](that) {
[DE.symbolEqual](that) {
return isQueue(that) && (0, _Function.pipe)(this._in, DE.equals(that._in)) && (0, _Function.pipe)(this._out, DE.equals(that._out));

@@ -82,0 +80,0 @@ }

import type * as Sortable from "@fp-ts/core/Sortable";
import * as Equal from "@fp-ts/data/Equal";
import * as Hash from "@fp-ts/data/Hash";
import { RedBlackTreeIterator } from "@fp-ts/data/internal/RedBlackTree/iterator";

@@ -14,4 +13,4 @@ import * as Node from "@fp-ts/data/internal/RedBlackTree/node";

constructor(_ord: Sortable.Sortable<K>, _root: Node.Node<K, V> | undefined);
[Hash.symbol](): number;
[Equal.symbol](that: unknown): boolean;
[Equal.symbolHash](): number;
[Equal.symbolEqual](that: unknown): boolean;
[Symbol.iterator](): RedBlackTreeIterator<K, V>;

@@ -18,0 +17,0 @@ }

@@ -38,4 +38,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var _iterator = /*#__PURE__*/require("@fp-ts/data/internal/RedBlackTree/iterator");

@@ -74,7 +72,7 @@

[Hash.symbol]() {
return Hash.combine(Hash.evaluate(RedBlackTreeSymbolKey))(Hash.evaluate(Array.from(this)));
[Equal.symbolHash]() {
return Equal.hashCombine(Equal.hash(RedBlackTreeSymbolKey))(Equal.hash(Array.from(this)));
}
[Equal.symbol](that) {
[Equal.symbolEqual](that) {
if (isRedBlackTree(that)) {

@@ -81,0 +79,0 @@ if ((this._root?.count ?? 0) !== (that._root?.count ?? 0)) {

@@ -29,4 +29,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var _Stack = /*#__PURE__*/require("@fp-ts/data/internal/Stack");

@@ -53,8 +51,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -72,8 +70,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -92,8 +90,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -100,0 +98,0 @@

@@ -12,4 +12,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Option"));

@@ -74,7 +72,7 @@

[Hash.Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}
[Equal.Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;

@@ -95,3 +93,3 @@ }

const get = k => self => {
const hash = Hash.evaluate(k);
const hash = Equal.hash(k);
const arr = self.backingMap.get(hash);

@@ -144,3 +142,3 @@

const update = (k, f) => self => {
const hash = Hash.evaluate(k);
const hash = Equal.hash(k);
const arr = self.backingMap.get(hash);

@@ -174,3 +172,3 @@

const set = (k, v) => self => {
const hash = Hash.evaluate(k);
const hash = Equal.hash(k);
const arr = self.backingMap.get(hash);

@@ -229,3 +227,3 @@

const remove = k => self => {
const hash = Hash.evaluate(k);
const hash = Equal.hash(k);
const arr = self.backingMap.get(hash);

@@ -232,0 +230,0 @@

@@ -10,4 +10,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var MHashMap = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/mutable/MutableHashMap"));

@@ -35,7 +33,7 @@

[Hash.Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hash(this);
}
[Equal.Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;

@@ -42,0 +40,0 @@ }

@@ -10,4 +10,2 @@ "use strict";

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

@@ -31,8 +29,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -39,0 +37,0 @@

@@ -16,3 +16,3 @@ /**

import type * as comonad from "@fp-ts/core/Comonad";
import * as flattenable from "@fp-ts/core/FlatMap";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";

@@ -25,3 +25,3 @@ import type { Kind, TypeLambda } from "@fp-ts/core/HKT";

import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as ord from "@fp-ts/core/Sortable";
import * as sortable from "@fp-ts/core/Sortable";
import type { Sortable } from "@fp-ts/core/Sortable";

@@ -37,3 +37,4 @@ import type * as traversable from "@fp-ts/core/Traversable";

/**
* Builds a `NonEmptyReadonlyArray` from an array returning `none` if `as` is an empty array.
* Builds a `NonEmptyReadonlyArray` from an `Iterable` returning `None` if `as`
* is an empty array.
*

@@ -43,4 +44,20 @@ * @category constructors

*/
export declare const fromReadonlyArray: <A>(as: readonly A[]) => Option<readonly [A, ...A[]]>;
export declare const from: <A>(iterable: Iterable<A>) => Option<readonly [A, ...A[]]>;
/**
* Unsafely builds a `NonEmptyReadonlyArray` from an `Iterable`.
*
* **Note**: this method will throw an error if an empty `Iterable` is provided.
*
* @category unsafe
* @since 1.0.0
*/
export declare const unsafeFrom: <A>(iterable: Iterable<A>) => readonly [A, ...A[]];
/**
* Builds a `NonEmptyReadonlyArray` from an non-empty collection of elements.
*
* @category constructors
* @since 1.0.0
*/
export declare const make: <As extends readonly [any, ...any[]]>(...as: As) => readonly [As[number], ...As[number][]];
/**
* Return a `NonEmptyReadonlyArray` of length `n` with element `i` initialized with `f(i)`.

@@ -149,3 +166,3 @@ *

* import * as RNEA from '@fp-ts/core/data/NonEmptyReadonlyArray'
* import { contramap } from '@fp-ts/core/typeclasses/Ord'
* import { contramap } from '@fp-ts/core/Sortable'
* import * as S from '@fp-ts/core/data/string'

@@ -160,5 +177,5 @@ * import * as N from '@fp-ts/core/data/number'

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

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

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

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

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

@@ -416,3 +433,3 @@ * Change the element at the specified index, creating a new `NonEmptyReadonlyArray`, or returning `None` if the index is out of bounds.

*/
export declare const Flattenable: flattenable.FlatMap<NonEmptyReadonlyArrayTypeLambda>;
export declare const FlatMap: flatMap_.FlatMap<NonEmptyReadonlyArrayTypeLambda>;
/**

@@ -457,3 +474,3 @@ * Sequences the specified effect after this effect, but ignores the value

*/
export declare const traverseWithIndex: <F extends TypeLambda>(Apply: semigroupal.Semigroupal<F>) => <A, S, R, O, E, B>(f: (i: number, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, S, R, O, E, readonly [B, ...B[]]>;
export declare const traverseWithIndex: <F extends TypeLambda>(Semigroupal: semigroupal.Semigroupal<F>) => <A, S, R, O, E, B>(f: (i: number, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, S, R, O, E, readonly [B, ...B[]]>;
/**

@@ -517,3 +534,3 @@ * @category traversing

*/
export declare const Apply: semigroupal.Semigroupal<NonEmptyReadonlyArrayTypeLambda>;
export declare const Semigroupal: semigroupal.Semigroupal<NonEmptyReadonlyArrayTypeLambda>;
/**

@@ -537,3 +554,3 @@ * Lifts a binary function into `NonEmptyReadonlyArray`.

*/
export declare const Applicative: monoidal.Monoidal<NonEmptyReadonlyArrayTypeLambda>;
export declare const Monoidal: monoidal.Monoidal<NonEmptyReadonlyArrayTypeLambda>;
/**

@@ -600,3 +617,3 @@ * @category instances

*/
export declare const reduceKind: <F extends TypeLambda>(Flattenable: flattenable.FlatMap<F>) => <S, R, O, E, B, A>(fb: Kind<F, S, R, O, E, B>, f: (b: B, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, S, R, O, E, B>;
export declare const reduceKind: <F extends TypeLambda>(Flattenable: flatMap_.FlatMap<F>) => <S, R, O, E, B, A>(fb: Kind<F, S, R, O, E, B>, f: (b: B, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly [A, ...A[]]) => Kind<F, S, R, O, E, B>;
/**

@@ -693,7 +710,7 @@ * @category instances

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

@@ -700,0 +717,0 @@ * @since 1.0.0

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

});
exports.combineAll = exports.chunksOf = exports.chop = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.append = exports.ap = exports.Zip = exports.Traversable = exports.Monad = exports.Functor = exports.Flattenable = exports.Do = exports.Comonad = exports.Apply = exports.Applicative = void 0;
exports.combineAll = exports.chunksOf = exports.chop = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.append = exports.ap = exports.Zip = exports.Traversable = exports.Semigroupal = exports.Monoidal = exports.Monad = exports.Functor = exports.FlatMap = exports.Do = exports.Comonad = void 0;
exports.concat = concat;
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.zip = exports.updateLast = exports.updateHead = exports.updateAt = exports.unzip = exports.unprepend = exports.unit = exports.uniq = exports.union = exports.unappend = exports.tupled = exports.traverseWithIndex = exports.traverse = exports.tap = exports.tail = exports.splitAt = exports.sortBy = exports.sort = exports.sequence = exports.rotate = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceKind = exports.reduce = exports.range = exports.prependAll = exports.prepend = exports.orElse = exports.of = exports.modifyLast = exports.modifyHead = exports.modifyAt = exports.min = exports.max = exports.matchRight = exports.matchLeft = exports.mapWithIndex = exports.map = exports.makeBy = exports.lift3 = exports.lift2 = exports.let = exports.last = exports.isOutOfBound = exports.intersperse = exports.intercalate = exports.init = exports.head = exports.groupBy = exports.group = exports.fromReadonlyArray = exports.foldMapWithIndex = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMap = exports.flap = exports.extract = exports.extend = exports.duplicate = void 0;
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.zip = exports.updateLast = exports.updateHead = exports.updateAt = exports.unzip = exports.unsafeFrom = exports.unprepend = exports.unit = exports.uniq = exports.union = exports.unappend = exports.tupled = exports.traverseWithIndex = exports.traverse = exports.tap = exports.tail = exports.splitAt = exports.sortBy = exports.sort = exports.sequence = exports.rotate = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRight = exports.reduceKind = exports.reduce = exports.range = exports.prependAll = exports.prepend = exports.orElse = exports.of = exports.modifyLast = exports.modifyHead = exports.modifyAt = exports.min = exports.max = exports.matchRight = exports.matchLeft = exports.mapWithIndex = exports.map = exports.makeBy = exports.make = exports.lift3 = exports.lift2 = exports.let = exports.last = exports.isOutOfBound = exports.intersperse = exports.intercalate = exports.init = exports.head = exports.groupBy = exports.group = exports.from = exports.foldMapWithIndex = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMap = exports.flap = exports.extract = exports.extend = exports.duplicate = void 0;
var flattenable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));

@@ -19,3 +19,3 @@ var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));

var ord = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));
var sortable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));

@@ -49,3 +49,4 @@ var _Equal = /*#__PURE__*/require("@fp-ts/data/Equal");

/**
* Builds a `NonEmptyReadonlyArray` from an array returning `none` if `as` is an empty array.
* Builds a `NonEmptyReadonlyArray` from an `Iterable` returning `None` if `as`
* is an empty array.
*

@@ -59,4 +60,39 @@ * @category constructors

const fromReadonlyArray = as => internal.isNonEmpty(as) ? internal.some(as) : internal.none;
const from = iterable => {
const array = Array.from(iterable);
return internal.isNonEmpty(array) ? internal.some(array) : internal.none;
};
/**
* Unsafely builds a `NonEmptyReadonlyArray` from an `Iterable`.
*
* **Note**: this method will throw an error if an empty `Iterable` is provided.
*
* @category unsafe
* @since 1.0.0
*/
exports.from = from;
const unsafeFrom = iterable => {
const array = Array.from(iterable);
if (array.length === 0) {
throw new Error("Cannot construct a NonEmptyReadonlyArray from an empty collection");
}
return array;
};
/**
* Builds a `NonEmptyReadonlyArray` from an non-empty collection of elements.
*
* @category constructors
* @since 1.0.0
*/
exports.unsafeFrom = unsafeFrom;
const make = (...as) => as;
/**
* Return a `NonEmptyReadonlyArray` of length `n` with element `i` initialized with `f(i)`.

@@ -78,3 +114,3 @@ *

exports.fromReadonlyArray = fromReadonlyArray;
exports.make = make;

@@ -224,3 +260,3 @@ const makeBy = f => n => {

* import * as RNEA from '@fp-ts/core/data/NonEmptyReadonlyArray'
* import { contramap } from '@fp-ts/core/typeclasses/Ord'
* import { contramap } from '@fp-ts/core/Sortable'
* import * as S from '@fp-ts/core/data/string'

@@ -235,5 +271,5 @@ * import * as N from '@fp-ts/core/data/number'

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

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

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

@@ -728,3 +764,3 @@

exports.flatMap = flatMap;
const Flattenable = {
const FlatMap = {
map,

@@ -741,4 +777,4 @@ flatMap

exports.Flattenable = Flattenable;
const zipLeft = /*#__PURE__*/flattenable.zipLeft(Flattenable);
exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
/**

@@ -752,3 +788,3 @@ * A variant of `flatMap` that ignores the value produced by this effect.

exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flattenable.zipRight(Flattenable);
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
/**

@@ -815,9 +851,9 @@ * @since 1.0.0

const traverseWithIndex = Apply => f => {
const ap = semigroupal.ap(Apply);
const traverseWithIndex = Semigroupal => f => {
const ap = semigroupal.ap(Semigroupal);
return self => {
let out = (0, _Function.pipe)(f(0, head(self)), Apply.map(of));
let out = (0, _Function.pipe)(f(0, head(self)), Semigroupal.map(of));
for (let i = 1; i < self.length; i++) {
out = (0, _Function.pipe)(out, Apply.map(bs => b => (0, _Function.pipe)(bs, append(b))), ap(f(i, self[i])));
out = (0, _Function.pipe)(out, Semigroupal.map(bs => b => (0, _Function.pipe)(bs, append(b))), ap(f(i, self[i])));
}

@@ -893,3 +929,3 @@

exports.unit = unit;
const Apply = {
const Semigroupal = {
map,

@@ -914,4 +950,4 @@ zipWith,

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

@@ -925,3 +961,3 @@ * Lifts a ternary function into `NonEmptyReadonlyArray`.

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

@@ -933,7 +969,7 @@ * @category instances

exports.lift3 = lift3;
const Applicative = {
const Monoidal = {
map,
of,
zipMany: Apply.zipMany,
zipWith: Apply.zipWith,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: all => {

@@ -954,3 +990,3 @@ let c = [[], ...[]];

exports.Applicative = Applicative;
exports.Monoidal = Monoidal;
const Monad = {

@@ -980,3 +1016,3 @@ map,

exports.Monad = Monad;
const tap = /*#__PURE__*/flattenable.tap(Flattenable);
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
/**

@@ -1094,3 +1130,3 @@ * @category folding

*/
const bind = /*#__PURE__*/flattenable.bind(Flattenable);
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**

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

exports.bind = bind;
const bindRight = /*#__PURE__*/semigroupal.bindRight(Apply); // -------------------------------------------------------------------------------------
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing

@@ -1131,3 +1167,3 @@ // -------------------------------------------------------------------------------------

exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Apply);
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal);
/**

@@ -1134,0 +1170,0 @@ * @since 1.0.0

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

import * as semigroup from "@fp-ts/core/Semigroup";
import type * as ord from "@fp-ts/core/Sortable";
import type * as sortable from "@fp-ts/core/Sortable";
import type { Refinement } from "@fp-ts/data/Refinement";

@@ -28,6 +28,14 @@ /**

/**
* @since 1.0.0
*/
export declare const increment: (n: number) => number;
/**
* @since 1.0.0
*/
export declare const decrement: (n: number) => number;
/**
* @category instances
* @since 1.0.0
*/
export declare const Ord: ord.Sortable<number>;
export declare const Sortable: sortable.Sortable<number>;
/**

@@ -34,0 +42,0 @@ * @category instances

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

});
exports.sumAll = exports.sum = exports.sub = exports.multiplyAll = exports.multiply = exports.isNumber = exports.SemigroupSum = exports.SemigroupMultiply = exports.Ord = exports.MonoidSum = exports.MonoidMultiply = exports.Bounded = void 0;
exports.sumAll = exports.sum = exports.sub = exports.multiplyAll = exports.multiply = exports.isNumber = exports.increment = exports.decrement = exports.Sortable = exports.SemigroupSum = exports.SemigroupMultiply = exports.MonoidSum = exports.MonoidMultiply = exports.Bounded = void 0;

@@ -45,2 +45,18 @@ var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroup"));

/**
* @since 1.0.0
*/
exports.sub = sub;
const increment = n => n + 1;
/**
* @since 1.0.0
*/
exports.increment = increment;
const decrement = n => n - 1;
/**
* @category instances

@@ -51,4 +67,4 @@ * @since 1.0.0

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

@@ -61,5 +77,5 @@ };

exports.Ord = Ord;
exports.Sortable = Sortable;
const Bounded = {
compare: Ord.compare,
compare: Sortable.compare,
maximum: Infinity,

@@ -127,3 +143,3 @@ minimum: -Infinity

combineMany: SemigroupMultiply.combineMany,
combineAll: all => SemigroupMultiply.combineMany(all)(0),
combineAll: all => SemigroupMultiply.combineMany(all)(1),
empty: 1

@@ -130,0 +146,0 @@ };

@@ -16,3 +16,3 @@ /**

import type * as extendable from "@fp-ts/core/Extendable";
import * as flattenable from "@fp-ts/core/FlatMap";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";

@@ -22,7 +22,7 @@ import type { Kind, TypeLambda } from "@fp-ts/core/HKT";

import type * as monoid from "@fp-ts/core/Monoid";
import type * as applicative from "@fp-ts/core/Monoidal";
import type * as fromIdentity from "@fp-ts/core/Pointed";
import type * as monoidal from "@fp-ts/core/Monoidal";
import type * as pointed from "@fp-ts/core/Pointed";
import type * as semigroup from "@fp-ts/core/Semigroup";
import * as apply from "@fp-ts/core/Semigroupal";
import * as ord from "@fp-ts/core/Sortable";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as sortable from "@fp-ts/core/Sortable";
import * as traversable from "@fp-ts/core/Traversable";

@@ -354,3 +354,3 @@ import type { LazyArg } from "@fp-ts/data/Function";

*/
export declare const FromIdentity: fromIdentity.Pointed<OptionTypeLambda>;
export declare const Pointed: pointed.Pointed<OptionTypeLambda>;
/**

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

*/
export declare const Flattenable: flattenable.FlatMap<OptionTypeLambda>;
export declare const FlatMap: flatMap_.FlatMap<OptionTypeLambda>;
/**

@@ -479,6 +479,6 @@ * Sequences the specified effect after this effect, but ignores the value

*/
export declare const traverse: <F extends TypeLambda>(F: applicative.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, B>) => (ta: Option<A>) => Kind<F, S, R, O, E, Option<B>>;
export declare const traverse: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <A, S, R, O, E, B>(f: (a: A) => Kind<F, S, R, O, E, B>) => (ta: Option<A>) => Kind<F, S, R, O, E, Option<B>>;
/**
* The `Ord` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Ord` instance for
* The `Sortable` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Sortable` instance for
* the type the `Option` contains.

@@ -489,7 +489,7 @@ *

* @exampleTodo
* import { none, some, liftOrd } from '@fp-ts/core/data/Option'
* import { none, some, liftSortable } from '@fp-ts/core/data/Option'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
*
* const O = liftOrd(N.Ord)
* const O = liftSortable(N.Sortable)
* assert.strictEqual(pipe(none, O.compare(none)), 0)

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

*/
export declare const liftOrd: <A>(O: ord.Sortable<A>) => ord.Sortable<Option<A>>;
export declare const liftSortable: <A>(O: sortable.Sortable<A>) => sortable.Sortable<Option<A>>;
/**

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

*/
export declare const Apply: apply.Semigroupal<OptionTypeLambda>;
export declare const Semigroupal: semigroupal.Semigroupal<OptionTypeLambda>;
/**

@@ -587,3 +587,3 @@ * Lifts a binary function into `Option`.

*/
export declare const Applicative: applicative.Monoidal<OptionTypeLambda>;
export declare const Monoidal: monoidal.Monoidal<OptionTypeLambda>;
/**

@@ -660,3 +660,3 @@ * @category instances

*/
export declare const sequence: <F extends TypeLambda>(F: applicative.Monoidal<F>) => <S, R, O, E, A>(fas: Option<Kind<F, S, R, O, E, A>>) => Kind<F, S, R, O, E, Option<A>>;
export declare const sequence: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <S, R, O, E, A>(fas: Option<Kind<F, S, R, O, E, A>>) => Kind<F, S, R, O, E, Option<A>>;
/**

@@ -666,3 +666,3 @@ * @category filtering

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

@@ -672,3 +672,3 @@ * @category filtering

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

@@ -683,3 +683,3 @@ * @category instances

*/
export declare const traverseFilter: <F extends TypeLambda>(F: applicative.Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => (self: Option<B>) => Kind<F, S, R, O, E, Option<B>>;
export declare const traverseFilter: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => (self: Option<B>) => Kind<F, S, R, O, E, Option<B>>;
/**

@@ -689,3 +689,3 @@ * @category filtering

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

@@ -831,3 +831,3 @@ * @category instances

/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*

@@ -839,3 +839,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*

@@ -847,3 +847,3 @@ * @category traversing

/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*

@@ -855,3 +855,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#traverse(Applicative)`.
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*

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

/**
* Equivalent to `ReadonlyArray#sequence(Applicative)`.
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*

@@ -866,0 +866,0 @@ * @category traversing

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

});
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.unit = exports.tupled = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyArray = exports.traversePartitionMap = exports.traversePartition = exports.traverseNonEmptyReadonlyArrayWithIndex = exports.traverseNonEmptyReadonlyArray = exports.traverseFilterMap = exports.traverseFilter = exports.traverse = exports.toUndefined = exports.toResult = exports.toReadonlyArray = exports.toNull = exports.tap = exports.some = exports.sequenceReadonlyArray = exports.sequence = exports.separate = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.orElse = exports.none = exports.match = exports.map = exports.liftThrowable = exports.liftResult = exports.liftPredicate = exports.liftOrd = exports.liftNullable = exports.lift3 = exports.lift2 = exports.let = exports.isSome = exports.isNone = exports.getOrElse = exports.getMonoid = exports.fromThrowable = exports.fromResult = exports.fromNullable = exports.fromIterable = exports.foldMap = exports.flatten = exports.flatMapResult = exports.flatMapNullable = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.extend = exports.exists = exports.elem = exports.duplicate = exports.compact = exports.catchAll = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.ap = exports.Zip = exports.TraversableFilterable = exports.Traversable = exports.Monad = exports.Functor = exports.FromResult = exports.FromOption = exports.FromIdentity = exports.Flattenable = exports.Filterable = exports.Extendable = exports.Do = exports.Compactable = exports.Apply = exports.Applicative = void 0;
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.unit = exports.tupled = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyArray = exports.traversePartitionMap = exports.traversePartition = exports.traverseNonEmptyReadonlyArrayWithIndex = exports.traverseNonEmptyReadonlyArray = exports.traverseFilterMap = exports.traverseFilter = exports.traverse = exports.toUndefined = exports.toResult = exports.toReadonlyArray = exports.toNull = exports.tap = exports.some = exports.sequenceReadonlyArray = exports.sequence = exports.separate = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.orElse = exports.none = exports.match = exports.map = exports.liftThrowable = exports.liftSortable = exports.liftResult = exports.liftPredicate = exports.liftNullable = exports.lift3 = exports.lift2 = exports.let = exports.isSome = exports.isNone = exports.getOrElse = exports.getMonoid = exports.fromThrowable = exports.fromResult = exports.fromNullable = exports.fromIterable = exports.foldMap = exports.flatten = exports.flatMapResult = exports.flatMapNullable = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.extend = exports.exists = exports.elem = exports.duplicate = exports.compact = exports.catchAll = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.ap = exports.Zip = exports.TraversableFilterable = exports.Traversable = exports.Semigroupal = exports.Pointed = exports.Monoidal = exports.Monad = exports.Functor = exports.FromResult = exports.FromOption = exports.FlatMap = exports.Filterable = exports.Extendable = exports.Do = exports.Compactable = void 0;
var flattenable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));
var apply = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var ord = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));
var sortable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));

@@ -391,3 +391,3 @@ var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Traversable"));

exports.map = map;
const FromIdentity = {
const Pointed = {
of: some

@@ -400,3 +400,3 @@ };

exports.FromIdentity = FromIdentity;
exports.Pointed = Pointed;

@@ -411,3 +411,3 @@ const flatMap = f => self => isNone(self) ? none : f(self.value);

exports.flatMap = flatMap;
const Flattenable = {
const FlatMap = {
map,

@@ -424,4 +424,4 @@ flatMap

exports.Flattenable = Flattenable;
const zipLeft = /*#__PURE__*/flattenable.zipLeft(Flattenable);
exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
/**

@@ -435,3 +435,3 @@ * A variant of `flatMap` that ignores the value produced by this effect.

exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flattenable.zipRight(Flattenable);
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
/**

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

/**
* The `Ord` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Ord` instance for
* The `Sortable` instance allows `Option` values to be compared with
* `compare`, whenever there is an `Sortable` instance for
* the type the `Option` contains.

@@ -584,7 +584,7 @@ *

* @exampleTodo
* import { none, some, liftOrd } from '@fp-ts/core/data/Option'
* import { none, some, liftSortable } from '@fp-ts/core/data/Option'
* import * as N from '@fp-ts/core/data/number'
* import { pipe } from '@fp-ts/core/data/Function'
*
* const O = liftOrd(N.Ord)
* const O = liftSortable(N.Sortable)
* assert.strictEqual(pipe(none, O.compare(none)), 0)

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

const liftOrd = O => ord.fromCompare(that => self => isSome(self) ? isSome(that) ? O.compare(that.value)(self.value) : 1 : -1);
const liftSortable = O => sortable.fromCompare(that => self => isSome(self) ? isSome(that) ? O.compare(that.value)(self.value) : 1 : -1);
/**

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

exports.liftOrd = liftOrd;
exports.liftSortable = liftSortable;

@@ -713,3 +713,3 @@ const getMonoid = Semigroup => {

exports.zipWith = zipWith;
const Apply = {
const Semigroupal = {
map,

@@ -742,4 +742,4 @@ zipWith,

exports.Apply = Apply;
const lift2 = /*#__PURE__*/apply.lift2(Apply);
exports.Semigroupal = Semigroupal;
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
/**

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

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/apply.lift3(Apply);
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
/**

@@ -761,7 +761,7 @@ * @category instances

exports.lift3 = lift3;
const Applicative = {
const Monoidal = {
of: some,
map,
zipMany: Apply.zipMany,
zipWith: Apply.zipWith,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: collection => {

@@ -786,3 +786,3 @@ const res = [];

exports.Applicative = Applicative;
exports.Monoidal = Monoidal;
const Monad = {

@@ -800,3 +800,3 @@ map,

exports.Monad = Monad;
const tap = /*#__PURE__*/flattenable.tap(Flattenable);
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
/**

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

exports.liftResult = liftResult;
const flatMapResult = /*#__PURE__*/fromResult_.flatMapResult(FromResult, Flattenable);
const flatMapResult = /*#__PURE__*/fromResult_.flatMapResult(FromResult, FlatMap);
/**

@@ -1064,3 +1064,3 @@ * Tests whether a value is a member of a `Option`.

*/
const bind = /*#__PURE__*/flattenable.bind(Flattenable);
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**

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

exports.bind = bind;
const bindRight = /*#__PURE__*/apply.bindRight(Apply); // -------------------------------------------------------------------------------------
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing

@@ -1101,3 +1101,3 @@ // -------------------------------------------------------------------------------------

exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/apply.zipFlatten(Apply); // -------------------------------------------------------------------------------------
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal); // -------------------------------------------------------------------------------------
// array utils

@@ -1107,3 +1107,3 @@ // -------------------------------------------------------------------------------------

/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*

@@ -1138,3 +1138,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*

@@ -1153,3 +1153,3 @@ * @category traversing

/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*

@@ -1167,3 +1167,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#traverse(Applicative)`.
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*

@@ -1181,3 +1181,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#sequence(Applicative)`.
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*

@@ -1184,0 +1184,0 @@ * @category traversing

{
"name": "@fp-ts/data",
"version": "0.0.2",
"version": "0.0.3",
"license": "MIT",

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

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

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

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

import type * as extendable from "@fp-ts/core/Extendable";
import * as flattenable from "@fp-ts/core/FlatMap";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";

@@ -11,7 +11,7 @@ import type { Kind, TypeLambda } from "@fp-ts/core/HKT";

import type { Monoid } from "@fp-ts/core/Monoid";
import type * as applicative from "@fp-ts/core/Monoidal";
import type * as fromIdentity from "@fp-ts/core/Pointed";
import type * as monoidal from "@fp-ts/core/Monoidal";
import type * as pointed from "@fp-ts/core/Pointed";
import type { Semigroup } from "@fp-ts/core/Semigroup";
import * as apply from "@fp-ts/core/Semigroupal";
import * as ord from "@fp-ts/core/Sortable";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as sortable from "@fp-ts/core/Sortable";
import type { Sortable } from "@fp-ts/core/Sortable";

@@ -60,2 +60,14 @@ import * as traversable from "@fp-ts/core/Traversable";

/**
* Create a `ReadonlyArray` containing a range of integers, including both endpoints.
*
* @exampleTodo
* import { range } from '@fp-ts/data/ReadonlyArray'
*
* assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5])
*
* @category constructors
* @since 1.0.0
*/
export declare const range: (start: number, end: number) => readonly [number, ...number[]];
/**
* Create a `ReadonlyArray` containing a value repeated the specified number of times.

@@ -567,7 +579,7 @@ *

*
* assert.deepStrictEqual(sort(N.Ord)([3, 2, 1]), [1, 2, 3])
* assert.deepStrictEqual(sort(N.Sortable)([3, 2, 1]), [1, 2, 3])
*
* @since 1.0.0
*/
export declare const sort: <B>(O: ord.Sortable<B>) => <A extends B>(as: readonly A[]) => readonly A[];
export declare const sort: <B>(O: sortable.Sortable<B>) => <A extends B>(as: readonly A[]) => readonly A[];
/**

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

* import { sortBy } from '@fp-ts/core/data/ReadonlyArray'
* import { contramap } from '@fp-ts/core/typeclasses/Ord'
* import { contramap } from '@fp-ts/core/Sortable'
* import * as S from '@fp-ts/core/data/string'

@@ -688,4 +700,4 @@ * import * as N from '@fp-ts/core/data/number'

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

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

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

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

*/
export declare const FromIdentity: fromIdentity.Pointed<ReadonlyArrayTypeLambda>;
export declare const Pointed: pointed.Pointed<ReadonlyArrayTypeLambda>;
/**

@@ -867,3 +879,3 @@ * @exampleTodo

*/
export declare const Flattenable: flattenable.FlatMap<ReadonlyArrayTypeLambda>;
export declare const FlatMap: flatMap_.FlatMap<ReadonlyArrayTypeLambda>;
/**

@@ -949,3 +961,3 @@ * Sequences the specified effect after this effect, but ignores the value

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

@@ -955,3 +967,3 @@ * @category traversing

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

@@ -998,3 +1010,3 @@ * @since 1.0.0

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

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

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

@@ -1018,3 +1030,3 @@ * assert.strictEqual(pipe(['a'], O.compare(['a'])), 0)

*/
export declare const liftOrd: <A>(O: ord.Sortable<A>) => ord.Sortable<readonly A[]>;
export declare const liftSortable: <A>(Sortable: sortable.Sortable<A>) => sortable.Sortable<readonly A[]>;
/**

@@ -1048,3 +1060,3 @@ * @category instances

*/
export declare const Apply: apply.Semigroupal<ReadonlyArrayTypeLambda>;
export declare const Semigroupal: semigroupal.Semigroupal<ReadonlyArrayTypeLambda>;
/**

@@ -1068,3 +1080,3 @@ * Lifts a binary function into `ReadonlyArray`.

*/
export declare const Applicative: applicative.Monoidal<ReadonlyArrayTypeLambda>;
export declare const Monoidal: monoidal.Monoidal<ReadonlyArrayTypeLambda>;
/**

@@ -1181,3 +1193,3 @@ * @category instances

*/
export declare const reduceKind: <F extends TypeLambda>(Flattenable: flattenable.FlatMap<F>) => <S, R, O, E, B, A>(fb: Kind<F, S, R, O, E, B>, f: (b: B, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly A[]) => Kind<F, S, R, O, E, B>;
export declare const reduceKind: <F extends TypeLambda>(Flattenable: flatMap_.FlatMap<F>) => <S, R, O, E, B, A>(fb: Kind<F, S, R, O, E, B>, f: (b: B, a: A) => Kind<F, S, R, O, E, B>) => (self: readonly A[]) => Kind<F, S, R, O, E, B>;
/**

@@ -1192,3 +1204,3 @@ * @category instances

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

@@ -1198,3 +1210,3 @@ * @category filtering

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

@@ -1204,3 +1216,3 @@ * @category filtering

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

@@ -1219,3 +1231,3 @@ * @category instances

*
* const traverseFilter = RA.traverseFilter(T.ApplicativePar)
* const traverseFilter = RA.traverseFilter(T.MonoidalPar)
* async function test() {

@@ -1234,7 +1246,7 @@ * assert.deepStrictEqual(

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

@@ -1241,0 +1253,0 @@ * @category instances

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

});
exports.dropLeft = exports.difference = exports.deleteAt = exports.concat = exports.compact = exports.chunksOf = exports.chop = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.append = exports.ap = exports.Zip = exports.TraversableFilterable = exports.Traversable = exports.Monad = exports.Functor = exports.FromResult = exports.FromOption = exports.FromIdentity = exports.Flattenable = exports.Filterable = exports.Extendable = exports.Do = exports.Compactable = exports.Apply = exports.Applicative = void 0;
exports.dropLeft = exports.difference = exports.deleteAt = exports.concat = exports.compact = exports.chunksOf = exports.chop = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.append = exports.ap = exports.Zip = exports.TraversableFilterable = exports.Traversable = exports.Semigroupal = exports.Pointed = exports.Monoidal = exports.Monad = exports.Functor = exports.FromResult = exports.FromOption = exports.FlatMap = exports.Filterable = exports.Extendable = exports.Do = exports.Compactable = void 0;
exports.dropLeftWhile = dropLeftWhile;

@@ -15,4 +15,4 @@ exports.empty = exports.elem = exports.duplicate = exports.dropRight = void 0;

exports.findLast = findLast;
exports.reduceRight = exports.reduceKind = exports.reduce = exports.prependAll = exports.prepend = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partition = exports.orElse = exports.of = exports.modifyAt = exports.matchRight = exports.matchLeft = exports.match = exports.mapWithIndex = exports.map = exports.makeBy = exports.lookup = exports.liftResult = exports.liftPredicate = exports.liftOrd = exports.liftOption = exports.liftNullable = exports.lift3 = exports.lift2 = exports.let = exports.last = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.intersperse = exports.intersection = exports.intercalate = exports.insertAt = exports.init = exports.head = exports.getUnionSemigroup = exports.getUnionMonoid = exports.getSemigroup = exports.getMonoid = exports.getIntersectionSemigroup = exports.fromResult = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.foldMapWithIndex = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMapNullable = exports.flatMap = exports.flap = exports.findLastMap = exports.findLastIndex = void 0;
exports.sortBy = exports.sort = exports.some = exports.size = exports.sequence = exports.separate = exports.scanRight = exports.scanLeft = exports.rotate = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = void 0;
exports.reduceKind = exports.reduce = exports.range = exports.prependAll = exports.prepend = exports.partitionWithIndex = exports.partitionMapWithIndex = exports.partitionMap = exports.partition = exports.orElse = exports.of = exports.modifyAt = exports.matchRight = exports.matchLeft = exports.match = exports.mapWithIndex = exports.map = exports.makeBy = exports.lookup = exports.liftSortable = exports.liftResult = exports.liftPredicate = exports.liftOption = exports.liftNullable = exports.lift3 = exports.lift2 = exports.let = exports.last = exports.isOutOfBound = exports.isNonEmpty = exports.isEmpty = exports.intersperse = exports.intersection = exports.intercalate = exports.insertAt = exports.init = exports.head = exports.getUnionSemigroup = exports.getUnionMonoid = exports.getSemigroup = exports.getMonoid = exports.getIntersectionSemigroup = exports.fromResult = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.foldMapWithIndex = exports.foldMap = exports.flatten = exports.flatMapWithIndex = exports.flatMapNullable = exports.flatMap = exports.flap = exports.findLastMap = exports.findLastIndex = void 0;
exports.sortBy = exports.sort = exports.some = exports.size = exports.sequence = exports.separate = exports.scanRight = exports.scanLeft = exports.rotate = exports.reverse = exports.replicate = exports.reduceWithIndex = exports.reduceRightWithIndex = exports.reduceRight = void 0;
exports.spanLeft = spanLeft;

@@ -23,3 +23,3 @@ exports.takeLeft = exports.tail = exports.successes = exports.splitAt = void 0;

var flattenable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));

@@ -30,5 +30,5 @@ var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));

var apply = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var ord = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));
var sortable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Sortable"));

@@ -84,2 +84,17 @@ var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Traversable"));

/**
* Create a `ReadonlyArray` containing a range of integers, including both endpoints.
*
* @exampleTodo
* import { range } from '@fp-ts/data/ReadonlyArray'
*
* assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5])
*
* @category constructors
* @since 1.0.0
*/
exports.makeBy = makeBy;
const range = nonEmptyReadonlyArray.range;
/**
* Create a `ReadonlyArray` containing a value repeated the specified number of times.

@@ -99,5 +114,4 @@ *

exports.range = range;
exports.makeBy = makeBy;
const replicate = a => makeBy(() => a);

@@ -850,3 +864,3 @@ /**

*
* assert.deepStrictEqual(sort(N.Ord)([3, 2, 1]), [1, 2, 3])
* assert.deepStrictEqual(sort(N.Sortable)([3, 2, 1]), [1, 2, 3])
*

@@ -1036,3 +1050,3 @@ * @since 1.0.0

* import { sortBy } from '@fp-ts/core/data/ReadonlyArray'
* import { contramap } from '@fp-ts/core/typeclasses/Ord'
* import { contramap } from '@fp-ts/core/Sortable'
* import * as S from '@fp-ts/core/data/string'

@@ -1046,4 +1060,4 @@ * import * as N from '@fp-ts/core/data/number'

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

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

exports.map = map;
const FromIdentity = {
const Pointed = {
of

@@ -1277,3 +1291,3 @@ };

exports.FromIdentity = FromIdentity;
exports.Pointed = Pointed;

@@ -1288,3 +1302,3 @@ const flatMap = f => flatMapWithIndex((_, a) => f(a));

exports.flatMap = flatMap;
const Flattenable = {
const FlatMap = {
map,

@@ -1301,4 +1315,4 @@ flatMap

exports.Flattenable = Flattenable;
const zipLeft = /*#__PURE__*/flattenable.zipLeft(Flattenable);
exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
/**

@@ -1312,3 +1326,3 @@ * A variant of `flatMap` that ignores the value produced by this effect.

exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flattenable.zipRight(Flattenable);
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
/**

@@ -1477,5 +1491,5 @@ * @since 1.0.0

const traverseWithIndex = Applicative => f => {
const ap = apply.ap(Applicative);
return self => (0, _Function.pipe)(self, reduceWithIndex(Applicative.of(internal.empty), (i, fbs, a) => (0, _Function.pipe)(fbs, Applicative.map(bs => b => append(b)(bs)), ap(f(i, a)))));
const traverseWithIndex = Monoidal => f => {
const ap = semigroupal.ap(Monoidal);
return self => (0, _Function.pipe)(self, reduceWithIndex(Monoidal.of(internal.empty), (i, fbs, a) => (0, _Function.pipe)(fbs, Monoidal.map(bs => b => append(b)(bs)), ap(f(i, a)))));
};

@@ -1490,3 +1504,3 @@ /**

const traverse = Applicative => f => traverseWithIndex(Applicative)((_, a) => f(a));
const traverse = Monoidal => f => traverseWithIndex(Monoidal)((_, a) => f(a));
/**

@@ -1588,3 +1602,3 @@ * @since 1.0.0

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

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

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

@@ -1612,3 +1626,3 @@ * assert.strictEqual(pipe(['a'], O.compare(['a'])), 0)

const liftOrd = O => ord.fromCompare(that => self => {
const liftSortable = Sortable => sortable.fromCompare(that => self => {
const aLen = self.length;

@@ -1619,3 +1633,3 @@ const bLen = that.length;

for (let i = 0; i < len; i++) {
const o = O.compare(that[i])(self[i]);
const o = Sortable.compare(that[i])(self[i]);

@@ -1627,3 +1641,3 @@ if (o !== 0) {

return number.Ord.compare(bLen)(aLen);
return number.Sortable.compare(bLen)(aLen);
});

@@ -1636,3 +1650,3 @@ /**

exports.liftOrd = liftOrd;
exports.liftSortable = liftSortable;
const Functor = {

@@ -1672,3 +1686,3 @@ map

exports.unit = unit;
const Apply = {
const Semigroupal = {
map,

@@ -1693,4 +1707,4 @@ zipWith,

exports.Apply = Apply;
const lift2 = /*#__PURE__*/apply.lift2(Apply);
exports.Semigroupal = Semigroupal;
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
/**

@@ -1704,3 +1718,3 @@ * Lifts a ternary function into `ReadonlyArray`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/apply.lift3(Apply);
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
/**

@@ -1712,7 +1726,7 @@ * @category instances

exports.lift3 = lift3;
const Applicative = {
const Monoidal = {
map,
of,
zipMany: Apply.zipMany,
zipWith: Apply.zipWith,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: collection => {

@@ -1733,3 +1747,3 @@ let c = [[], ...[]];

exports.Applicative = Applicative;
exports.Monoidal = Monoidal;
const Monad = {

@@ -1766,3 +1780,3 @@ map,

exports.Monad = Monad;
const tap = /*#__PURE__*/flattenable.tap(Flattenable);
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
/**

@@ -1940,3 +1954,3 @@ * @category instances

*
* const traverseFilter = RA.traverseFilter(T.ApplicativePar)
* const traverseFilter = RA.traverseFilter(T.MonoidalPar)
* async function test() {

@@ -2007,3 +2021,3 @@ * assert.deepStrictEqual(

exports.liftNullable = liftNullable;
const flatMapNullable = /*#__PURE__*/fromOption_.flatMapNullable(FromOption, Flattenable);
const flatMapNullable = /*#__PURE__*/fromOption_.flatMapNullable(FromOption, FlatMap);
/**

@@ -2101,3 +2115,3 @@ * @category instances

*/
const bind = /*#__PURE__*/flattenable.bind(Flattenable);
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**

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

exports.bind = bind;
const bindRight = /*#__PURE__*/apply.bindRight(Apply); // -------------------------------------------------------------------------------------
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing

@@ -2138,4 +2152,4 @@ // -------------------------------------------------------------------------------------

exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/apply.zipFlatten(Apply);
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal);
exports.zipFlatten = zipFlatten;
//# sourceMappingURL=ReadonlyArray.js.map

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

/**
* Gets the `Ord<K>` that the `RedBlackTree<K, V>` is using.
* Gets the `Sortable<K>` that the `RedBlackTree<K, V>` is using.
*

@@ -60,0 +60,0 @@ * @since 1.0.0

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

/**
* Gets the `Ord<K>` that the `RedBlackTree<K, V>` is using.
* Gets the `Sortable<K>` that the `RedBlackTree<K, V>` is using.
*

@@ -46,0 +46,0 @@ * @since 1.0.0

@@ -18,3 +18,3 @@ /**

import type * as extendable from "@fp-ts/core/Extendable";
import * as flattenable from "@fp-ts/core/FlatMap";
import * as flatMap_ from "@fp-ts/core/FlatMap";
import * as functor from "@fp-ts/core/Functor";

@@ -24,6 +24,6 @@ import type { Kind, TypeLambda } from "@fp-ts/core/HKT";

import type { Monoid } from "@fp-ts/core/Monoid";
import type * as applicative from "@fp-ts/core/Monoidal";
import type * as fromIdentity from "@fp-ts/core/Pointed";
import type * as monoidal from "@fp-ts/core/Monoidal";
import type * as pointed from "@fp-ts/core/Pointed";
import type { Semigroup } from "@fp-ts/core/Semigroup";
import * as apply from "@fp-ts/core/Semigroupal";
import * as semigroupal from "@fp-ts/core/Semigroupal";
import * as traversable from "@fp-ts/core/Traversable";

@@ -318,3 +318,3 @@ import type { NonEmptyReadonlyArray } from "@fp-ts/data/NonEmptyReadonlyArray";

* assert.deepStrictEqual(
* pipe(E.succeed(['a']), E.traverse(O.Applicative)(RA.head)),
* pipe(E.succeed(['a']), E.traverse(O.Monoidal)(RA.head)),
* O.some(E.succeed('a')),

@@ -324,3 +324,3 @@ * )

* assert.deepStrictEqual(
* pipe(E.succeed([]), E.traverse(O.Applicative)(RA.head)),
* pipe(E.succeed([]), E.traverse(O.Monoidal)(RA.head)),
* O.none,

@@ -332,3 +332,3 @@ * )

*/
export declare const traverse: <F extends TypeLambda>(F: applicative.Monoidal<F>) => <A, FS, FR, FO, FE, B>(f: (a: A) => Kind<F, FS, FR, FO, FE, B>) => <E>(ta: Result<E, A>) => Kind<F, FS, FR, FO, FE, Result<E, B>>;
export declare const traverse: <F extends TypeLambda>(Monoidal: monoidal.Monoidal<F>) => <A, FS, FR, FO, FE, B>(f: (a: A) => Kind<F, FS, FR, FO, FE, B>) => <E>(ta: Result<E, A>) => Kind<F, FS, FR, FO, FE, Result<E, B>>;
/**

@@ -377,3 +377,3 @@ * Semigroup returning the left-most non-`Failure` value. If both operands are `Success`es then the inner values are

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

@@ -383,3 +383,3 @@ * @category filtering

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

@@ -438,3 +438,3 @@ * @category instances

*/
export declare const Succeed: fromIdentity.Pointed<ResultTypeLambda>;
export declare const Succeed: pointed.Pointed<ResultTypeLambda>;
/**

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

*/
export declare const Flattenable: flattenable.FlatMap<ResultTypeLambda>;
export declare const FlatMap: flatMap_.FlatMap<ResultTypeLambda>;
/**

@@ -491,3 +491,3 @@ * Sequences the specified effect after this effect, but ignores the value

*/
export declare const Apply: apply.Semigroupal<ResultTypeLambda>;
export declare const Semigroupal: semigroupal.Semigroupal<ResultTypeLambda>;
/**

@@ -515,9 +515,9 @@ * @since 1.0.0

*/
export declare const Applicative: applicative.Monoidal<ResultTypeLambda>;
export declare const Monoidal: monoidal.Monoidal<ResultTypeLambda>;
/**
* The default [`Applicative`](#applicative) instance returns the first error, if you want to
* The default [`Monoidal`](#monoidal) instance returns the first error, if you want to
* get all errors you need to provide a way to combine them via a `Semigroup`.
*
* @exampleTodo
* import * as A from '@fp-ts/core/typeclasses/Apply'
* import * as A from '@fp-ts/core/typeclasses/Semigroupal'
* import * as E from '@fp-ts/core/data/Result'

@@ -550,7 +550,7 @@ * import { pipe } from '@fp-ts/core/data/Function'

*
* const Applicative = E.getValidatedApplicative(
* const Monoidal = E.getValidatedMonoidal(
* pipe(string.Semigroup, S.intercalate(', '))
* )
*
* const bindRight = A.bindRight(Applicative)
* const bindRight = A.bindRight(Monoidal)
*

@@ -571,3 +571,3 @@ * const parsePersonAll = (

*/
export declare const getValidatedApplicative: <E>(Semigroup: Semigroup<E>) => applicative.Monoidal<ValidatedT<ResultTypeLambda, E>>;
export declare const getValidatedMonoidal: <E>(Semigroup: Semigroup<E>) => monoidal.Monoidal<ValidatedT<ResultTypeLambda, E>>;
/**

@@ -620,3 +620,3 @@ * @category instances

*/
export declare const sequence: <F extends TypeLambda>(F: applicative.Monoidal<F>) => <E, FS, FR, FO, FE, A>(fa: Result<E, Kind<F, FS, FR, FO, FE, A>>) => Kind<F, FS, FR, FO, FE, Result<E, A>>;
export declare const sequence: <F extends TypeLambda>(F: monoidal.Monoidal<F>) => <E, FS, FR, FO, FE, A>(fa: Result<E, Kind<F, FS, FR, FO, FE, A>>) => Kind<F, FS, FR, FO, FE, Result<E, A>>;
/**

@@ -860,3 +860,3 @@ * @category instances

/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*

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

/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*

@@ -876,3 +876,3 @@ * @category traversing

/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*

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

/**
* Equivalent to `ReadonlyArray#traverse(Applicative)`.
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*

@@ -892,3 +892,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#sequence(Applicative)`.
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*

@@ -895,0 +895,0 @@ * @category traversing

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

});
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.unit = exports.tupled = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyArray = exports.traversePartitionMap = exports.traverseNonEmptyReadonlyArrayWithIndex = exports.traverseNonEmptyReadonlyArray = exports.traverseFilterMap = exports.traverse = exports.toUnion = exports.toUndefined = exports.toReadonlyArray = exports.toNull = exports.tapError = exports.tap = exports.succeed = exports.sequenceReadonlyArray = exports.sequence = exports.separate = exports.reverse = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.orElse = exports.match = exports.mapError = exports.mapBoth = exports.map = exports.liftThrowable = exports.liftPredicate = exports.liftOption = exports.liftNullable = exports.lift3 = exports.lift2 = exports.let = exports.isSuccess = exports.isFailure = exports.getValidatedApplicative = exports.getTraversableFilterable = exports.getSuccess = exports.getSemigroup = exports.getOrElse = exports.getFilterable = exports.getFailure = exports.getCompactable = exports.fromThrowable = exports.fromOption = exports.fromNullable = exports.foldMap = exports.flatten = exports.flatMapOption = exports.flatMapNullable = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.fail = exports.extend = exports.exists = exports.elem = exports.duplicate = exports.compact = exports.catchAll = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.ap = exports.Zip = exports.Traversable = exports.Succeed = exports.Monad = exports.Functor = exports.FromResult = exports.Flattenable = exports.Extendable = exports.Do = exports.Bifunctor = exports.Apply = exports.Applicative = void 0;
exports.zipWith = exports.zipRight = exports.zipLeft = exports.zipFlatten = exports.unit = exports.tupled = exports.traverseReadonlyArrayWithIndex = exports.traverseReadonlyArray = exports.traversePartitionMap = exports.traverseNonEmptyReadonlyArrayWithIndex = exports.traverseNonEmptyReadonlyArray = exports.traverseFilterMap = exports.traverse = exports.toUnion = exports.toUndefined = exports.toReadonlyArray = exports.toNull = exports.tapError = exports.tap = exports.succeed = exports.sequenceReadonlyArray = exports.sequence = exports.separate = exports.reverse = exports.reduceRight = exports.reduce = exports.partitionMap = exports.partition = exports.orElse = exports.match = exports.mapError = exports.mapBoth = exports.map = exports.liftThrowable = exports.liftPredicate = exports.liftOption = exports.liftNullable = exports.lift3 = exports.lift2 = exports.let = exports.isSuccess = exports.isFailure = exports.getValidatedMonoidal = exports.getTraversableFilterable = exports.getSuccess = exports.getSemigroup = exports.getOrElse = exports.getFilterable = exports.getFailure = exports.getCompactable = exports.fromThrowable = exports.fromOption = exports.fromNullable = exports.foldMap = exports.flatten = exports.flatMapOption = exports.flatMapNullable = exports.flatMap = exports.flap = exports.filterMap = exports.filter = exports.fail = exports.extend = exports.exists = exports.elem = exports.duplicate = exports.compact = exports.catchAll = exports.bindTo = exports.bindRight = exports.bind = exports.as = exports.ap = exports.Zip = exports.Traversable = exports.Succeed = exports.Semigroupal = exports.Monoidal = exports.Monad = exports.Functor = exports.FromResult = exports.FlatMap = exports.Extendable = exports.Do = exports.Bifunctor = void 0;
var bifunctor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Bifunctor"));
var flattenable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));
var flatMap_ = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/FlatMap"));

@@ -17,3 +17,3 @@ var functor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Functor"));

var apply = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));
var semigroupal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroupal"));

@@ -356,3 +356,3 @@ var traversable = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Traversable"));

* assert.deepStrictEqual(
* pipe(E.succeed(['a']), E.traverse(O.Applicative)(RA.head)),
* pipe(E.succeed(['a']), E.traverse(O.Monoidal)(RA.head)),
* O.some(E.succeed('a')),

@@ -362,3 +362,3 @@ * )

* assert.deepStrictEqual(
* pipe(E.succeed([]), E.traverse(O.Applicative)(RA.head)),
* pipe(E.succeed([]), E.traverse(O.Monoidal)(RA.head)),
* O.none,

@@ -373,3 +373,3 @@ * )

const traverse = F => f => ta => isFailure(ta) ? F.of(fail(ta.failure)) : (0, _Function.pipe)(f(ta.success), F.map(succeed));
const traverse = Monoidal => f => ta => isFailure(ta) ? Monoidal.of(fail(ta.failure)) : (0, _Function.pipe)(f(ta.success), Monoidal.map(succeed));
/**

@@ -452,6 +452,6 @@ * Semigroup returning the left-most non-`Failure` value. If both operands are `Success`es then the inner values are

const traverseFilterMap = Applicative => {
const traverse_ = traverse(Applicative);
const traverseFilterMap = Monoidal => {
const traverse_ = traverse(Monoidal);
return (f, onNone) => {
return (0, _Function.flow)(traverse_(f), Applicative.map(compact(onNone)));
return (0, _Function.flow)(traverse_(f), Monoidal.map(compact(onNone)));
};

@@ -467,6 +467,6 @@ };

const traversePartitionMap = Applicative => {
const traverse_ = traverse(Applicative);
const traversePartitionMap = Monoidal => {
const traverse_ = traverse(Monoidal);
return (f, onNone) => {
return (0, _Function.flow)(traverse_(f), Applicative.map(separate(onNone)));
return (0, _Function.flow)(traverse_(f), Monoidal.map(separate(onNone)));
};

@@ -484,8 +484,8 @@ };

return {
traverseFilterMap: Applicative => {
const traverseFilterMap_ = traverseFilterMap(Applicative);
traverseFilterMap: Monoidal => {
const traverseFilterMap_ = traverseFilterMap(Monoidal);
return f => traverseFilterMap_(f, onEmpty);
},
traversePartitionMap: Applicative => {
const traversePartitionMap_ = traversePartitionMap(Applicative);
traversePartitionMap: Monoidal => {
const traversePartitionMap_ = traversePartitionMap(Monoidal);
return f => traversePartitionMap_(f, onEmpty);

@@ -598,3 +598,3 @@ }

exports.flatten = flatten;
const Flattenable = {
const FlatMap = {
map,

@@ -611,4 +611,4 @@ flatMap

exports.Flattenable = Flattenable;
const zipLeft = /*#__PURE__*/flattenable.zipLeft(Flattenable);
exports.FlatMap = FlatMap;
const zipLeft = /*#__PURE__*/flatMap_.zipLeft(FlatMap);
/**

@@ -622,3 +622,3 @@ * A variant of `flatMap` that ignores the value produced by this effect.

exports.zipLeft = zipLeft;
const zipRight = /*#__PURE__*/flattenable.zipRight(Flattenable);
const zipRight = /*#__PURE__*/flatMap_.zipRight(FlatMap);
/**

@@ -641,3 +641,3 @@ * Sequentially zips this effect with the specified effect using the specified combiner function.

exports.zipWith = zipWith;
const Apply = {
const Semigroupal = {
map,

@@ -667,4 +667,4 @@ zipWith,

exports.Apply = Apply;
const ap = /*#__PURE__*/apply.ap(Apply);
exports.Semigroupal = Semigroupal;
const ap = /*#__PURE__*/semigroupal.ap(Semigroupal);
/**

@@ -678,3 +678,3 @@ * Lifts a binary function into `Result`.

exports.ap = ap;
const lift2 = /*#__PURE__*/apply.lift2(Apply);
const lift2 = /*#__PURE__*/semigroupal.lift2(Semigroupal);
/**

@@ -688,3 +688,3 @@ * Lifts a ternary function into `Result`.

exports.lift2 = lift2;
const lift3 = /*#__PURE__*/apply.lift3(Apply);
const lift3 = /*#__PURE__*/semigroupal.lift3(Semigroupal);
/**

@@ -696,7 +696,7 @@ * @category instances

exports.lift3 = lift3;
const Applicative = {
const Monoidal = {
map,
of: succeed,
zipMany: Apply.zipMany,
zipWith: Apply.zipWith,
zipMany: Semigroupal.zipMany,
zipWith: Semigroupal.zipWith,
zipAll: collection => {

@@ -717,7 +717,7 @@ const res = [];

/**
* The default [`Applicative`](#applicative) instance returns the first error, if you want to
* The default [`Monoidal`](#monoidal) instance returns the first error, if you want to
* get all errors you need to provide a way to combine them via a `Semigroup`.
*
* @exampleTodo
* import * as A from '@fp-ts/core/typeclasses/Apply'
* import * as A from '@fp-ts/core/typeclasses/Semigroupal'
* import * as E from '@fp-ts/core/data/Result'

@@ -750,7 +750,7 @@ * import { pipe } from '@fp-ts/core/data/Function'

*
* const Applicative = E.getValidatedApplicative(
* const Monoidal = E.getValidatedMonoidal(
* pipe(string.Semigroup, S.intercalate(', '))
* )
*
* const bindRight = A.bindRight(Applicative)
* const bindRight = A.bindRight(Monoidal)
*

@@ -772,5 +772,5 @@ * const parsePersonAll = (

exports.Applicative = Applicative;
exports.Monoidal = Monoidal;
const getValidatedApplicative = Semigroup => ({
const getValidatedMonoidal = Semigroup => ({
map,

@@ -848,3 +848,3 @@ of: succeed,

exports.getValidatedApplicative = getValidatedApplicative;
exports.getValidatedMonoidal = getValidatedMonoidal;
const Monad = {

@@ -880,3 +880,3 @@ map,

exports.tapError = tapError;
const tap = /*#__PURE__*/flattenable.tap(Flattenable);
const tap = /*#__PURE__*/flatMap_.tap(FlatMap);
/**

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

exports.liftOption = liftOption;
const filter = /*#__PURE__*/fromResult_.filter(FromResult, Flattenable);
const filter = /*#__PURE__*/fromResult_.filter(FromResult, FlatMap);
/**

@@ -1099,3 +1099,3 @@ * @category filtering

exports.filter = filter;
const filterMap = /*#__PURE__*/fromResult_.filterMap(FromResult, Flattenable);
const filterMap = /*#__PURE__*/fromResult_.filterMap(FromResult, FlatMap);
/**

@@ -1107,3 +1107,3 @@ * @category filtering

exports.filterMap = filterMap;
const partition = /*#__PURE__*/fromResult_.partition(FromResult, Flattenable);
const partition = /*#__PURE__*/fromResult_.partition(FromResult, FlatMap);
/**

@@ -1115,3 +1115,3 @@ * @category filtering

exports.partition = partition;
const partitionMap = /*#__PURE__*/fromResult_.partitionMap(FromResult, Flattenable);
const partitionMap = /*#__PURE__*/fromResult_.partitionMap(FromResult, FlatMap);
/**

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

exports.partitionMap = partitionMap;
const flatMapOption = /*#__PURE__*/fromResult_.flatMapOption(FromResult, Flattenable);
const flatMapOption = /*#__PURE__*/fromResult_.flatMapOption(FromResult, FlatMap);
/**

@@ -1179,3 +1179,3 @@ * Tests whether a value is a member of a `Result`.

*/
const bind = /*#__PURE__*/flattenable.bind(Flattenable);
const bind = /*#__PURE__*/flatMap_.bind(FlatMap);
/**

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

exports.bind = bind;
const bindRight = /*#__PURE__*/apply.bindRight(Apply); // -------------------------------------------------------------------------------------
const bindRight = /*#__PURE__*/semigroupal.bindRight(Semigroupal); // -------------------------------------------------------------------------------------
// tuple sequencing

@@ -1216,3 +1216,3 @@ // -------------------------------------------------------------------------------------

exports.tupled = tupled;
const zipFlatten = /*#__PURE__*/apply.zipFlatten(Apply); // -------------------------------------------------------------------------------------
const zipFlatten = /*#__PURE__*/semigroupal.zipFlatten(Semigroupal); // -------------------------------------------------------------------------------------
// array utils

@@ -1222,3 +1222,3 @@ // -------------------------------------------------------------------------------------

/**
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverseWithIndex(Semigroupal)`.
*

@@ -1253,3 +1253,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#traverseWithIndex(Applicative)`.
* Equivalent to `ReadonlyArray#traverseWithIndex(Monoidal)`.
*

@@ -1268,3 +1268,3 @@ * @category traversing

/**
* Equivalent to `NonEmptyReadonlyArray#traverse(Apply)`.
* Equivalent to `NonEmptyReadonlyArray#traverse(Semigroupal)`.
*

@@ -1282,3 +1282,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#traverse(Applicative)`.
* Equivalent to `ReadonlyArray#traverse(Monoidal)`.
*

@@ -1296,3 +1296,3 @@ * @category traversing

/**
* Equivalent to `ReadonlyArray#sequence(Applicative)`.
* Equivalent to `ReadonlyArray#sequence(Monoidal)`.
*

@@ -1299,0 +1299,0 @@ * @category traversing

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

*/
export declare const tuple: typeof SE.tuple;
export declare const tuple: <EN extends ReadonlyArray<SafeEval<any>>>(...args: EN & {
readonly 0: SafeEval<any>;
readonly 1: SafeEval<any>;
}) => SafeEval<Readonly<{
[K in keyof EN]: [EN[K]] extends [SafeEval<infer A>] ? A : never;
}>>;
/**

@@ -74,0 +79,0 @@ * @since 1.0.0

@@ -64,15 +64,3 @@ "use strict";

exports.suspend = suspend;
const struct = SE.struct; // TODO: If the type of `tuple` is annotated below, vitest throws the following error:
// ==>
// FAIL test/SafeEval.ts [ test/SafeEval.ts ]
// FAIL test/index.ts [ test/index.ts ]
// ❯ failureErrorWithLog node_modules/.pnpm/esbuild@0.15.11/node_modules/esbuild/lib/main.js:1566:15
// Error: Transform failed with 1 error:
// /workspace/data/src/SafeEval.ts:86:2: ERROR: Unexpected "..."
// ❯ node_modules/.pnpm/esbuild@0.15.11/node_modules/esbuild/lib/main.js:805:29
// ❯ responseCallbacks.<computed> node_modules/.pnpm/esbuild@0.15.11/node_modules/esbuild/lib/main.js:671:9
// ❯ handleIncomingPacket node_modules/.pnpm/esbuild@0.15.11/node_modules/esbuild/lib/main.js:726:9
// ❯ Socket.readFromStdout node_modules/.pnpm/esbuild@0.15.11/node_modules/esbuild/lib/main.js:647:7
// ❯ Socket.emit node:events:513:28
const struct = SE.struct;
/**

@@ -79,0 +67,0 @@ * Constructs a tuple of results from a tuple of `SafeEval`s.

@@ -12,4 +12,2 @@ "use strict";

var H = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Option"));

@@ -39,8 +37,8 @@

[H.symbol]() {
return this.tree[H.symbol]();
[Eq.symbolHash]() {
return (0, _Function.pipe)(Eq.hash(this.tree), Eq.hashCombine(Eq.hash("@fp-ts/data/SortedMap")));
}
[Eq.symbol](that) {
return isSortedMap(that) && this.tree[Eq.symbol](that.tree);
[Eq.symbolEqual](that) {
return isSortedMap(that) && Eq.equals(this.tree, that.tree);
}

@@ -47,0 +45,0 @@

@@ -12,4 +12,2 @@ "use strict";

var H = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var RBT = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/RedBlackTree"));

@@ -35,8 +33,8 @@

[H.symbol]() {
return this.keyTree[H.symbol]();
[Eq.symbolHash]() {
return (0, _Function.pipe)(Eq.hash(this.keyTree), Eq.hashCombine(Eq.hash("@fp-ts/data/SortedSet")));
}
[Eq.symbol](that) {
return isSortedSet(that) && this.keyTree[Eq.symbol](that.keyTree);
[Eq.symbolEqual](that) {
return isSortedSet(that) && Eq.equals(this.keyTree, that.keyTree);
}

@@ -43,0 +41,0 @@

@@ -56,5 +56,5 @@ /**

*
* assert.deepStrictEqual(pipe('a', S.Ord.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Ord.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Ord.compare('a')), 1)
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Sortable.compare('a')), 1)
*

@@ -64,3 +64,3 @@ * @category instances

*/
export declare const Ord: sortable.Sortable<string>;
export declare const Sortable: sortable.Sortable<string>;
/**

@@ -216,2 +216,68 @@ * @exampleTodo

export declare const endsWith: (searchString: string, position?: number) => (s: string) => boolean;
/**
* Keep the specified number of characters from the start of a string.
*
* If `n` is larger than the available number of characters, the string will
* be returned whole.
*
* If `n` is not a positive number, an empty string will be returned.
*
* If `n` is a float, it will be rounded down to the nearest integer.
*
* @since 1.0.0
*/
export declare const takeLeft: (n: number) => (self: string) => string;
/**
* Keep the specified number of characters from the end of a string.
*
* If `n` is larger than the available number of characters, the string will
* be returned whole.
*
* If `n` is not a positive number, an empty string will be returned.
*
* If `n` is a float, it will be rounded down to the nearest integer.
*
* @since 1.0.0
*/
export declare const takeRight: (n: number) => (s: string) => string;
/**
* Returns an `IterableIterator` which yields each line contained within the
* string, trimming off the trailing newline character.
*
* @since 1.0.0
*/
export declare const linesIterator: (self: string) => LinesIterator;
/**
* Returns an `IterableIterator` which yields each line contained within the
* string as well as the trailing newline character.
*
* @since 1.0.0
*/
export declare const linesWithSeparators: (s: string) => LinesIterator;
/**
* For every line in this string, strip a leading prefix consisting of blanks
* or control characters followed by the character specified by `marginChar`
* from the line.
*
* @since 1.0.0
*/
export declare const stripMarginWith: (marginChar: string) => (self: string) => string;
/**
* For every line in this string, strip a leading prefix consisting of blanks
* or control characters followed by the `"|"` character from the line.
*
* @since 1.0.0
*/
export declare const stripMargin: (self: string) => string;
declare class LinesIterator implements IterableIterator<string> {
readonly s: string;
readonly stripped: boolean;
private index;
private readonly length;
constructor(s: string, stripped?: boolean);
next(): IteratorResult<string>;
[Symbol.iterator](): IterableIterator<string>;
private get done();
}
export {};
//# sourceMappingURL=String.d.ts.map

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

});
exports.trimRight = exports.trimLeft = exports.trim = exports.toUpperCase = exports.toLowerCase = exports.startsWith = exports.split = exports.slice = exports.size = exports.replace = exports.isString = exports.isEmpty = exports.includes = exports.endsWith = exports.empty = exports.concatAll = exports.concat = exports.Semigroup = exports.Ord = exports.Monoid = void 0;
exports.trimRight = exports.trimLeft = exports.trim = exports.toUpperCase = exports.toLowerCase = exports.takeRight = exports.takeLeft = exports.stripMarginWith = exports.stripMargin = exports.startsWith = exports.split = exports.slice = exports.size = exports.replace = exports.linesWithSeparators = exports.linesIterator = exports.isString = exports.isEmpty = exports.includes = exports.endsWith = exports.empty = exports.concatAll = exports.concat = exports.Sortable = exports.Semigroup = exports.Monoid = void 0;

@@ -17,2 +17,5 @@ var semigroup = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/core/Semigroup"));

/**
* @since 1.0.0
*/
// -------------------------------------------------------------------------------------

@@ -84,5 +87,5 @@ // instances

*
* assert.deepStrictEqual(pipe('a', S.Ord.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Ord.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Ord.compare('a')), 1)
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('a')), 0)
* assert.deepStrictEqual(pipe('a', S.Sortable.compare('b')), -1)
* assert.deepStrictEqual(pipe('b', S.Sortable.compare('a')), 1)
*

@@ -94,3 +97,3 @@ * @category instances

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

@@ -112,3 +115,3 @@ }; // -------------------------------------------------------------------------------------

exports.Ord = Ord;
exports.Sortable = Sortable;

@@ -310,4 +313,171 @@ const isString = u => typeof u === "string";

const endsWith = (searchString, position) => s => s.endsWith(searchString, position);
/**
* Keep the specified number of characters from the start of a string.
*
* If `n` is larger than the available number of characters, the string will
* be returned whole.
*
* If `n` is not a positive number, an empty string will be returned.
*
* If `n` is a float, it will be rounded down to the nearest integer.
*
* @since 1.0.0
*/
exports.endsWith = endsWith;
const takeLeft = n => self => self.slice(0, Math.max(n, 0));
/**
* Keep the specified number of characters from the end of a string.
*
* If `n` is larger than the available number of characters, the string will
* be returned whole.
*
* If `n` is not a positive number, an empty string will be returned.
*
* If `n` is a float, it will be rounded down to the nearest integer.
*
* @since 1.0.0
*/
exports.takeLeft = takeLeft;
const takeRight = n => s => s.slice(Math.max(0, s.length - Math.floor(n)), Infinity);
exports.takeRight = takeRight;
const CR = 0x0d;
const LF = 0x0a;
/**
* Returns an `IterableIterator` which yields each line contained within the
* string, trimming off the trailing newline character.
*
* @since 1.0.0
*/
const linesIterator = self => linesSeparated(self, true);
/**
* Returns an `IterableIterator` which yields each line contained within the
* string as well as the trailing newline character.
*
* @since 1.0.0
*/
exports.linesIterator = linesIterator;
const linesWithSeparators = s => linesSeparated(s, false);
/**
* For every line in this string, strip a leading prefix consisting of blanks
* or control characters followed by the character specified by `marginChar`
* from the line.
*
* @since 1.0.0
*/
exports.linesWithSeparators = linesWithSeparators;
const stripMarginWith = marginChar => self => {
let out = "";
for (const line of linesWithSeparators(self)) {
let index = 0;
while (index < line.length && line.charAt(index) <= " ") {
index = index + 1;
}
const stripped = index < line.length && line.charAt(index) === marginChar ? line.substring(index + 1) : line;
out = out + stripped;
}
return out;
};
/**
* For every line in this string, strip a leading prefix consisting of blanks
* or control characters followed by the `"|"` character from the line.
*
* @since 1.0.0
*/
exports.stripMarginWith = stripMarginWith;
const stripMargin = self => stripMarginWith("|")(self);
exports.stripMargin = stripMargin;
class LinesIterator {
constructor(s, stripped = false) {
this.s = s;
this.stripped = stripped;
this.index = 0;
this.length = s.length;
}
next() {
if (this.done) {
return {
done: true,
value: undefined
};
}
const start = this.index;
while (!this.done && !isLineBreak(this.s[this.index])) {
this.index = this.index + 1;
}
let end = this.index;
if (!this.done) {
const char = this.s[this.index];
this.index = this.index + 1;
if (!this.done && isLineBreak2(char, this.s[this.index])) {
this.index = this.index + 1;
}
if (!this.stripped) {
end = this.index;
}
}
return {
done: false,
value: this.s.substring(start, end)
};
}
[Symbol.iterator]() {
return new LinesIterator(this.s, this.stripped);
}
get done() {
return this.index >= this.length;
}
}
/**
* Test if the provided character is a line break character (i.e. either `"\r"`
* or `"\n"`).
*/
const isLineBreak = char => {
const code = char.charCodeAt(0);
return code === CR || code === LF;
};
/**
* Test if the provided characters combine to form a carriage return/line-feed
* (i.e. `"\r\n"`).
*/
const isLineBreak2 = (char0, char1) => char0.charCodeAt(0) === CR && char1.charCodeAt(0) === LF;
const linesSeparated = (self, stripped) => new LinesIterator(self, stripped);
//# sourceMappingURL=String.js.map
/**
* `TraversableFilterable` represents data structures which can be _partitioned_ with effects in some `Applicative` functor.
* `TraversableFilterable` represents data structures which can be _partitioned_ with effects in some `Monoidal` functor.
*

@@ -32,7 +32,7 @@ * @since 1.0.0

*/
export declare const traverseFilter: <T extends TypeLambda>(TraversableFilterable: TraversableFilterable<T>) => <F extends TypeLambda>(Applicative: Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => <TS, TR, TO, TE>(self: Kind<T, TS, TR, TO, TE, B>) => Kind<F, S, R, O, E, Kind<T, TS, TR, TO, TE, B>>;
export declare const traverseFilter: <T extends TypeLambda>(TraversableFilterable: TraversableFilterable<T>) => <F extends TypeLambda>(Monoidal: Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => <TS, TR, TO, TE>(self: Kind<T, TS, TR, TO, TE, B>) => Kind<F, S, R, O, E, Kind<T, TS, TR, TO, TE, B>>;
/**
* @since 1.0.0
*/
export declare const traversePartition: <T extends TypeLambda>(TraversableFilterable: TraversableFilterable<T>) => <F extends TypeLambda>(Applicative: Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => <TS, TR, TO, TE>(self: Kind<T, TS, TR, TO, TE, B>) => Kind<F, S, R, O, E, readonly [Kind<T, TS, TR, TO, TE, B>, Kind<T, TS, TR, TO, TE, B>]>;
export declare const traversePartition: <T extends TypeLambda>(TraversableFilterable: TraversableFilterable<T>) => <F extends TypeLambda>(Monoidal: Monoidal<F>) => <B extends A, S, R, O, E, A = B>(predicate: (a: A) => Kind<F, S, R, O, E, boolean>) => <TS, TR, TO, TE>(self: Kind<T, TS, TR, TO, TE, B>) => Kind<F, S, R, O, E, readonly [Kind<T, TS, TR, TO, TE, B>, Kind<T, TS, TR, TO, TE, B>]>;
//# sourceMappingURL=TraversableFilterable.d.ts.map

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

*/
const traversePartitionMap = (Traversable, Functor, Compactable) => Applicative => f => (0, _Function.flow)(Traversable.traverse(Applicative)(f), Applicative.map(compactable.separate(Functor, Compactable)));
const traversePartitionMap = (Traversable, Functor, Compactable) => Monoidal => f => (0, _Function.flow)(Traversable.traverse(Monoidal)(f), Monoidal.map(compactable.separate(Functor, Compactable)));
/**

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

const traverseFilterMap = (Traversable, Compactable) => Applicative => f => (0, _Function.flow)(Traversable.traverse(Applicative)(f), Applicative.map(Compactable.compact));
const traverseFilterMap = (Traversable, Compactable) => Monoidal => f => (0, _Function.flow)(Traversable.traverse(Monoidal)(f), Monoidal.map(Compactable.compact));
/**

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

const traverseFilter = TraversableFilterable => Applicative => predicate => TraversableFilterable.traverseFilterMap(Applicative)(b => (0, _Function.pipe)(predicate(b), Applicative.map(ok => ok ? internal.some(b) : internal.none)));
const traverseFilter = TraversableFilterable => Monoidal => predicate => TraversableFilterable.traverseFilterMap(Monoidal)(b => (0, _Function.pipe)(predicate(b), Monoidal.map(ok => ok ? internal.some(b) : internal.none)));
/**

@@ -48,5 +48,5 @@ * @since 1.0.0

const traversePartition = TraversableFilterable => Applicative => predicate => TraversableFilterable.traversePartitionMap(Applicative)(b => (0, _Function.pipe)(predicate(b), Applicative.map(ok => ok ? internal.succeed(b) : internal.fail(b))));
const traversePartition = TraversableFilterable => Monoidal => predicate => TraversableFilterable.traversePartitionMap(Monoidal)(b => (0, _Function.pipe)(predicate(b), Monoidal.map(ok => ok ? internal.succeed(b) : internal.fail(b))));
exports.traversePartition = traversePartition;
//# sourceMappingURL=TraversableFilterable.js.map

@@ -12,4 +12,2 @@ "use strict";

var Hash = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Hash"));
var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fp-ts/data/Option"));

@@ -131,8 +129,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -238,8 +236,8 @@

[Equal.symbol](that) {
[Equal.symbolEqual](that) {
return this === that;
}
[Hash.symbol]() {
return Hash.random(this);
[Equal.symbolHash]() {
return Equal.hashRandom(this);
}

@@ -246,0 +244,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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