@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.
Files changed (93) hide show
  1. package/_cjs/collection/compat/Record/instances.cjs +1 -1
  2. package/_cjs/collection/weak/IterableWeakMap.cjs +7 -1
  3. package/_cjs/collection/weak/IterableWeakMap.cjs.map +1 -1
  4. package/_cjs/data/Branded/definition.cjs +10 -9
  5. package/_cjs/data/Branded/definition.cjs.map +1 -1
  6. package/_cjs/data/Decoder/api.cjs.map +1 -1
  7. package/_cjs/data/Decoder/definition.cjs +1 -0
  8. package/_cjs/data/Decoder/definition.cjs.map +1 -1
  9. package/_mjs/collection/compat/Record/instances.mjs +1 -1
  10. package/_mjs/collection/weak/IterableWeakMap.mjs +3 -1
  11. package/_mjs/collection/weak/IterableWeakMap.mjs.map +1 -1
  12. package/_mjs/data/Branded/definition.mjs +7 -6
  13. package/_mjs/data/Branded/definition.mjs.map +1 -1
  14. package/_mjs/data/Decoder/api.mjs.map +1 -1
  15. package/_mjs/data/Decoder/definition.mjs +1 -0
  16. package/_mjs/data/Decoder/definition.mjs.map +1 -1
  17. package/_src/collection/weak/IterableWeakMap.ts +1 -1
  18. package/_src/data/Branded/definition.ts +27 -24
  19. package/_src/data/Branded/derivations.ts +10 -10
  20. package/_src/data/Decoder/api.ts +1 -1
  21. package/_src/data/Decoder/definition.ts +2 -2
  22. package/_src/global.ts +1 -1
  23. package/collection/compat/Array/definition.d.ts +2 -2
  24. package/collection/compat/Array/derivations.d.ts +1 -1
  25. package/collection/compat/Record/instances.d.ts +1 -1
  26. package/collection/immutable/Conc/definition.d.ts +1 -1
  27. package/collection/immutable/Conc/derivations.d.ts +1 -1
  28. package/collection/immutable/HashMap/definition.d.ts +1 -1
  29. package/collection/immutable/HashMap/internal.d.ts +3 -3
  30. package/collection/immutable/HashSet/definition.d.ts +1 -1
  31. package/collection/immutable/ImmutableArray/definition.d.ts +1 -1
  32. package/collection/immutable/ImmutableArray/derivations.d.ts +1 -1
  33. package/collection/immutable/ImmutableNonEmptyArray/derivations.d.ts +1 -1
  34. package/collection/immutable/List/definition.d.ts +1 -1
  35. package/collection/immutable/RoseTree/definition.d.ts +1 -1
  36. package/collection/immutable/SortedMap/node.d.ts +2 -2
  37. package/collection/immutable/Vector/definition.d.ts +1 -1
  38. package/collection/immutable/Vector/internal.d.ts +2 -2
  39. package/collection/weak/IterableWeakMap.d.ts +1 -1
  40. package/control/Eval/definition.d.ts +2 -2
  41. package/control/Z/definition.d.ts +3 -3
  42. package/data/Branded/definition.d.ts +25 -22
  43. package/data/Branded/derivations.d.ts +7 -7
  44. package/data/Byte.d.ts +1 -1
  45. package/data/CaseClass.d.ts +1 -1
  46. package/data/Cause/definition.d.ts +2 -2
  47. package/data/Datum/definition.d.ts +2 -2
  48. package/data/DatumEither/definition.d.ts +1 -1
  49. package/data/DecodeError/definition.d.ts +1 -1
  50. package/data/Decoder/api.d.ts +1 -1
  51. package/data/Decoder/definition.d.ts +3 -3
  52. package/data/Duration/definition.d.ts +1 -1
  53. package/data/Either/definition.d.ts +1 -1
  54. package/data/Either/instances.d.ts +1 -1
  55. package/data/EitherT/definition.d.ts +1 -1
  56. package/data/Environment/api.d.ts +1 -1
  57. package/data/Environment/definition.d.ts +1 -1
  58. package/data/ExecutionStrategy.d.ts +1 -1
  59. package/data/Exit/definition.d.ts +2 -2
  60. package/data/FiberId/definition.d.ts +3 -3
  61. package/data/Maybe/definition.d.ts +1 -1
  62. package/data/Maybe/instances.d.ts +1 -1
  63. package/data/Patch/definition.d.ts +2 -2
  64. package/data/Struct/api.d.ts +5 -5
  65. package/data/Tag/definition.d.ts +1 -1
  66. package/data/These/definition.d.ts +2 -2
  67. package/data/These/instances.d.ts +1 -1
  68. package/data/TraceElement/definition.d.ts +1 -1
  69. package/data/Zipped.d.ts +2 -2
  70. package/data/exceptions/InterruptedException.d.ts +1 -1
  71. package/global.d.ts +1 -1
  72. package/json/EitherJson.d.ts +2 -2
  73. package/json/MaybeJson.d.ts +2 -2
  74. package/json/TheseJson.d.ts +2 -2
  75. package/optics/At/definition.d.ts +1 -1
  76. package/optics/Index/definition.d.ts +1 -1
  77. package/package.json +3 -3
  78. package/typeclass/Applicative.d.ts +1 -1
  79. package/typeclass/Apply.d.ts +2 -2
  80. package/typeclass/Equatable/fast-equals.d.ts +4 -4
  81. package/typeclass/Guard/definition.d.ts +1 -1
  82. package/typeclass/Has.d.ts +1 -1
  83. package/typeclass/HashEq.d.ts +1 -1
  84. package/typeclass/Monoid.d.ts +1 -1
  85. package/typeclass/Ordering.d.ts +1 -1
  86. package/typeclass/Showable/show.d.ts +4 -4
  87. package/typeclass/Showable/styles.d.ts +5 -5
  88. package/types/extractions.d.ts +8 -8
  89. package/types/utility.d.ts +4 -4
  90. package/util/PCGRandom.d.ts +2 -2
  91. package/util/predicates.d.ts +1 -1
  92. package/util/rand/distribution/Distribution.d.ts +1 -1
  93. package/util/rand/distribution/internals/ArrayInt.d.ts +2 -2
@@ -1,4 +1,4 @@
1
- declare type Cache = {
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 declare type EqualityComparator = (a: any, b: any, meta?: any) => boolean;
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
- declare type Dictionary<Type> = {
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
- declare type EqualityComparatorCreator = (fn: EqualityComparator) => EqualityComparator;
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 declare type GuardTypeId = typeof GuardTypeId;
5
+ export type GuardTypeId = typeof GuardTypeId;
6
6
  /**
7
7
  * @tsplus type fncts.Guard
8
8
  * @tsplus companion fncts.GuardOps
@@ -1,5 +1,5 @@
1
1
  export declare const HasTypeId: unique symbol;
2
- export declare type HasTypeId = typeof HasTypeId;
2
+ export type HasTypeId = typeof HasTypeId;
3
3
  /**
4
4
  * @tsplus type fncts.Has
5
5
  */
@@ -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 declare type HashEqMin<A> = Hash<A> & Eq<A>;
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"
@@ -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 declare type MonoidMin<A> = Semigroup<A> & {
16
+ export type MonoidMin<A> = Semigroup<A> & {
17
17
  readonly nat: A;
18
18
  };
19
19
  /**
@@ -1,4 +1,4 @@
1
- export declare type Ordering = -1 | 0 | 1;
1
+ export type Ordering = -1 | 0 | 1;
2
2
  /**
3
3
  * @tsplus static fncts.Ordering LT
4
4
  * @tsplus location "@fncts/base/typeclass/Ordering"
@@ -31,9 +31,9 @@ export interface ShowOptions {
31
31
  }
32
32
  export declare class ShowContext extends CaseClass<ShowContextArgs> {
33
33
  }
34
- export declare type ShowComputationZ<A> = Z<never, ShowContext, ShowContext, never, never, A>;
35
- export declare type ShowComputation = ShowComputationZ<string>;
36
- export declare type ShowComputationChunk = ShowComputationZ<Conc<string>>;
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 declare type ShowComputationExternal = ShowComputationPrimitive | ShowComputationComplex;
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 declare type Style = "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "bold" | "italic" | "underline";
2
- export declare type ShowGroup = "string" | "number" | "boolean" | "bigint" | "special" | "undefined" | "null" | "symbol" | "date" | "regexp" | "module" | "dim";
3
- export declare type ShowStyle = Record<ShowGroup, (s: string) => string>;
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 declare type StyleFunction = (str: string, group: ShowGroup) => string;
6
- export declare type GetStyle = (group: ShowGroup) => string;
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;
@@ -1,12 +1,12 @@
1
- export declare type ExtractContravariantPhantom<A, P extends PropertyKey> = [A] extends [{
1
+ export type ExtractContravariantPhantom<A, P extends PropertyKey> = [A] extends [{
2
2
  [K in P]: (_: infer T) => void;
3
3
  }] ? T : never;
4
- export declare type ExtractCovariantPhantom<A, P extends PropertyKey> = [A] extends [{
4
+ export type ExtractCovariantPhantom<A, P extends PropertyKey> = [A] extends [{
5
5
  [K in P]: () => infer T;
6
6
  }] ? T : never;
7
- export declare type _W<A> = ExtractCovariantPhantom<A, "_W">;
8
- export declare type _S1<A> = ExtractContravariantPhantom<A, "_S1">;
9
- export declare type _S2<A> = ExtractCovariantPhantom<A, "_S2">;
10
- export declare type _R<A> = ExtractCovariantPhantom<A, "_R">;
11
- export declare type _E<A> = ExtractCovariantPhantom<A, "_E">;
12
- export declare type _A<A> = ExtractCovariantPhantom<A, "_A">;
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">;
@@ -1,8 +1,8 @@
1
- export declare type Primitive = string | number | boolean | null | symbol;
2
- export declare type Constructor<A> = {
1
+ export type Primitive = string | number | boolean | null | symbol;
2
+ export type Constructor<A> = {
3
3
  new (...args: any[]): A;
4
4
  };
5
- export declare type Nullable<A> = A | null | undefined;
6
- export declare type IsInt<N extends number> = N & (`${N}` extends `${bigint}` ? N : never);
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
  }
@@ -1,6 +1,6 @@
1
1
  export declare function isNothing<T>(value: T | null | undefined): boolean;
2
- export declare type PCGRandomState = [number, number, number, number];
3
- export declare type OptionalNumber = number | null | undefined;
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.
@@ -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 declare type TypedArray = BigInt64Array | BigUint64Array | Float64Array | Float32Array | Int32Array | Int16Array | Int8Array | Uint32Array | Uint16Array | Uint8Array | Uint8ClampedArray;
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
- declare type Distribution<T> = (rng: RandomGenerator) => T;
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 declare type ArrayInt = {
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 declare type ArrayInt64 = Required<ArrayInt> & {
44
+ export type ArrayInt64 = Required<ArrayInt> & {
45
45
  data: [number, number];
46
46
  };
47
47
  /**