@fncts/base 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_cjs/collection/compat/Record/instances.cjs +1 -1
- package/_cjs/collection/weak/IterableWeakMap.cjs +7 -1
- package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
- package/_cjs/data/Branded/definition.cjs +10 -9
- package/_cjs/data/Branded/definition.cjs.map +1 -1
- package/_cjs/data/Decoder/api.cjs.map +1 -1
- package/_cjs/data/Decoder/definition.cjs +1 -0
- package/_cjs/data/Decoder/definition.cjs.map +1 -1
- package/_mjs/collection/compat/Record/instances.mjs +1 -1
- package/_mjs/collection/weak/IterableWeakMap.mjs +3 -1
- package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
- package/_mjs/data/Branded/definition.mjs +7 -6
- package/_mjs/data/Branded/definition.mjs.map +1 -1
- package/_mjs/data/Decoder/api.mjs.map +1 -1
- package/_mjs/data/Decoder/definition.mjs +1 -0
- package/_mjs/data/Decoder/definition.mjs.map +1 -1
- package/_src/collection/weak/IterableWeakMap.ts +1 -1
- package/_src/data/Branded/definition.ts +27 -24
- package/_src/data/Branded/derivations.ts +10 -10
- package/_src/data/Decoder/api.ts +1 -1
- package/_src/data/Decoder/definition.ts +2 -2
- package/_src/global.ts +1 -1
- package/collection/compat/Array/definition.d.ts +2 -2
- package/collection/compat/Array/derivations.d.ts +1 -1
- package/collection/compat/Record/instances.d.ts +1 -1
- package/collection/immutable/Conc/definition.d.ts +1 -1
- package/collection/immutable/Conc/derivations.d.ts +1 -1
- package/collection/immutable/HashMap/definition.d.ts +1 -1
- package/collection/immutable/HashMap/internal.d.ts +3 -3
- package/collection/immutable/HashSet/definition.d.ts +1 -1
- package/collection/immutable/ImmutableArray/definition.d.ts +1 -1
- package/collection/immutable/ImmutableArray/derivations.d.ts +1 -1
- package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +1 -1
- package/collection/immutable/List/definition.d.ts +1 -1
- package/collection/immutable/RoseTree/definition.d.ts +1 -1
- package/collection/immutable/SortedMap/node.d.ts +2 -2
- package/collection/immutable/Vector/definition.d.ts +1 -1
- package/collection/immutable/Vector/internal.d.ts +2 -2
- package/collection/weak/IterableWeakMap.d.ts +1 -1
- package/control/Eval/definition.d.ts +2 -2
- package/control/Z/definition.d.ts +3 -3
- package/data/Branded/definition.d.ts +25 -22
- package/data/Branded/derivations.d.ts +7 -7
- package/data/Byte.d.ts +1 -1
- package/data/CaseClass.d.ts +1 -1
- package/data/Cause/definition.d.ts +2 -2
- package/data/Datum/definition.d.ts +2 -2
- package/data/DatumEither/definition.d.ts +1 -1
- package/data/DecodeError/definition.d.ts +1 -1
- package/data/Decoder/api.d.ts +1 -1
- package/data/Decoder/definition.d.ts +3 -3
- package/data/Duration/definition.d.ts +1 -1
- package/data/Either/definition.d.ts +1 -1
- package/data/Either/instances.d.ts +1 -1
- package/data/EitherT/definition.d.ts +1 -1
- package/data/Environment/api.d.ts +1 -1
- package/data/Environment/definition.d.ts +1 -1
- package/data/ExecutionStrategy.d.ts +1 -1
- package/data/Exit/definition.d.ts +2 -2
- package/data/FiberId/definition.d.ts +3 -3
- package/data/Maybe/definition.d.ts +1 -1
- package/data/Maybe/instances.d.ts +1 -1
- package/data/Patch/definition.d.ts +2 -2
- package/data/Struct/api.d.ts +5 -5
- package/data/Tag/definition.d.ts +1 -1
- package/data/These/definition.d.ts +2 -2
- package/data/These/instances.d.ts +1 -1
- package/data/TraceElement/definition.d.ts +1 -1
- package/data/Zipped.d.ts +2 -2
- package/data/exceptions/InterruptedException.d.ts +1 -1
- package/global.d.ts +1 -1
- package/json/EitherJson.d.ts +2 -2
- package/json/MaybeJson.d.ts +2 -2
- package/json/TheseJson.d.ts +2 -2
- package/optics/At/definition.d.ts +1 -1
- package/optics/Index/definition.d.ts +1 -1
- package/package.json +3 -3
- package/typeclass/Applicative.d.ts +1 -1
- package/typeclass/Apply.d.ts +2 -2
- package/typeclass/Equatable/fast-equals.d.ts +4 -4
- package/typeclass/Guard/definition.d.ts +1 -1
- package/typeclass/Has.d.ts +1 -1
- package/typeclass/HashEq.d.ts +1 -1
- package/typeclass/Monoid.d.ts +1 -1
- package/typeclass/Ordering.d.ts +1 -1
- package/typeclass/Showable/show.d.ts +4 -4
- package/typeclass/Showable/styles.d.ts +5 -5
- package/types/extractions.d.ts +8 -8
- package/types/utility.d.ts +4 -4
- package/util/PCGRandom.d.ts +2 -2
- package/util/predicates.d.ts +1 -1
- package/util/rand/distribution/Distribution.d.ts +1 -1
- package/util/rand/distribution/internals/ArrayInt.d.ts +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type Cache = {
|
|
2
2
|
add: (value: any) => void;
|
|
3
3
|
has: (value: any) => boolean;
|
|
4
4
|
};
|
|
@@ -11,7 +11,7 @@ declare type Cache = {
|
|
|
11
11
|
* @param cache the cache to add to
|
|
12
12
|
*/
|
|
13
13
|
export declare function addToCache(value: any, cache: Cache): void;
|
|
14
|
-
export
|
|
14
|
+
export type EqualityComparator = (a: any, b: any, meta?: any) => boolean;
|
|
15
15
|
/**
|
|
16
16
|
* @function hasPair
|
|
17
17
|
*
|
|
@@ -156,7 +156,7 @@ export declare function areArraysEqual(a: any[], b: any[], isEqual: EqualityComp
|
|
|
156
156
|
* @returns are the maps equal
|
|
157
157
|
*/
|
|
158
158
|
export declare function areMapsEqual(a: Map<any, any>, b: Map<any, any>, isEqual: EqualityComparator, meta: any): boolean;
|
|
159
|
-
|
|
159
|
+
type Dictionary<Type> = {
|
|
160
160
|
[key: string]: Type;
|
|
161
161
|
[index: number]: Type;
|
|
162
162
|
};
|
|
@@ -197,6 +197,6 @@ export declare function areRegExpsEqual(a: RegExp, b: RegExp): boolean;
|
|
|
197
197
|
* @returns are the sets equal
|
|
198
198
|
*/
|
|
199
199
|
export declare function areSetsEqual(a: Set<any>, b: Set<any>, isEqual: EqualityComparator, meta: any): boolean;
|
|
200
|
-
|
|
200
|
+
type EqualityComparatorCreator = (fn: EqualityComparator) => EqualityComparator;
|
|
201
201
|
export declare function createComparator(createIsEqual?: EqualityComparatorCreator): (a: any, b: any, meta?: any) => boolean;
|
|
202
202
|
export {};
|
|
@@ -2,7 +2,7 @@ import { Refinement } from "@fncts/base/data/Refinement/definition";
|
|
|
2
2
|
export interface GuardF extends Guard<any> {
|
|
3
3
|
}
|
|
4
4
|
export declare const GuardTypeId: unique symbol;
|
|
5
|
-
export
|
|
5
|
+
export type GuardTypeId = typeof GuardTypeId;
|
|
6
6
|
/**
|
|
7
7
|
* @tsplus type fncts.Guard
|
|
8
8
|
* @tsplus companion fncts.GuardOps
|
package/typeclass/Has.d.ts
CHANGED
package/typeclass/HashEq.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface HashEq<A> extends Hash<A>, Eq<A> {
|
|
|
11
11
|
export interface HashEqOps {
|
|
12
12
|
}
|
|
13
13
|
export declare const HashEq: HashEqOps;
|
|
14
|
-
export
|
|
14
|
+
export type HashEqMin<A> = Hash<A> & Eq<A>;
|
|
15
15
|
/**
|
|
16
16
|
* @tsplus static fncts.HashEqOps __call
|
|
17
17
|
* @tsplus location "@fncts/base/typeclass/HashEq"
|
package/typeclass/Monoid.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface Monoid<A> extends Semigroup<A> {
|
|
|
13
13
|
export interface MonoidOps {
|
|
14
14
|
}
|
|
15
15
|
export declare const Monoid: MonoidOps;
|
|
16
|
-
export
|
|
16
|
+
export type MonoidMin<A> = Semigroup<A> & {
|
|
17
17
|
readonly nat: A;
|
|
18
18
|
};
|
|
19
19
|
/**
|
package/typeclass/Ordering.d.ts
CHANGED
|
@@ -31,9 +31,9 @@ export interface ShowOptions {
|
|
|
31
31
|
}
|
|
32
32
|
export declare class ShowContext extends CaseClass<ShowContextArgs> {
|
|
33
33
|
}
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
34
|
+
export type ShowComputationZ<A> = Z<never, ShowContext, ShowContext, never, never, A>;
|
|
35
|
+
export type ShowComputation = ShowComputationZ<string>;
|
|
36
|
+
export type ShowComputationChunk = ShowComputationZ<Conc<string>>;
|
|
37
37
|
export interface ShowComputationPrimitive {
|
|
38
38
|
readonly _tag: "Primitive";
|
|
39
39
|
readonly computation: ShowComputation;
|
|
@@ -48,7 +48,7 @@ export interface ShowComputationComplex {
|
|
|
48
48
|
braces?: [string, string];
|
|
49
49
|
}
|
|
50
50
|
export declare function showComputationComplex(args: Omit<ShowComputationComplex, "_tag">): ShowComputationComplex;
|
|
51
|
-
export
|
|
51
|
+
export type ShowComputationExternal = ShowComputationPrimitive | ShowComputationComplex;
|
|
52
52
|
export declare function show(value: unknown): string;
|
|
53
53
|
export declare function showWithOptions(value: unknown, options: Partial<ShowOptions>): string;
|
|
54
54
|
export declare function _show(value: unknown): ShowComputation;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type Style = "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "bold" | "italic" | "underline";
|
|
2
|
+
export type ShowGroup = "string" | "number" | "boolean" | "bigint" | "special" | "undefined" | "null" | "symbol" | "date" | "regexp" | "module" | "dim";
|
|
3
|
+
export type ShowStyle = Record<ShowGroup, (s: string) => string>;
|
|
4
4
|
export declare const defaultShowStyle: ShowStyle;
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type StyleFunction = (str: string, group: ShowGroup) => string;
|
|
6
|
+
export type GetStyle = (group: ShowGroup) => string;
|
|
7
7
|
export declare function stylizeWithColor(str: string, group: ShowGroup): string;
|
|
8
8
|
export declare function stylizeNoColor(str: string, _: ShowGroup): string;
|
package/types/extractions.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ExtractContravariantPhantom<A, P extends PropertyKey> = [A] extends [{
|
|
2
2
|
[K in P]: (_: infer T) => void;
|
|
3
3
|
}] ? T : never;
|
|
4
|
-
export
|
|
4
|
+
export type ExtractCovariantPhantom<A, P extends PropertyKey> = [A] extends [{
|
|
5
5
|
[K in P]: () => infer T;
|
|
6
6
|
}] ? T : never;
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
7
|
+
export type _W<A> = ExtractCovariantPhantom<A, "_W">;
|
|
8
|
+
export type _S1<A> = ExtractContravariantPhantom<A, "_S1">;
|
|
9
|
+
export type _S2<A> = ExtractCovariantPhantom<A, "_S2">;
|
|
10
|
+
export type _R<A> = ExtractCovariantPhantom<A, "_R">;
|
|
11
|
+
export type _E<A> = ExtractCovariantPhantom<A, "_E">;
|
|
12
|
+
export type _A<A> = ExtractCovariantPhantom<A, "_A">;
|
package/types/utility.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type Primitive = string | number | boolean | null | symbol;
|
|
2
|
+
export type Constructor<A> = {
|
|
3
3
|
new (...args: any[]): A;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type Nullable<A> = A | null | undefined;
|
|
6
|
+
export type IsInt<N extends number> = N & (`${N}` extends `${bigint}` ? N : never);
|
|
7
7
|
export interface Spreadable extends Record<PropertyKey, any> {
|
|
8
8
|
}
|
package/util/PCGRandom.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function isNothing<T>(value: T | null | undefined): boolean;
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type PCGRandomState = [number, number, number, number];
|
|
3
|
+
export type OptionalNumber = number | null | undefined;
|
|
4
4
|
/**
|
|
5
5
|
* PCG is a family of simple fast space-efficient statistically good algorithms for random number generation. Unlike
|
|
6
6
|
* many general-purpose RNGs, they are also hard to predict.
|
package/util/predicates.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare function isPromise(u: unknown): u is Promise<unknown>;
|
|
|
29
29
|
export declare function isSet(u: unknown): u is Set<unknown>;
|
|
30
30
|
export declare function isWeakSet(u: unknown): u is WeakSet<object>;
|
|
31
31
|
export declare function isDate(u: unknown): u is Date;
|
|
32
|
-
export
|
|
32
|
+
export type TypedArray = BigInt64Array | BigUint64Array | Float64Array | Float32Array | Int32Array | Int16Array | Int8Array | Uint32Array | Uint16Array | Uint8Array | Uint8ClampedArray;
|
|
33
33
|
export declare function isTypedArray(u: unknown): u is TypedArray;
|
|
34
34
|
export declare function isRegExp(u: unknown): u is RegExp;
|
|
35
35
|
export declare function isAnyArrayBuffer(u: unknown): u is ArrayBuffer | SharedArrayBuffer;
|
|
@@ -4,6 +4,6 @@ import type { RandomGenerator } from "@fncts/base/util/rand/generator/RandomGene
|
|
|
4
4
|
* Return the generated value and an offsetted version of the RandomGenerator.
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
type Distribution<T> = (rng: RandomGenerator) => T;
|
|
8
8
|
export default Distribution;
|
|
9
9
|
export { Distribution };
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* { sign: -1, data: [ 1, 5, 42 ] } // = -1 * (1 * 2**64 + 5 * 2**32 + 42)
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type ArrayInt = {
|
|
14
14
|
/**
|
|
15
15
|
* Sign of the represented number
|
|
16
16
|
*/
|
|
@@ -41,7 +41,7 @@ export declare function substractArrayIntToNew(arrayIntA: ArrayInt, arrayIntB: A
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function trimArrayIntInplace(arrayInt: ArrayInt): ArrayInt;
|
|
43
43
|
/** @internal */
|
|
44
|
-
export
|
|
44
|
+
export type ArrayInt64 = Required<ArrayInt> & {
|
|
45
45
|
data: [number, number];
|
|
46
46
|
};
|
|
47
47
|
/**
|