functype 0.2.0 → 0.4.0

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 (155) hide show
  1. package/dist/chunk-2XH6TPQK.mjs +1 -0
  2. package/dist/chunk-4P46BMZQ.js +1 -0
  3. package/dist/chunk-7JTQ2BTE.mjs +1 -0
  4. package/dist/chunk-CPB6NX2S.js +1 -0
  5. package/dist/chunk-GZIDEEAG.mjs +1 -0
  6. package/dist/chunk-HF33BEHO.js +1 -0
  7. package/dist/chunk-LLZGG3YT.js +1 -0
  8. package/dist/chunk-LO5XBCIY.js +1 -0
  9. package/dist/chunk-OLJYBLCT.js +1 -0
  10. package/dist/chunk-Q4H3PCBH.mjs +0 -0
  11. package/dist/chunk-S5YAJ7CP.mjs +1 -0
  12. package/dist/chunk-SPNWCOGV.mjs +1 -0
  13. package/dist/chunk-UVR6IELR.mjs +1 -0
  14. package/dist/chunk-V2J3R5IU.mjs +0 -0
  15. package/dist/chunk-V5UFW2E4.js +1 -0
  16. package/dist/chunk-WMSIRQ3W.mjs +1 -0
  17. package/dist/chunk-XVHCBGUW.js +1 -0
  18. package/dist/chunk-ZOH672YH.js +1 -0
  19. package/dist/collections/index.d.mts +2 -4
  20. package/dist/collections/index.d.ts +2 -4
  21. package/dist/either/Either.d.mts +3 -0
  22. package/dist/either/Either.d.ts +3 -0
  23. package/dist/either/Either.js +1 -0
  24. package/dist/either/Either.mjs +1 -0
  25. package/dist/either/index.d.mts +3 -44
  26. package/dist/either/index.d.ts +3 -44
  27. package/dist/either/index.js +1 -1
  28. package/dist/either/index.mjs +1 -1
  29. package/dist/error/ParseError.js +1 -1
  30. package/dist/error/ParseError.mjs +1 -1
  31. package/dist/functor/index.d.mts +13 -13
  32. package/dist/functor/index.d.ts +13 -13
  33. package/dist/functor/index.js +1 -1
  34. package/dist/functor/index.mjs +1 -0
  35. package/dist/index-BSx1ncJ9.d.ts +231 -0
  36. package/dist/index-uP_Hoh2D.d.mts +231 -0
  37. package/dist/index.d.mts +3 -13
  38. package/dist/index.d.ts +3 -13
  39. package/dist/index.js +1 -1
  40. package/dist/index.mjs +1 -0
  41. package/dist/iterable/Seq.d.mts +2 -28
  42. package/dist/iterable/Seq.d.ts +2 -28
  43. package/dist/iterable/Seq.js +1 -1
  44. package/dist/iterable/Seq.mjs +1 -1
  45. package/dist/iterable/index.d.mts +2 -2
  46. package/dist/iterable/index.d.ts +2 -2
  47. package/dist/iterable/index.js +1 -1
  48. package/dist/iterable/index.mjs +1 -0
  49. package/dist/list/List.d.mts +2 -24
  50. package/dist/list/List.d.ts +2 -24
  51. package/dist/list/List.js +1 -1
  52. package/dist/list/List.mjs +1 -1
  53. package/dist/list/index.d.mts +2 -11
  54. package/dist/list/index.d.ts +2 -11
  55. package/dist/list/index.js +1 -1
  56. package/dist/list/index.mjs +1 -1
  57. package/dist/map/Map.d.mts +2 -6
  58. package/dist/map/Map.d.ts +2 -6
  59. package/dist/map/Map.js +1 -1
  60. package/dist/map/Map.mjs +1 -1
  61. package/dist/map/index.d.mts +2 -37
  62. package/dist/map/index.d.ts +2 -37
  63. package/dist/map/index.js +1 -1
  64. package/dist/map/index.mjs +1 -1
  65. package/dist/map/shim.d.mts +1 -1
  66. package/dist/map/shim.d.ts +1 -1
  67. package/dist/map/shim.js +1 -1
  68. package/dist/map/shim.mjs +1 -1
  69. package/dist/option/Option.d.mts +3 -0
  70. package/dist/option/Option.d.ts +3 -0
  71. package/dist/option/Option.js +1 -0
  72. package/dist/option/Option.mjs +1 -0
  73. package/dist/option/index.d.mts +2 -8
  74. package/dist/option/index.d.ts +2 -8
  75. package/dist/option/index.js +1 -1
  76. package/dist/option/index.mjs +1 -1
  77. package/dist/set/Set.d.mts +2 -19
  78. package/dist/set/Set.d.ts +2 -19
  79. package/dist/set/Set.js +1 -1
  80. package/dist/set/Set.mjs +1 -1
  81. package/dist/set/index.d.mts +2 -4
  82. package/dist/set/index.d.ts +2 -4
  83. package/dist/set/index.js +1 -1
  84. package/dist/set/index.mjs +1 -0
  85. package/dist/set/shim.d.mts +1 -1
  86. package/dist/set/shim.d.ts +1 -1
  87. package/dist/set/shim.js +1 -1
  88. package/dist/set/shim.mjs +1 -1
  89. package/dist/try/Try.d.mts +2 -29
  90. package/dist/try/Try.d.ts +2 -29
  91. package/dist/try/Try.js +1 -1
  92. package/dist/try/Try.mjs +1 -1
  93. package/dist/try/index.d.mts +3 -0
  94. package/dist/try/index.d.ts +3 -0
  95. package/dist/try/index.js +1 -0
  96. package/dist/try/index.mjs +1 -0
  97. package/dist/tuple/Tuple.d.mts +19 -2
  98. package/dist/tuple/Tuple.d.ts +19 -2
  99. package/dist/tuple/Tuple.js +1 -1
  100. package/dist/tuple/Tuple.mjs +1 -1
  101. package/dist/tuple/index.d.mts +2 -20
  102. package/dist/tuple/index.d.ts +2 -20
  103. package/dist/tuple/index.js +1 -1
  104. package/dist/tuple/index.mjs +1 -1
  105. package/dist/util/index.d.mts +2 -8
  106. package/dist/util/index.d.ts +2 -8
  107. package/dist/util/index.js +1 -1
  108. package/dist/util/index.mjs +1 -1
  109. package/dist/util/isIterable.js +1 -1
  110. package/dist/util/isIterable.mjs +1 -1
  111. package/package.json +17 -17
  112. package/dist/chunk-35Y3S46C.js +0 -1
  113. package/dist/chunk-5OCPRWBH.mjs +0 -1
  114. package/dist/chunk-5RNU6GKU.mjs +0 -1
  115. package/dist/chunk-5SPJ52B5.js +0 -1
  116. package/dist/chunk-5XVNJUCA.js +0 -1
  117. package/dist/chunk-AGJ7VCYK.mjs +0 -1
  118. package/dist/chunk-AU3JU6VY.js +0 -1
  119. package/dist/chunk-FBZLCLTN.mjs +0 -1
  120. package/dist/chunk-L4P3MMUC.mjs +0 -1
  121. package/dist/chunk-NBPFHDR5.js +0 -1
  122. package/dist/chunk-SSP26X5Y.js +0 -1
  123. package/dist/chunk-V5DD7UJW.mjs +0 -1
  124. package/dist/chunk-VM6KG6UB.mjs +0 -1
  125. package/dist/chunk-ZQB7I77M.js +0 -1
  126. package/dist/either/Left.d.mts +0 -9
  127. package/dist/either/Left.d.ts +0 -9
  128. package/dist/either/Left.js +0 -1
  129. package/dist/either/Left.mjs +0 -1
  130. package/dist/either/Right.d.mts +0 -9
  131. package/dist/either/Right.d.ts +0 -9
  132. package/dist/either/Right.js +0 -1
  133. package/dist/either/Right.mjs +0 -1
  134. package/dist/index-18491592.d.ts +0 -33
  135. package/dist/index-3628fb7a.d.ts +0 -15
  136. package/dist/index-64357013.d.ts +0 -33
  137. package/dist/index-8434e22f.d.ts +0 -15
  138. package/dist/list/IList.d.mts +0 -9
  139. package/dist/list/IList.d.ts +0 -9
  140. package/dist/option/IOption.d.mts +0 -3
  141. package/dist/option/IOption.d.ts +0 -3
  142. package/dist/option/None.d.mts +0 -21
  143. package/dist/option/None.d.ts +0 -21
  144. package/dist/option/None.js +0 -1
  145. package/dist/option/None.mjs +0 -1
  146. package/dist/option/Some.d.mts +0 -23
  147. package/dist/option/Some.d.ts +0 -23
  148. package/dist/option/Some.js +0 -1
  149. package/dist/option/Some.mjs +0 -1
  150. /package/dist/{list/IList.mjs → chunk-3OHJLCSR.mjs} +0 -0
  151. /package/dist/{list/IList.js → chunk-6BEXQNLZ.js} +0 -0
  152. /package/dist/{option/IOption.mjs → chunk-74TKYQJS.mjs} +0 -0
  153. /package/dist/{chunk-VTKL7OQI.js → chunk-D22QKJZO.js} +0 -0
  154. /package/dist/{chunk-U5EUM74A.mjs → chunk-U37JTC3U.mjs} +0 -0
  155. /package/dist/{option/IOption.js → chunk-XORABVON.js} +0 -0
@@ -0,0 +1,3 @@
1
+ import '../functor/index.mjs';
2
+ export { N as None, S as Some, _ as _Option_ } from '../index-uP_Hoh2D.mjs';
3
+ import '../tuple/Tuple.mjs';
@@ -0,0 +1,3 @@
1
+ import '../functor/index.js';
2
+ export { N as None, S as Some, _ as _Option_ } from '../index-BSx1ncJ9.js';
3
+ import '../tuple/Tuple.js';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLO5XBCIYjs = require('../chunk-LO5XBCIY.js');require('../chunk-BNNK42JC.js');require('../chunk-D22QKJZO.js');exports.None = _chunkLO5XBCIYjs.b; exports.Some = _chunkLO5XBCIYjs.a;
@@ -0,0 +1 @@
1
+ import{a,b}from"../chunk-WMSIRQ3W.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U37JTC3U.mjs";export{b as None,a as Some};
@@ -1,9 +1,3 @@
1
- import { I as IOption } from '../index-18491592.js';
1
+ export { N as None, S as Some, _ as _Option_, n as none, o as option, s as some } from '../index-uP_Hoh2D.mjs';
2
2
  import '../functor/index.mjs';
3
- import '../index.mjs';
4
-
5
- declare const option: <T extends unknown>(value?: T | undefined) => IOption<T>;
6
- declare const some: <T extends unknown>(value: T) => IOption<T>;
7
- declare const none: <T extends unknown>() => IOption<T>;
8
-
9
- export { none, option, some };
3
+ import '../tuple/Tuple.mjs';
@@ -1,9 +1,3 @@
1
- import { I as IOption } from '../index-64357013.js';
1
+ export { N as None, S as Some, _ as _Option_, n as none, o as option, s as some } from '../index-BSx1ncJ9.js';
2
2
  import '../functor/index.js';
3
- import '../index.js';
4
-
5
- declare const option: <T extends unknown>(value?: T | undefined) => IOption<T>;
6
- declare const some: <T extends unknown>(value: T) => IOption<T>;
7
- declare const none: <T extends unknown>() => IOption<T>;
8
-
9
- export { none, option, some };
3
+ import '../tuple/Tuple.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAU3JU6VYjs = require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.none = _chunkAU3JU6VYjs.f; exports.option = _chunkAU3JU6VYjs.d; exports.some = _chunkAU3JU6VYjs.e;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLO5XBCIYjs = require('../chunk-LO5XBCIY.js');require('../chunk-BNNK42JC.js');require('../chunk-D22QKJZO.js');exports.None = _chunkLO5XBCIYjs.b; exports.Some = _chunkLO5XBCIYjs.a; exports.none = _chunkLO5XBCIYjs.e; exports.option = _chunkLO5XBCIYjs.c; exports.some = _chunkLO5XBCIYjs.d;
@@ -1 +1 @@
1
- import{d as a,e as b,f as c}from"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{c as none,a as option,b as some};
1
+ import{a,b,c,d,e}from"../chunk-WMSIRQ3W.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U37JTC3U.mjs";export{b as None,a as Some,e as none,c as option,d as some};
@@ -1,20 +1,3 @@
1
- import { I as ISet } from '../index-3628fb7a.js';
2
- import { Seq } from '../iterable/Seq.mjs';
3
- import { a as IIterable } from '../index-18491592.js';
4
- import { IList } from '../list/IList.mjs';
1
+ export { d as Set, c as _Set_ } from '../index-uP_Hoh2D.mjs';
5
2
  import '../functor/index.mjs';
6
- import '../index.mjs';
7
-
8
- declare class Set<A> extends Seq<A> implements ISet<A> {
9
- constructor(iterable?: Iterable<A>);
10
- add(value: A): Set<A>;
11
- remove(value: A): Set<A>;
12
- contains(value: A): boolean;
13
- has(value: A): boolean;
14
- map<B>(f: (a: A) => B): Set<B>;
15
- flatMap<B>(f: (a: A) => IIterable<B>): Set<B>;
16
- toList(): IList<A>;
17
- toSet(): ISet<A>;
18
- }
19
-
20
- export { Set };
3
+ import '../tuple/Tuple.mjs';
package/dist/set/Set.d.ts CHANGED
@@ -1,20 +1,3 @@
1
- import { I as ISet } from '../index-8434e22f.js';
2
- import { Seq } from '../iterable/Seq.js';
3
- import { a as IIterable } from '../index-64357013.js';
4
- import { IList } from '../list/IList.js';
1
+ export { d as Set, c as _Set_ } from '../index-BSx1ncJ9.js';
5
2
  import '../functor/index.js';
6
- import '../index.js';
7
-
8
- declare class Set<A> extends Seq<A> implements ISet<A> {
9
- constructor(iterable?: Iterable<A>);
10
- add(value: A): Set<A>;
11
- remove(value: A): Set<A>;
12
- contains(value: A): boolean;
13
- has(value: A): boolean;
14
- map<B>(f: (a: A) => B): Set<B>;
15
- flatMap<B>(f: (a: A) => IIterable<B>): Set<B>;
16
- toList(): IList<A>;
17
- toSet(): ISet<A>;
18
- }
19
-
20
- export { Set };
3
+ import '../tuple/Tuple.js';
package/dist/set/Set.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk35Y3S46Cjs = require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Set = _chunk35Y3S46Cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCPB6NX2Sjs = require('../chunk-CPB6NX2S.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-LO5XBCIY.js');require('../chunk-BNNK42JC.js');require('../chunk-D22QKJZO.js');exports.Set = _chunkCPB6NX2Sjs.a;
package/dist/set/Set.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"../chunk-FBZLCLTN.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{a as Set};
1
+ import{a}from"../chunk-UVR6IELR.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-WMSIRQ3W.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U37JTC3U.mjs";export{a as Set};
@@ -1,5 +1,3 @@
1
- import '../index-18491592.js';
2
- export { I as ISet } from '../index-3628fb7a.js';
1
+ export { d as Set, c as _Set_ } from '../index-uP_Hoh2D.mjs';
3
2
  import '../functor/index.mjs';
4
- import '../index.mjs';
5
- import '../list/IList.mjs';
3
+ import '../tuple/Tuple.mjs';
@@ -1,5 +1,3 @@
1
- import '../index-64357013.js';
2
- export { I as ISet } from '../index-8434e22f.js';
1
+ export { d as Set, c as _Set_ } from '../index-BSx1ncJ9.js';
3
2
  import '../functor/index.js';
4
- import '../index.js';
5
- import '../list/IList.js';
3
+ import '../tuple/Tuple.js';
package/dist/set/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCPB6NX2Sjs = require('../chunk-CPB6NX2S.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-LO5XBCIY.js');require('../chunk-BNNK42JC.js');require('../chunk-D22QKJZO.js');exports.Set = _chunkCPB6NX2Sjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-UVR6IELR.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-WMSIRQ3W.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U37JTC3U.mjs";export{a as Set};
@@ -1,4 +1,4 @@
1
1
  type IESSet<T> = Set<T>;
2
2
  declare const ESSet: SetConstructor;
3
3
 
4
- export { ESSet, IESSet };
4
+ export { ESSet, type IESSet };
@@ -1,4 +1,4 @@
1
1
  type IESSet<T> = Set<T>;
2
2
  declare const ESSet: SetConstructor;
3
3
 
4
- export { ESSet, IESSet };
4
+ export { ESSet, type IESSet };
package/dist/set/shim.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VJERXBPjs = require('../chunk-3VJERXBP.js');require('../chunk-VTKL7OQI.js');exports.ESSet = _chunk3VJERXBPjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VJERXBPjs = require('../chunk-3VJERXBP.js');require('../chunk-D22QKJZO.js');exports.ESSet = _chunk3VJERXBPjs.a;
package/dist/set/shim.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"../chunk-HA5XD5KC.mjs";import"../chunk-U5EUM74A.mjs";export{a as ESSet};
1
+ import{a}from"../chunk-HA5XD5KC.mjs";import"../chunk-U37JTC3U.mjs";export{a as ESSet};
@@ -1,30 +1,3 @@
1
- import { Either } from '../either/index.mjs';
2
- import '../list/List.mjs';
3
- import '../index-18491592.js';
1
+ export { T as Try, j as _Try_ } from '../index-uP_Hoh2D.mjs';
4
2
  import '../functor/index.mjs';
5
- import '../index.mjs';
6
- import '../iterable/Seq.mjs';
7
- import '../index-3628fb7a.js';
8
- import '../list/IList.mjs';
9
- import '../set/Set.mjs';
10
-
11
- interface ITry<T> {
12
- isSuccess(): boolean;
13
- isFailure(): boolean;
14
- getOrElse(defaultValue: T): T;
15
- orElse(alternative: ITry<T>): ITry<T>;
16
- toEither(): Either<Error, T>;
17
- }
18
- declare class Try<T> implements ITry<T> {
19
- private readonly value;
20
- private readonly error;
21
- private constructor();
22
- static of<T>(f: () => T): Try<T>;
23
- isSuccess(): boolean;
24
- isFailure(): boolean;
25
- getOrElse(defaultValue: T): T;
26
- orElse(alternative: ITry<T>): ITry<T>;
27
- toEither(): Either<Error, T>;
28
- }
29
-
30
- export { Try };
3
+ import '../tuple/Tuple.mjs';
package/dist/try/Try.d.ts CHANGED
@@ -1,30 +1,3 @@
1
- import { Either } from '../either/index.js';
2
- import '../list/List.js';
3
- import '../index-64357013.js';
1
+ export { T as Try, j as _Try_ } from '../index-BSx1ncJ9.js';
4
2
  import '../functor/index.js';
5
- import '../index.js';
6
- import '../iterable/Seq.js';
7
- import '../index-8434e22f.js';
8
- import '../list/IList.js';
9
- import '../set/Set.js';
10
-
11
- interface ITry<T> {
12
- isSuccess(): boolean;
13
- isFailure(): boolean;
14
- getOrElse(defaultValue: T): T;
15
- orElse(alternative: ITry<T>): ITry<T>;
16
- toEither(): Either<Error, T>;
17
- }
18
- declare class Try<T> implements ITry<T> {
19
- private readonly value;
20
- private readonly error;
21
- private constructor();
22
- static of<T>(f: () => T): Try<T>;
23
- isSuccess(): boolean;
24
- isFailure(): boolean;
25
- getOrElse(defaultValue: T): T;
26
- orElse(alternative: ITry<T>): ITry<T>;
27
- toEither(): Either<Error, T>;
28
- }
29
-
30
- export { Try };
3
+ import '../tuple/Tuple.js';
package/dist/try/Try.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-5SPJ52B5.js');var _chunkZQB7I77Mjs = require('../chunk-ZQB7I77M.js');var _chunk5XVNJUCAjs = require('../chunk-5XVNJUCA.js');require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');var _chunkVTKL7OQIjs = require('../chunk-VTKL7OQI.js');var o=class s{constructor(r,e){_chunkVTKL7OQIjs.a.call(void 0, this,"value");_chunkVTKL7OQIjs.a.call(void 0, this,"error");this.value=r,this.error=e}static of(r){try{return new s(r(),null)}catch(e){return new s(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new (0, _chunk5XVNJUCAjs.a)(this.value):new (0, _chunkZQB7I77Mjs.a)(this.error)}};exports.Try = o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOLJYBLCTjs = require('../chunk-OLJYBLCT.js');require('../chunk-LLZGG3YT.js');require('../chunk-HF33BEHO.js');require('../chunk-CPB6NX2S.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-LO5XBCIY.js');require('../chunk-BNNK42JC.js');require('../chunk-D22QKJZO.js');exports.Try = _chunkOLJYBLCTjs.a;
package/dist/try/Try.mjs CHANGED
@@ -1 +1 @@
1
- import"../chunk-AGJ7VCYK.mjs";import{a as l}from"../chunk-L4P3MMUC.mjs";import{a as i}from"../chunk-5OCPRWBH.mjs";import"../chunk-FBZLCLTN.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import{a as t}from"../chunk-U5EUM74A.mjs";var o=class s{constructor(r,e){t(this,"value");t(this,"error");this.value=r,this.error=e}static of(r){try{return new s(r(),null)}catch(e){return new s(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new i(this.value):new l(this.error)}};export{o as Try};
1
+ import{a}from"../chunk-SPNWCOGV.mjs";import"../chunk-GZIDEEAG.mjs";import"../chunk-S5YAJ7CP.mjs";import"../chunk-UVR6IELR.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-WMSIRQ3W.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U37JTC3U.mjs";export{a as Try};
@@ -0,0 +1,3 @@
1
+ export { T as Try, j as _Try_ } from '../index-uP_Hoh2D.mjs';
2
+ import '../functor/index.mjs';
3
+ import '../tuple/Tuple.mjs';
@@ -0,0 +1,3 @@
1
+ export { T as Try, j as _Try_ } from '../index-BSx1ncJ9.js';
2
+ import '../functor/index.js';
3
+ import '../tuple/Tuple.js';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6BEXQNLZ.js');var _chunkOLJYBLCTjs = require('../chunk-OLJYBLCT.js');require('../chunk-LLZGG3YT.js');require('../chunk-HF33BEHO.js');require('../chunk-CPB6NX2S.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-LO5XBCIY.js');require('../chunk-BNNK42JC.js');require('../chunk-D22QKJZO.js');exports.Try = _chunkOLJYBLCTjs.a;
@@ -0,0 +1 @@
1
+ import"../chunk-Q4H3PCBH.mjs";import{a}from"../chunk-SPNWCOGV.mjs";import"../chunk-GZIDEEAG.mjs";import"../chunk-S5YAJ7CP.mjs";import"../chunk-UVR6IELR.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-WMSIRQ3W.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U37JTC3U.mjs";export{a as Try};
@@ -1,2 +1,19 @@
1
- export { Tuple } from './index.mjs';
2
- import '../functor/index.mjs';
1
+ import { ArrayType, _ArrayFunctor_ } from '../functor/index.mjs';
2
+
3
+ type _Tuple_<T extends ArrayType> = _ArrayFunctor_<T> & {
4
+ get(index: number): T[number];
5
+ getAs<U>(index: number, f?: (item: T) => boolean): U;
6
+ map<U extends any[]>(f: (value: T) => U): _Tuple_<U>;
7
+ flatMap<U extends any[]>(f: (value: T) => _Tuple_<U>): _Tuple_<U>;
8
+ };
9
+ declare class Tuple<T extends ArrayType> implements _Tuple_<T> {
10
+ private readonly values;
11
+ constructor(values: T);
12
+ map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
13
+ flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
14
+ get(index: number): T[number];
15
+ getAs<U>(index: number, f?: (item: T) => boolean): U;
16
+ toArray(): T;
17
+ }
18
+
19
+ export { Tuple, type _Tuple_ };
@@ -1,2 +1,19 @@
1
- export { Tuple } from './index.js';
2
- import '../functor/index.js';
1
+ import { ArrayType, _ArrayFunctor_ } from '../functor/index.js';
2
+
3
+ type _Tuple_<T extends ArrayType> = _ArrayFunctor_<T> & {
4
+ get(index: number): T[number];
5
+ getAs<U>(index: number, f?: (item: T) => boolean): U;
6
+ map<U extends any[]>(f: (value: T) => U): _Tuple_<U>;
7
+ flatMap<U extends any[]>(f: (value: T) => _Tuple_<U>): _Tuple_<U>;
8
+ };
9
+ declare class Tuple<T extends ArrayType> implements _Tuple_<T> {
10
+ private readonly values;
11
+ constructor(values: T);
12
+ map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
13
+ flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
14
+ get(index: number): T[number];
15
+ getAs<U>(index: number, f?: (item: T) => boolean): U;
16
+ toArray(): T;
17
+ }
18
+
19
+ export { Tuple, type _Tuple_ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSSP26X5Yjs = require('../chunk-SSP26X5Y.js');require('../chunk-VTKL7OQI.js');exports.Tuple = _chunkSSP26X5Yjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkV5UFW2E4js = require('../chunk-V5UFW2E4.js');require('../chunk-D22QKJZO.js');exports.Tuple = _chunkV5UFW2E4js.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-VM6KG6UB.mjs";import"../chunk-U5EUM74A.mjs";export{a as Tuple};
1
+ import{a}from"../chunk-2XH6TPQK.mjs";import"../chunk-U37JTC3U.mjs";export{a as Tuple};
@@ -1,20 +1,2 @@
1
- import { ArrayType, IArrayFunctor } from '../functor/index.mjs';
2
-
3
- declare class Tuple<T extends ArrayType> implements ITuple<T> {
4
- private readonly values;
5
- constructor(values: T);
6
- map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
7
- flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
8
- get(index: number): T[number];
9
- getAs<U>(index: number, f?: (item: T) => boolean): U;
10
- toArray(): T;
11
- }
12
-
13
- interface ITuple<T extends ArrayType> extends IArrayFunctor<T> {
14
- get(index: number): T[number];
15
- getAs<U>(index: number, f?: (item: T) => boolean): U;
16
- map<U extends any[]>(f: (value: T) => U): ITuple<U>;
17
- flatMap<U extends any[]>(f: (value: T) => ITuple<U>): ITuple<U>;
18
- }
19
-
20
- export { ITuple, Tuple };
1
+ export { Tuple, _Tuple_ } from './Tuple.mjs';
2
+ import '../functor/index.mjs';
@@ -1,20 +1,2 @@
1
- import { ArrayType, IArrayFunctor } from '../functor/index.js';
2
-
3
- declare class Tuple<T extends ArrayType> implements ITuple<T> {
4
- private readonly values;
5
- constructor(values: T);
6
- map<U extends ArrayType>(f: (value: T) => U): Tuple<U>;
7
- flatMap<U extends ArrayType>(f: (value: T) => Tuple<U>): Tuple<U>;
8
- get(index: number): T[number];
9
- getAs<U>(index: number, f?: (item: T) => boolean): U;
10
- toArray(): T;
11
- }
12
-
13
- interface ITuple<T extends ArrayType> extends IArrayFunctor<T> {
14
- get(index: number): T[number];
15
- getAs<U>(index: number, f?: (item: T) => boolean): U;
16
- map<U extends any[]>(f: (value: T) => U): ITuple<U>;
17
- flatMap<U extends any[]>(f: (value: T) => ITuple<U>): ITuple<U>;
18
- }
19
-
20
- export { ITuple, Tuple };
1
+ export { Tuple, _Tuple_ } from './Tuple.js';
2
+ import '../functor/index.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-TVZBBVEV.js');var _chunkSSP26X5Yjs = require('../chunk-SSP26X5Y.js');require('../chunk-VTKL7OQI.js');exports.Tuple = _chunkSSP26X5Yjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-TVZBBVEV.js');var _chunkV5UFW2E4js = require('../chunk-V5UFW2E4.js');require('../chunk-D22QKJZO.js');exports.Tuple = _chunkV5UFW2E4js.a;
@@ -1 +1 @@
1
- import"../chunk-LBQXRIXP.mjs";import{a}from"../chunk-VM6KG6UB.mjs";import"../chunk-U5EUM74A.mjs";export{a as Tuple};
1
+ import"../chunk-LBQXRIXP.mjs";import{a}from"../chunk-2XH6TPQK.mjs";import"../chunk-U37JTC3U.mjs";export{a as Tuple};
@@ -1,13 +1,7 @@
1
1
  import { ParseError } from '../error/ParseError.mjs';
2
- import { Either } from '../either/index.mjs';
3
- import '../list/List.mjs';
4
- import '../index-18491592.js';
2
+ import { E as Either } from '../index-uP_Hoh2D.mjs';
5
3
  import '../functor/index.mjs';
6
- import '../index.mjs';
7
- import '../iterable/Seq.mjs';
8
- import '../index-3628fb7a.js';
9
- import '../list/IList.mjs';
10
- import '../set/Set.mjs';
4
+ import '../tuple/Tuple.mjs';
11
5
 
12
6
  declare const parseNumber: (input: string) => Either<ParseError, number>;
13
7
 
@@ -1,13 +1,7 @@
1
1
  import { ParseError } from '../error/ParseError.js';
2
- import { Either } from '../either/index.js';
3
- import '../list/List.js';
4
- import '../index-64357013.js';
2
+ import { E as Either } from '../index-BSx1ncJ9.js';
5
3
  import '../functor/index.js';
6
- import '../index.js';
7
- import '../iterable/Seq.js';
8
- import '../index-8434e22f.js';
9
- import '../list/IList.js';
10
- import '../set/Set.js';
4
+ import '../tuple/Tuple.js';
11
5
 
12
6
  declare const parseNumber: (input: string) => Either<ParseError, number>;
13
7
 
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5SPJ52B5js = require('../chunk-5SPJ52B5.js');require('../chunk-ZQB7I77M.js');require('../chunk-5XVNJUCA.js');require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');var _chunkZTL76QDLjs = require('../chunk-ZTL76QDL.js');require('../chunk-VTKL7OQI.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunk5SPJ52B5js.a.call(void 0, new (0, _chunkZTL76QDLjs.a)(`${r}`)):_chunk5SPJ52B5js.b.call(void 0, r)};exports.parseNumber = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLLZGG3YTjs = require('../chunk-LLZGG3YT.js');require('../chunk-HF33BEHO.js');require('../chunk-CPB6NX2S.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-LO5XBCIY.js');require('../chunk-BNNK42JC.js');var _chunkZTL76QDLjs = require('../chunk-ZTL76QDL.js');require('../chunk-D22QKJZO.js');var n=s=>{let r=parseInt(s,10);return isNaN(r)?_chunkLLZGG3YTjs.a.call(void 0, new (0, _chunkZTL76QDLjs.a)(`${r}`)):_chunkLLZGG3YTjs.b.call(void 0, r)};exports.parseNumber = n;
@@ -1 +1 @@
1
- import{a as e,b as t}from"../chunk-AGJ7VCYK.mjs";import"../chunk-L4P3MMUC.mjs";import"../chunk-5OCPRWBH.mjs";import"../chunk-FBZLCLTN.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import{a as s}from"../chunk-CFYIJKWF.mjs";import"../chunk-U5EUM74A.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?e(new s(`${r}`)):t(r)};export{a as parseNumber};
1
+ import{a as e,b as t}from"../chunk-GZIDEEAG.mjs";import"../chunk-S5YAJ7CP.mjs";import"../chunk-UVR6IELR.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-WMSIRQ3W.mjs";import"../chunk-RRAIFS3D.mjs";import{a as o}from"../chunk-CFYIJKWF.mjs";import"../chunk-U37JTC3U.mjs";var n=s=>{let r=parseInt(s,10);return isNaN(r)?e(new o(`${r}`)):t(r)};export{n as parseNumber};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.isIterable = _chunkBNNK42JCjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('../chunk-BNNK42JC.js');require('../chunk-D22QKJZO.js');exports.isIterable = _chunkBNNK42JCjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{a as isIterable};
1
+ import{a}from"../chunk-RRAIFS3D.mjs";import"../chunk-U37JTC3U.mjs";export{a as isIterable};
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "functype",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "A smallish functional library for TypeScript",
5
5
  "author": "jordan.burke@gmail.com",
6
6
  "license": "MIT",
7
7
  "url": "https://github.com/jordanburke/TypeScript/tree/main/functype",
8
8
  "devDependencies": {
9
- "@types/node": "^18.17.5",
10
- "@typescript-eslint/eslint-plugin": "^6.5.0",
11
- "@typescript-eslint/parser": "^6.5.0",
12
- "@types/jest": "29.5.4",
9
+ "@types/node": "^20.12.8",
10
+ "@typescript-eslint/eslint-plugin": "^7.5.0",
11
+ "@typescript-eslint/parser": "^7.5.0",
12
+ "@types/jest": "29.5.12",
13
13
  "cross-env": "^7.0.3",
14
- "eslint": "^8.48.0",
15
- "eslint-config-prettier": "^9.0.0",
16
- "eslint-plugin-import": "^2.28.1",
17
- "eslint-plugin-prettier": "^5.0.0",
18
- "eslint-plugin-simple-import-sort": "^10.0.0",
19
- "jest": "29.6.4",
20
- "prettier": "^3.0.3",
21
- "rimraf": "^5.0.1",
22
- "tsup": "^7.2.0",
23
- "ts-jest": "^29.1.1",
24
- "ts-node": "^10.9.1",
25
- "typescript": "^5.1.6"
14
+ "eslint": "^8.57.0",
15
+ "eslint-config-prettier": "^9.1.0",
16
+ "eslint-plugin-import": "^2.29.1",
17
+ "eslint-plugin-prettier": "^5.1.3",
18
+ "eslint-plugin-simple-import-sort": "^12.0.0",
19
+ "jest": "29.7.0",
20
+ "prettier": "^3.2.5",
21
+ "rimraf": "^5.0.5",
22
+ "tsup": "^8.0.2",
23
+ "ts-jest": "^29.1.2",
24
+ "ts-node": "^10.9.2",
25
+ "typescript": "^5.4.5"
26
26
  },
27
27
  "main": "./dist/index.js",
28
28
  "module": "./dist/index.mjs",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var n=class r extends _chunkAU3JU6VYjs.a{constructor(t){super(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}remove(t){let i=new r().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new r(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let e=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new r(e)}get(t){return _chunkAU3JU6VYjs.d.call(void 0, this.toArray()[t])}concat(t){return new r([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new s(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var s=class r extends _chunkAU3JU6VYjs.a{constructor(t){super(new (0, _chunk3VJERXBPjs.a)(t))}add(t){return new r([...this.values,t])}remove(t){let e=new _chunk3VJERXBPjs.a;return e.delete(t)?new r(e):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}toList(){return new n(this.toArray())}toSet(){return this}};exports.a = s; exports.b = n;
@@ -1 +0,0 @@
1
- import{b as r}from"./chunk-FBZLCLTN.mjs";import{e}from"./chunk-5RNU6GKU.mjs";var i=class s{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new s(t(this.value))}flatMap(t){return t(this.value)}toOption(){return e(this.value)}toList(){return new r([this.value])}};export{i as a};
@@ -1 +0,0 @@
1
- import{a as l}from"./chunk-RRAIFS3D.mjs";import{a as p}from"./chunk-U5EUM74A.mjs";var a=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}};var i=class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};var s=t=>t?f(t):A(),f=t=>new a(t),A=()=>new i;var n=class t{constructor(e){p(this,"values");l(e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let o=e(u);o instanceof t&&r.push(...o.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):A()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,o)=>r(o,u),e)}};export{n as a,a as b,i as c,s as d,f as e,A as f};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZQB7I77Mjs = require('./chunk-ZQB7I77M.js');var _chunk5XVNJUCAjs = require('./chunk-5XVNJUCA.js');var L=t=>new (0, _chunkZQB7I77Mjs.a)(t),R= exports.b =t=>new (0, _chunk5XVNJUCAjs.a)(t);exports.a = L; exports.b = R;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk35Y3S46Cjs = require('./chunk-35Y3S46C.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var i=class s{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new s(t(this.value))}flatMap(t){return t(this.value)}toOption(){return _chunkAU3JU6VYjs.e.call(void 0, this.value)}toList(){return new (0, _chunk35Y3S46Cjs.b)([this.value])}};exports.a = i;
@@ -1 +0,0 @@
1
- import{a as i}from"./chunk-L4P3MMUC.mjs";import{a as r}from"./chunk-5OCPRWBH.mjs";var L=t=>new i(t),R=t=>new r(t);export{L as a,R as b};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunkVTKL7OQIjs = require('./chunk-VTKL7OQI.js');var a=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}};var i=class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};var s=t=>t?f(t):A(),f= exports.e =t=>new a(t),A= exports.f =()=>new i;var n=class t{constructor(e){_chunkVTKL7OQIjs.a.call(void 0, this,"values");_chunkBNNK42JCjs.a.call(void 0, e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let o=e(u);o instanceof t&&r.push(...o.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):A()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,o)=>r(o,u),e)}};exports.a = n; exports.b = a; exports.c = i; exports.d = s; exports.e = f; exports.f = A;
@@ -1 +0,0 @@
1
- import{a}from"./chunk-HA5XD5KC.mjs";import{a as o,d as A}from"./chunk-5RNU6GKU.mjs";var n=class r extends o{constructor(t){super(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}remove(t){let i=new r().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new r(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let e=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new r(e)}get(t){return A(this.toArray()[t])}concat(t){return new r([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new s(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var s=class r extends o{constructor(t){super(new a(t))}add(t){return new r([...this.values,t])}remove(t){let e=new a;return e.delete(t)?new r(e):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}toList(){return new n(this.toArray())}toSet(){return this}};export{s as a,n as b};
@@ -1 +0,0 @@
1
- import{b as e}from"./chunk-FBZLCLTN.mjs";import{f as i}from"./chunk-5RNU6GKU.mjs";var o=class t{constructor(r){this.value=r}isLeft(){return!0}isRight(){return!1}map(r){return new t(this.value)}flatMap(r){return new t(this.value)}toOption(){return i()}toList(){return new e}};export{o as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSSP26X5Yjs = require('./chunk-SSP26X5Y.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk35Y3S46Cjs = require('./chunk-35Y3S46C.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var _chunkVTKL7OQIjs = require('./chunk-VTKL7OQI.js');var o=class s{constructor(e){_chunkVTKL7OQIjs.a.call(void 0, this,"values");this.values=new (0, _chunk5VTXJIR3js.a)(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new (0, _chunkSSP26X5Yjs.a)([e,t]))}add(e){return new s(this.values.set(e[0],e[1]).entries())}remove(e){let t=new s([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){let t=[];for(let[r,u]of this.values.entries())t.push([r,e(u)]);return new s(t)}flatMap(e){let t=[];for(let[r,u]of this.values.entries()){let a=e(u);if(a instanceof s)for(let[f,c]of a.values.entries())t.push([f,c])}return new s(t)}reduce(e){return new (0, _chunkAU3JU6VYjs.a)(this.entries).reduce(e)}reduceRight(e){return new (0, _chunkAU3JU6VYjs.a)(this.entries).reduceRight(e)}foldLeft(e){let t=new (0, _chunkAU3JU6VYjs.a)(this.entries);return r=>t.foldLeft(e)(r)}foldRight(e){let t=new (0, _chunkAU3JU6VYjs.a)(this.entries);return r=>t.foldRight(e)(r)}get(e){return _chunkAU3JU6VYjs.d.call(void 0, this.values.get(e))}getOrElse(e,t){return _chunkAU3JU6VYjs.d.call(void 0, this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let r=_chunkAU3JU6VYjs.d.call(void 0, this.values.get(e));return t}toList(){return new (0, _chunk35Y3S46Cjs.b)(this.entries)}toSet(){return new (0, _chunk35Y3S46Cjs.a)(this.entries)}},M=new o([["a",1],["b",2],["c",3]]);exports.a = o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var t=class s{constructor(e){this.values=e}map(e){let r=e(this.values);return new s(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let a=this.values[e];if(r){if(r(this.values))return a;throw new Error("Cannot cast tuple value")}else return a}toArray(){return this.values}};exports.a = t;
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-VM6KG6UB.mjs";import{a as V}from"./chunk-377WQNCB.mjs";import{a as p,b as K}from"./chunk-FBZLCLTN.mjs";import{a as n,d as i}from"./chunk-5RNU6GKU.mjs";import{a as l}from"./chunk-U5EUM74A.mjs";var o=class s{constructor(e){l(this,"values");this.values=new V(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new m([e,t]))}add(e){return new s(this.values.set(e[0],e[1]).entries())}remove(e){let t=new s([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){let t=[];for(let[r,u]of this.values.entries())t.push([r,e(u)]);return new s(t)}flatMap(e){let t=[];for(let[r,u]of this.values.entries()){let a=e(u);if(a instanceof s)for(let[f,c]of a.values.entries())t.push([f,c])}return new s(t)}reduce(e){return new n(this.entries).reduce(e)}reduceRight(e){return new n(this.entries).reduceRight(e)}foldLeft(e){let t=new n(this.entries);return r=>t.foldLeft(e)(r)}foldRight(e){let t=new n(this.entries);return r=>t.foldRight(e)(r)}get(e){return i(this.values.get(e))}getOrElse(e,t){return i(this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let r=i(this.values.get(e));return t}toList(){return new K(this.entries)}toSet(){return new p(this.entries)}},M=new o([["a",1],["b",2],["c",3]]);export{o as a};
@@ -1 +0,0 @@
1
- var t=class s{constructor(e){this.values=e}map(e){let r=e(this.values);return new s(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let a=this.values[e];if(r){if(r(this.values))return a;throw new Error("Cannot cast tuple value")}else return a}toArray(){return this.values}};export{t as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk35Y3S46Cjs = require('./chunk-35Y3S46C.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var o=class t{constructor(r){this.value=r}isLeft(){return!0}isRight(){return!1}map(r){return new t(this.value)}flatMap(r){return new t(this.value)}toOption(){return _chunkAU3JU6VYjs.f.call(void 0, )}toList(){return new _chunk35Y3S46Cjs.b}};exports.a = o;
@@ -1,9 +0,0 @@
1
- export { Left } from './index.mjs';
2
- import '../list/List.mjs';
3
- import '../index-18491592.js';
4
- import '../functor/index.mjs';
5
- import '../iterable/Seq.mjs';
6
- import '../index.mjs';
7
- import '../index-3628fb7a.js';
8
- import '../list/IList.mjs';
9
- import '../set/Set.mjs';
@@ -1,9 +0,0 @@
1
- export { Left } from './index.js';
2
- import '../list/List.js';
3
- import '../index-64357013.js';
4
- import '../functor/index.js';
5
- import '../iterable/Seq.js';
6
- import '../index.js';
7
- import '../index-8434e22f.js';
8
- import '../list/IList.js';
9
- import '../set/Set.js';
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZQB7I77Mjs = require('../chunk-ZQB7I77M.js');require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Left = _chunkZQB7I77Mjs.a;
@@ -1 +0,0 @@
1
- import{a}from"../chunk-L4P3MMUC.mjs";import"../chunk-FBZLCLTN.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{a as Left};
@@ -1,9 +0,0 @@
1
- export { Right } from './index.mjs';
2
- import '../list/List.mjs';
3
- import '../index-18491592.js';
4
- import '../functor/index.mjs';
5
- import '../iterable/Seq.mjs';
6
- import '../index.mjs';
7
- import '../index-3628fb7a.js';
8
- import '../list/IList.mjs';
9
- import '../set/Set.mjs';
@@ -1,9 +0,0 @@
1
- export { Right } from './index.js';
2
- import '../list/List.js';
3
- import '../index-64357013.js';
4
- import '../functor/index.js';
5
- import '../iterable/Seq.js';
6
- import '../index.js';
7
- import '../index-8434e22f.js';
8
- import '../list/IList.js';
9
- import '../set/Set.js';
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5XVNJUCAjs = require('../chunk-5XVNJUCA.js');require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Right = _chunk5XVNJUCAjs.a;