@lsby/ts-fp-data 0.2.2 → 0.2.4
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/dist/cjs/data/either.cjs +12 -0
- package/dist/cjs/data/either.d.cts +6 -0
- package/dist/cjs/data/task.cjs +12 -0
- package/dist/cjs/func/seq.cjs +12 -0
- package/dist/cjs/index.cjs +12 -0
- package/dist/esm/{chunk-IWR6QS6U.js → chunk-BKOGTDCP.js} +2 -2
- package/dist/esm/{chunk-7HK3EH67.js → chunk-E3TSSKMR.js} +1 -1
- package/dist/esm/{chunk-MUPBOWCK.js → chunk-XGZ7K75X.js} +12 -0
- package/dist/esm/data/either.d.ts +6 -0
- package/dist/esm/data/either.js +1 -1
- package/dist/esm/data/task.js +2 -2
- package/dist/esm/func/seq.js +3 -3
- package/dist/esm/index.js +8 -8
- package/package.json +1 -1
package/dist/cjs/data/either.cjs
CHANGED
|
@@ -155,6 +155,12 @@ var Left = class _Left extends Either {
|
|
|
155
155
|
toMaybe() {
|
|
156
156
|
return new Nothing();
|
|
157
157
|
}
|
|
158
|
+
try() {
|
|
159
|
+
throw this.\u503C;
|
|
160
|
+
}
|
|
161
|
+
tryAndWrap() {
|
|
162
|
+
throw new Error(String(this.\u503C));
|
|
163
|
+
}
|
|
158
164
|
};
|
|
159
165
|
var Right = class _Right extends Either {
|
|
160
166
|
constructor(\u503C) {
|
|
@@ -200,6 +206,12 @@ var Right = class _Right extends Either {
|
|
|
200
206
|
toMaybe() {
|
|
201
207
|
return new Just(this.\u503C);
|
|
202
208
|
}
|
|
209
|
+
try() {
|
|
210
|
+
return this.\u503C;
|
|
211
|
+
}
|
|
212
|
+
tryAndWrap() {
|
|
213
|
+
return this.\u503C;
|
|
214
|
+
}
|
|
203
215
|
};
|
|
204
216
|
// Annotate the CommonJS export names for ESM import in node:
|
|
205
217
|
0 && (module.exports = {
|
|
@@ -19,6 +19,8 @@ declare abstract class Either<L, R> {
|
|
|
19
19
|
abstract match<X>(onLeft: (a: L) => X, onRight: (a: R) => X): X;
|
|
20
20
|
abstract mplus(a: Either<L, R>): Either<L, R>;
|
|
21
21
|
abstract toMaybe(): Maybe<R>;
|
|
22
|
+
abstract try(): R;
|
|
23
|
+
abstract tryAndWrap(): R;
|
|
22
24
|
}
|
|
23
25
|
declare class Left<L, R> extends Either<L, R> {
|
|
24
26
|
private 值;
|
|
@@ -36,6 +38,8 @@ declare class Left<L, R> extends Either<L, R> {
|
|
|
36
38
|
match<X>(onLeft: (a: L) => X, _onRight: (a: R) => X): X;
|
|
37
39
|
mplus(a: Either<L, R>): Either<L, R>;
|
|
38
40
|
toMaybe(): Maybe<R>;
|
|
41
|
+
try(): R;
|
|
42
|
+
tryAndWrap(): R;
|
|
39
43
|
}
|
|
40
44
|
declare class Right<L, R> extends Either<L, R> {
|
|
41
45
|
private 值;
|
|
@@ -53,6 +57,8 @@ declare class Right<L, R> extends Either<L, R> {
|
|
|
53
57
|
match<X>(_onLeft: (a: L) => X, onRight: (a: R) => X): X;
|
|
54
58
|
mplus(_a: Either<L, R>): Either<L, R>;
|
|
55
59
|
toMaybe(): Maybe<R>;
|
|
60
|
+
try(): R;
|
|
61
|
+
tryAndWrap(): R;
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
export { Either, Left, Right, type 任意Either, type 计算右值们, type 计算左值们 };
|
package/dist/cjs/data/task.cjs
CHANGED
|
@@ -154,6 +154,12 @@ var Left = class _Left extends Either {
|
|
|
154
154
|
toMaybe() {
|
|
155
155
|
return new Nothing();
|
|
156
156
|
}
|
|
157
|
+
try() {
|
|
158
|
+
throw this.\u503C;
|
|
159
|
+
}
|
|
160
|
+
tryAndWrap() {
|
|
161
|
+
throw new Error(String(this.\u503C));
|
|
162
|
+
}
|
|
157
163
|
};
|
|
158
164
|
var Right = class _Right extends Either {
|
|
159
165
|
constructor(\u503C) {
|
|
@@ -199,6 +205,12 @@ var Right = class _Right extends Either {
|
|
|
199
205
|
toMaybe() {
|
|
200
206
|
return new Just(this.\u503C);
|
|
201
207
|
}
|
|
208
|
+
try() {
|
|
209
|
+
return this.\u503C;
|
|
210
|
+
}
|
|
211
|
+
tryAndWrap() {
|
|
212
|
+
return this.\u503C;
|
|
213
|
+
}
|
|
202
214
|
};
|
|
203
215
|
|
|
204
216
|
// src/data/task.ts
|
package/dist/cjs/func/seq.cjs
CHANGED
|
@@ -161,6 +161,12 @@ var Left = class _Left extends Either {
|
|
|
161
161
|
toMaybe() {
|
|
162
162
|
return new Nothing();
|
|
163
163
|
}
|
|
164
|
+
try() {
|
|
165
|
+
throw this.\u503C;
|
|
166
|
+
}
|
|
167
|
+
tryAndWrap() {
|
|
168
|
+
throw new Error(String(this.\u503C));
|
|
169
|
+
}
|
|
164
170
|
};
|
|
165
171
|
var Right = class _Right extends Either {
|
|
166
172
|
constructor(\u503C) {
|
|
@@ -206,6 +212,12 @@ var Right = class _Right extends Either {
|
|
|
206
212
|
toMaybe() {
|
|
207
213
|
return new Just(this.\u503C);
|
|
208
214
|
}
|
|
215
|
+
try() {
|
|
216
|
+
return this.\u503C;
|
|
217
|
+
}
|
|
218
|
+
tryAndWrap() {
|
|
219
|
+
return this.\u503C;
|
|
220
|
+
}
|
|
209
221
|
};
|
|
210
222
|
|
|
211
223
|
// src/data/task.ts
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -172,6 +172,12 @@ var Left = class _Left extends Either {
|
|
|
172
172
|
toMaybe() {
|
|
173
173
|
return new Nothing();
|
|
174
174
|
}
|
|
175
|
+
try() {
|
|
176
|
+
throw this.\u503C;
|
|
177
|
+
}
|
|
178
|
+
tryAndWrap() {
|
|
179
|
+
throw new Error(String(this.\u503C));
|
|
180
|
+
}
|
|
175
181
|
};
|
|
176
182
|
var Right = class _Right extends Either {
|
|
177
183
|
constructor(\u503C) {
|
|
@@ -217,6 +223,12 @@ var Right = class _Right extends Either {
|
|
|
217
223
|
toMaybe() {
|
|
218
224
|
return new Just(this.\u503C);
|
|
219
225
|
}
|
|
226
|
+
try() {
|
|
227
|
+
return this.\u503C;
|
|
228
|
+
}
|
|
229
|
+
tryAndWrap() {
|
|
230
|
+
return this.\u503C;
|
|
231
|
+
}
|
|
220
232
|
};
|
|
221
233
|
|
|
222
234
|
// src/data/lazy.ts
|
|
@@ -60,6 +60,12 @@ var Left = class _Left extends Either {
|
|
|
60
60
|
toMaybe() {
|
|
61
61
|
return new Nothing();
|
|
62
62
|
}
|
|
63
|
+
try() {
|
|
64
|
+
throw this.\u503C;
|
|
65
|
+
}
|
|
66
|
+
tryAndWrap() {
|
|
67
|
+
throw new Error(String(this.\u503C));
|
|
68
|
+
}
|
|
63
69
|
};
|
|
64
70
|
var Right = class _Right extends Either {
|
|
65
71
|
constructor(\u503C) {
|
|
@@ -105,6 +111,12 @@ var Right = class _Right extends Either {
|
|
|
105
111
|
toMaybe() {
|
|
106
112
|
return new Just(this.\u503C);
|
|
107
113
|
}
|
|
114
|
+
try() {
|
|
115
|
+
return this.\u503C;
|
|
116
|
+
}
|
|
117
|
+
tryAndWrap() {
|
|
118
|
+
return this.\u503C;
|
|
119
|
+
}
|
|
108
120
|
};
|
|
109
121
|
|
|
110
122
|
export {
|
|
@@ -19,6 +19,8 @@ declare abstract class Either<L, R> {
|
|
|
19
19
|
abstract match<X>(onLeft: (a: L) => X, onRight: (a: R) => X): X;
|
|
20
20
|
abstract mplus(a: Either<L, R>): Either<L, R>;
|
|
21
21
|
abstract toMaybe(): Maybe<R>;
|
|
22
|
+
abstract try(): R;
|
|
23
|
+
abstract tryAndWrap(): R;
|
|
22
24
|
}
|
|
23
25
|
declare class Left<L, R> extends Either<L, R> {
|
|
24
26
|
private 值;
|
|
@@ -36,6 +38,8 @@ declare class Left<L, R> extends Either<L, R> {
|
|
|
36
38
|
match<X>(onLeft: (a: L) => X, _onRight: (a: R) => X): X;
|
|
37
39
|
mplus(a: Either<L, R>): Either<L, R>;
|
|
38
40
|
toMaybe(): Maybe<R>;
|
|
41
|
+
try(): R;
|
|
42
|
+
tryAndWrap(): R;
|
|
39
43
|
}
|
|
40
44
|
declare class Right<L, R> extends Either<L, R> {
|
|
41
45
|
private 值;
|
|
@@ -53,6 +57,8 @@ declare class Right<L, R> extends Either<L, R> {
|
|
|
53
57
|
match<X>(_onLeft: (a: L) => X, onRight: (a: R) => X): X;
|
|
54
58
|
mplus(_a: Either<L, R>): Either<L, R>;
|
|
55
59
|
toMaybe(): Maybe<R>;
|
|
60
|
+
try(): R;
|
|
61
|
+
tryAndWrap(): R;
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
export { Either, Left, Right, type 任意Either, type 计算右值们, type 计算左值们 };
|
package/dist/esm/data/either.js
CHANGED
package/dist/esm/data/task.js
CHANGED
package/dist/esm/func/seq.js
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
seqEitherTask,
|
|
9
9
|
seqMaybeArray,
|
|
10
10
|
seqMaybeTask
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-BKOGTDCP.js";
|
|
12
|
+
import "../chunk-E3TSSKMR.js";
|
|
13
|
+
import "../chunk-XGZ7K75X.js";
|
|
14
14
|
import "../chunk-NXA54GUD.js";
|
|
15
15
|
export {
|
|
16
16
|
seqArrayEitherCollectRight,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Lazy,
|
|
3
|
+
LazyDeferValue,
|
|
4
|
+
LazyForceValue
|
|
5
|
+
} from "./chunk-NEBLA4MD.js";
|
|
1
6
|
import {
|
|
2
7
|
seqArrayEitherCollectRight,
|
|
3
8
|
seqArrayEitherFirstLeft,
|
|
@@ -8,21 +13,16 @@ import {
|
|
|
8
13
|
seqEitherTask,
|
|
9
14
|
seqMaybeArray,
|
|
10
15
|
seqMaybeTask
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
Lazy,
|
|
14
|
-
LazyDeferValue,
|
|
15
|
-
LazyForceValue
|
|
16
|
-
} from "./chunk-NEBLA4MD.js";
|
|
16
|
+
} from "./chunk-BKOGTDCP.js";
|
|
17
17
|
import {
|
|
18
18
|
Task,
|
|
19
19
|
TaskDo
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-E3TSSKMR.js";
|
|
21
21
|
import {
|
|
22
22
|
Either,
|
|
23
23
|
Left,
|
|
24
24
|
Right
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-XGZ7K75X.js";
|
|
26
26
|
import {
|
|
27
27
|
Just,
|
|
28
28
|
Maybe,
|