fortepiano 0.1.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 (94) hide show
  1. package/README.md +3 -0
  2. package/lib/Aggregate.d.ts +4 -0
  3. package/lib/Aggregate.js +2 -0
  4. package/lib/Binary.d.ts +5 -0
  5. package/lib/Binary.js +15 -0
  6. package/lib/Buffer.d.ts +5 -0
  7. package/lib/Buffer.js +45 -0
  8. package/lib/Cache.d.ts +18 -0
  9. package/lib/Cache.js +50 -0
  10. package/lib/Console.d.ts +20 -0
  11. package/lib/Console.js +25 -0
  12. package/lib/Crypto.d.ts +5 -0
  13. package/lib/Crypto.js +39 -0
  14. package/lib/Date.d.ts +4 -0
  15. package/lib/Date.js +30 -0
  16. package/lib/Eq.d.ts +4 -0
  17. package/lib/Eq.js +29 -0
  18. package/lib/Error.d.ts +6 -0
  19. package/lib/Error.js +56 -0
  20. package/lib/GeneratorL.d.ts +208 -0
  21. package/lib/GeneratorL.js +501 -0
  22. package/lib/Http.d.ts +60 -0
  23. package/lib/Http.js +131 -0
  24. package/lib/IOAsyncGenerator.d.ts +102 -0
  25. package/lib/IOAsyncGenerator.js +456 -0
  26. package/lib/Log.d.ts +4 -0
  27. package/lib/Log.js +5 -0
  28. package/lib/Magma.d.ts +2 -0
  29. package/lib/Magma.js +26 -0
  30. package/lib/Matrix.d.ts +9 -0
  31. package/lib/Matrix.js +36 -0
  32. package/lib/Mock.d.ts +76 -0
  33. package/lib/Mock.js +113 -0
  34. package/lib/Option.d.ts +2 -0
  35. package/lib/Option.js +26 -0
  36. package/lib/Random.d.ts +7 -0
  37. package/lib/Random.js +7 -0
  38. package/lib/Reader.d.ts +4 -0
  39. package/lib/Reader.js +31 -0
  40. package/lib/ReaderEither.d.ts +9 -0
  41. package/lib/ReaderEither.js +34 -0
  42. package/lib/ReaderTask.d.ts +8 -0
  43. package/lib/ReaderTask.js +35 -0
  44. package/lib/ReaderTaskEither.d.ts +17 -0
  45. package/lib/ReaderTaskEither.js +42 -0
  46. package/lib/ReadonlyArray.d.ts +75 -0
  47. package/lib/ReadonlyArray.js +70 -0
  48. package/lib/ReadonlyRecord.d.ts +4 -0
  49. package/lib/ReadonlyRecord.js +28 -0
  50. package/lib/ReadonlyTuple.d.ts +14 -0
  51. package/lib/ReadonlyTuple.js +34 -0
  52. package/lib/Storage.d.ts +15 -0
  53. package/lib/Storage.js +57 -0
  54. package/lib/Stream.d.ts +5 -0
  55. package/lib/Stream.js +31 -0
  56. package/lib/TaskEither.d.ts +2 -0
  57. package/lib/TaskEither.js +32 -0
  58. package/lib/Type.d.ts +11 -0
  59. package/lib/Type.js +53 -0
  60. package/lib/Validation.d.ts +4 -0
  61. package/lib/Validation.js +30 -0
  62. package/lib/cache/Memcached.d.ts +4 -0
  63. package/lib/cache/Memcached.js +50 -0
  64. package/lib/cache/Memory.d.ts +2 -0
  65. package/lib/cache/Memory.js +66 -0
  66. package/lib/cache/Redis.d.ts +4 -0
  67. package/lib/cache/Redis.js +58 -0
  68. package/lib/cache/Storage.d.ts +4 -0
  69. package/lib/cache/Storage.js +62 -0
  70. package/lib/function.d.ts +52 -0
  71. package/lib/function.js +101 -0
  72. package/lib/http/Axios.d.ts +3 -0
  73. package/lib/http/Axios.js +59 -0
  74. package/lib/http/Fetch.d.ts +2 -0
  75. package/lib/http/Fetch.js +71 -0
  76. package/lib/http/Got.d.ts +3 -0
  77. package/lib/http/Got.js +60 -0
  78. package/lib/http/Mock.d.ts +2 -0
  79. package/lib/http/Mock.js +52 -0
  80. package/lib/index.d.ts +48 -0
  81. package/lib/index.js +86 -0
  82. package/lib/log/Void.d.ts +3 -0
  83. package/lib/log/Void.js +6 -0
  84. package/lib/number.d.ts +3 -0
  85. package/lib/number.js +8 -0
  86. package/lib/storage/Flydrive.d.ts +4 -0
  87. package/lib/storage/Flydrive.js +67 -0
  88. package/lib/storage/Fs.d.ts +3 -0
  89. package/lib/storage/Fs.js +53 -0
  90. package/lib/string.d.ts +5 -0
  91. package/lib/string.js +33 -0
  92. package/lib/struct.d.ts +9 -0
  93. package/lib/struct.js +47 -0
  94. package/package.json +87 -0
@@ -0,0 +1,456 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
31
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
32
+ var m = o[Symbol.asyncIterator], i;
33
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
34
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
35
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
36
+ };
37
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
38
+ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
39
+ var i, p;
40
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
41
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
42
+ };
43
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
44
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
45
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
46
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
47
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
48
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
49
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
50
+ function fulfill(value) { resume("next", value); }
51
+ function reject(value) { resume("throw", value); }
52
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
53
+ };
54
+ Object.defineProperty(exports, "__esModule", { value: true });
55
+ exports.sieve = exports.fromReadonlyArray = exports.replicate = exports.range = exports.partitionMapWithIndex = exports.partitionWithIndex = exports.filterMapWithIndex = exports.filterWithIndex = exports.FilterableWithIndex = exports.partitionMap = exports.partition = exports.filterMap = exports.filter = exports.Filterable = exports.separate = exports.compact = exports.Compactable = exports.MonadIO = exports.chainIOReadonlyArrayK = exports.fromIOReadonlyArrayK = exports.fromIOReadonlyArray = exports.chainFirstIOK = exports.chainIOK = exports.fromIOK = exports.fromIO = exports.FromIO = exports.Monad = exports.bind = exports.chainFirst = exports.chain = exports.Chain = exports.ApplicativeSeq = exports.ApplicativePar = exports.apS = exports.apSecond = exports.apFirst = exports.ap = exports.ApplySeq = exports.ApplyPar = exports.Do = exports.of = exports.Pointed = exports.FunctorWithIndex = exports.bindTo = exports.flap = exports.map = exports.Functor = exports.fromIOGenerator = exports.getMonoid = exports.URI = void 0;
56
+ exports.elem = exports.find = exports.head = exports.lookup = exports.isNonEmpty = exports.isEmpty = exports.toTask = exports.match = exports.uniq = exports.zip = exports.drop = exports.take = exports.flatten = exports.fibonacci = exports.exp = exports.prime = void 0;
57
+ const _Apply = __importStar(require("fp-ts/Apply"));
58
+ const Ch = __importStar(require("fp-ts/Chain"));
59
+ const Ei = __importStar(require("fp-ts/Either"));
60
+ const FIO = __importStar(require("fp-ts/FromIO"));
61
+ const function_1 = require("fp-ts/function");
62
+ const Fu = __importStar(require("fp-ts/Functor"));
63
+ const O = __importStar(require("fp-ts/Option"));
64
+ const RA = __importStar(require("fp-ts/ReadonlyArray"));
65
+ const S = __importStar(require("fp-ts/Separated"));
66
+ const T = __importStar(require("fp-ts/Task"));
67
+ const function_2 = require("./function");
68
+ const $IOG = __importStar(require("./GeneratorL"));
69
+ exports.URI = 'IOAsyncGenerator';
70
+ const getMonoid = () => ({
71
+ empty: exports.fromReadonlyArray([]),
72
+ concat: (x, y) => function () {
73
+ return __asyncGenerator(this, arguments, function* () {
74
+ yield __await(yield* __asyncDelegator(__asyncValues(x())));
75
+ yield __await(yield* __asyncDelegator(__asyncValues(y())));
76
+ });
77
+ },
78
+ });
79
+ exports.getMonoid = getMonoid;
80
+ const fromIOGenerator = (as) => function () {
81
+ return __asyncGenerator(this, arguments, function* () {
82
+ for (const a of as()) {
83
+ yield yield __await(a);
84
+ }
85
+ });
86
+ };
87
+ exports.fromIOGenerator = fromIOGenerator;
88
+ exports.Functor = {
89
+ URI: exports.URI,
90
+ map: (fa, f) => function () {
91
+ return __asyncGenerator(this, arguments, function* () {
92
+ var e_1, _b;
93
+ try {
94
+ for (var _c = __asyncValues(fa()), _d; _d = yield __await(_c.next()), !_d.done;) {
95
+ const a = _d.value;
96
+ yield yield __await(f(a));
97
+ }
98
+ }
99
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
100
+ finally {
101
+ try {
102
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
103
+ }
104
+ finally { if (e_1) throw e_1.error; }
105
+ }
106
+ });
107
+ },
108
+ };
109
+ exports.map = function_2.curry(function_1.flip(exports.Functor.map));
110
+ exports.flap = Fu.flap(exports.Functor);
111
+ exports.bindTo = Fu.bindTo(exports.Functor);
112
+ exports.FunctorWithIndex = Object.assign(Object.assign({}, exports.Functor), { mapWithIndex: (fa, f) => exports.Functor.map(function_1.pipe(fa, exports.zip(exports.range(0))), ([a, i]) => f(i, a)) });
113
+ exports.Pointed = {
114
+ URI: exports.URI,
115
+ of: (a) => exports.fromIOGenerator($IOG.of(a)),
116
+ };
117
+ exports.of = exports.Pointed.of;
118
+ exports.Do = exports.Pointed.of({});
119
+ exports.ApplyPar = Object.assign(Object.assign({}, exports.Functor), { ap: (fab, fa) => function () {
120
+ return __asyncGenerator(this, arguments, function* () {
121
+ const _fab = fab();
122
+ const _fa = fa();
123
+ const abs = [];
124
+ const as = [];
125
+ // eslint-disable-next-line no-constant-condition
126
+ while (true) {
127
+ const [ab, a] = yield __await(Promise.all([_fab.next(), _fa.next()]));
128
+ if (ab.done && a.done) {
129
+ break;
130
+ }
131
+ if (!ab.done) {
132
+ abs.push(ab.value);
133
+ }
134
+ if (!a.done) {
135
+ as.push(a.value);
136
+ }
137
+ }
138
+ for (const ab of abs) {
139
+ for (const a of as) {
140
+ yield yield __await(ab(a));
141
+ }
142
+ }
143
+ });
144
+ } });
145
+ /**
146
+ *
147
+ */
148
+ exports.ApplySeq = Object.assign(Object.assign({}, exports.Functor), { ap: (fab, fa) => function () {
149
+ return __asyncGenerator(this, arguments, function* () {
150
+ var e_2, _b, e_3, _c;
151
+ const abs = [];
152
+ try {
153
+ for (var _d = __asyncValues(fab()), _e; _e = yield __await(_d.next()), !_e.done;) {
154
+ const ab = _e.value;
155
+ abs.push(ab);
156
+ }
157
+ }
158
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
159
+ finally {
160
+ try {
161
+ if (_e && !_e.done && (_b = _d.return)) yield __await(_b.call(_d));
162
+ }
163
+ finally { if (e_2) throw e_2.error; }
164
+ }
165
+ const as = [];
166
+ try {
167
+ for (var _f = __asyncValues(fa()), _g; _g = yield __await(_f.next()), !_g.done;) {
168
+ const a = _g.value;
169
+ as.push(a);
170
+ }
171
+ }
172
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
173
+ finally {
174
+ try {
175
+ if (_g && !_g.done && (_c = _f.return)) yield __await(_c.call(_f));
176
+ }
177
+ finally { if (e_3) throw e_3.error; }
178
+ }
179
+ for (const ab of abs) {
180
+ for (const a of as) {
181
+ yield yield __await(ab(a));
182
+ }
183
+ }
184
+ });
185
+ } });
186
+ exports.ap = function_2.curry(function_1.flip(exports.ApplyPar.ap));
187
+ exports.apFirst = _Apply.apFirst(exports.ApplyPar);
188
+ exports.apSecond = _Apply.apSecond(exports.ApplyPar);
189
+ exports.apS = _Apply.apS(exports.ApplyPar);
190
+ exports.ApplicativePar = Object.assign(Object.assign({}, exports.Pointed), exports.ApplyPar);
191
+ exports.ApplicativeSeq = Object.assign(Object.assign({}, exports.Pointed), exports.ApplySeq);
192
+ exports.Chain = Object.assign(Object.assign({}, exports.ApplySeq), { chain: (fa, f) => {
193
+ return exports.flatten(exports.Functor.map(fa, f));
194
+ } });
195
+ exports.chain = function_2.curry(function_1.flip(exports.Chain.chain));
196
+ exports.chainFirst = Ch.chainFirst(exports.Chain);
197
+ exports.bind = Ch.bind(exports.Chain);
198
+ exports.Monad = Object.assign(Object.assign({}, exports.ApplicativeSeq), exports.Chain);
199
+ exports.FromIO = {
200
+ URI: exports.URI,
201
+ fromIO: (fa) => () => exports.Pointed.of(fa())(),
202
+ };
203
+ exports.fromIO = exports.FromIO.fromIO;
204
+ exports.fromIOK = FIO.fromIOK(exports.FromIO);
205
+ exports.chainIOK = FIO.chainIOK(exports.FromIO, exports.Chain);
206
+ exports.chainFirstIOK = FIO.chainFirstIOK(exports.FromIO, exports.Chain);
207
+ const fromIOReadonlyArray = (fa) => function_1.pipe(fa, exports.fromIO, exports.chain(exports.fromReadonlyArray));
208
+ exports.fromIOReadonlyArray = fromIOReadonlyArray;
209
+ const fromIOReadonlyArrayK = (f) => function_1.flow(f, exports.fromIOReadonlyArray);
210
+ exports.fromIOReadonlyArrayK = fromIOReadonlyArrayK;
211
+ const chainIOReadonlyArrayK = (f) => exports.chain(exports.fromIOReadonlyArrayK(f));
212
+ exports.chainIOReadonlyArrayK = chainIOReadonlyArrayK;
213
+ exports.MonadIO = Object.assign(Object.assign({}, exports.Monad), exports.FromIO);
214
+ function _filter(fa, predicate) {
215
+ return function () {
216
+ return __asyncGenerator(this, arguments, function* () {
217
+ var e_4, _b;
218
+ try {
219
+ for (var _c = __asyncValues(fa()), _d; _d = yield __await(_c.next()), !_d.done;) {
220
+ const a = _d.value;
221
+ if (!predicate(a)) {
222
+ continue;
223
+ }
224
+ yield yield __await(a);
225
+ }
226
+ }
227
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
228
+ finally {
229
+ try {
230
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
231
+ }
232
+ finally { if (e_4) throw e_4.error; }
233
+ }
234
+ });
235
+ };
236
+ }
237
+ exports.Compactable = {
238
+ URI: exports.URI,
239
+ compact: (fa) => exports.Functor.map(exports.Filterable.filter(fa, O.isSome), (a) => a.value),
240
+ separate: (fa) => S.separated(exports.Functor.map(_filter(fa, Ei.isLeft), (a) => a.left), exports.Functor.map(_filter(fa, Ei.isRight), (a) => a.right)),
241
+ };
242
+ exports.compact = exports.Compactable.compact;
243
+ exports.separate = exports.Compactable.separate;
244
+ function _partition(fa, predicate) {
245
+ return S.separated(_filter(fa, function_1.not(predicate)), _filter(fa, predicate));
246
+ }
247
+ exports.Filterable = Object.assign(Object.assign(Object.assign({}, exports.Functor), exports.Compactable), { filter: _filter, filterMap: (fa, f) => exports.Compactable.compact(exports.Functor.map(fa, f)), partition: _partition, partitionMap: (fa, f) => exports.Compactable.separate(exports.Functor.map(fa, f)) });
248
+ function filter(predicate) {
249
+ return (fa) => exports.Filterable.filter(fa, predicate);
250
+ }
251
+ exports.filter = filter;
252
+ exports.filterMap = function_2.curry(function_1.flip(exports.Filterable.filterMap));
253
+ function partition(predicate) {
254
+ return (fa) => exports.Filterable.partition(fa, predicate);
255
+ }
256
+ exports.partition = partition;
257
+ exports.partitionMap = function_2.curry(function_1.flip(exports.Filterable.partitionMap));
258
+ function _filterWithIndex(fa, predicateWithIndex) {
259
+ return exports.Compactable.compact(exports.FunctorWithIndex.mapWithIndex(fa, (i, a) => predicateWithIndex(i, a) ? O.some(a) : O.none));
260
+ }
261
+ function _partitionWithIndex(fa, predicateWithIndex) {
262
+ return exports.Compactable.separate(exports.FunctorWithIndex.mapWithIndex(fa, (i, a) => predicateWithIndex(i, a) ? Ei.right(a) : Ei.left(a)));
263
+ }
264
+ exports.FilterableWithIndex = Object.assign(Object.assign(Object.assign({}, exports.FunctorWithIndex), exports.Filterable), { filterWithIndex: _filterWithIndex, filterMapWithIndex: (fa, f) => exports.Compactable.compact(exports.FunctorWithIndex.mapWithIndex(fa, f)), partitionWithIndex: _partitionWithIndex, partitionMapWithIndex: (fa, f) => exports.Compactable.separate(exports.FunctorWithIndex.mapWithIndex(fa, f)) });
265
+ function filterWithIndex(predicateWithIndex) {
266
+ return (fa) => exports.FilterableWithIndex.filterWithIndex(fa, predicateWithIndex);
267
+ }
268
+ exports.filterWithIndex = filterWithIndex;
269
+ exports.filterMapWithIndex = function_2.curry(function_1.flip(exports.FilterableWithIndex.filterMapWithIndex));
270
+ function partitionWithIndex(predicateWithIndex) {
271
+ return (fa) => exports.FilterableWithIndex.partitionWithIndex(fa, predicateWithIndex);
272
+ }
273
+ exports.partitionWithIndex = partitionWithIndex;
274
+ exports.partitionMapWithIndex = function_2.curry(function_1.flip(exports.FilterableWithIndex.partitionMapWithIndex));
275
+ exports.range = function_1.flow($IOG.range, exports.fromIOGenerator);
276
+ exports.replicate = function_1.flow($IOG.replicate, exports.fromIOGenerator);
277
+ const fromReadonlyArray = (x) => {
278
+ return function_1.flow($IOG.fromReadonlyArray, exports.fromIOGenerator)(x);
279
+ };
280
+ exports.fromReadonlyArray = fromReadonlyArray;
281
+ const sieve = (f) => (as) => function () {
282
+ return __asyncGenerator(this, arguments, function* () {
283
+ var e_5, _b;
284
+ const init = [];
285
+ try {
286
+ for (var _c = __asyncValues(as()), _d; _d = yield __await(_c.next()), !_d.done;) {
287
+ const a = _d.value;
288
+ if (!f(init, a)) {
289
+ continue;
290
+ }
291
+ init.push(a);
292
+ yield yield __await(a);
293
+ }
294
+ }
295
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
296
+ finally {
297
+ try {
298
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
299
+ }
300
+ finally { if (e_5) throw e_5.error; }
301
+ }
302
+ });
303
+ };
304
+ exports.sieve = sieve;
305
+ exports.prime = function_1.pipe(exports.range(2), exports.sieve((init, a) => function_1.pipe(init, RA.every((_a) => 0 !== a % _a))));
306
+ exports.exp = function_1.pipe(exports.range(0), exports.map((n) => Math.exp(n)));
307
+ const fibonacci = function () {
308
+ return __asyncGenerator(this, arguments, function* () {
309
+ for (let as = [1, 0]; true; as = [as[1], as[0] + as[1]]) {
310
+ yield yield __await(as[1]);
311
+ }
312
+ });
313
+ };
314
+ exports.fibonacci = fibonacci;
315
+ const flatten = (as) => function () {
316
+ return __asyncGenerator(this, arguments, function* () {
317
+ var e_6, _b;
318
+ try {
319
+ for (var _c = __asyncValues(as()), _d; _d = yield __await(_c.next()), !_d.done;) {
320
+ const a = _d.value;
321
+ yield __await(yield* __asyncDelegator(__asyncValues(a())));
322
+ }
323
+ }
324
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
325
+ finally {
326
+ try {
327
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
328
+ }
329
+ finally { if (e_6) throw e_6.error; }
330
+ }
331
+ });
332
+ };
333
+ exports.flatten = flatten;
334
+ const take = (n) => (as) => function () {
335
+ return __asyncGenerator(this, arguments, function* () {
336
+ var e_7, _b;
337
+ try {
338
+ for (var _c = __asyncValues(function_1.pipe(as, exports.zip(exports.range(0)))()), _d; _d = yield __await(_c.next()), !_d.done;) {
339
+ const [a, i] = _d.value;
340
+ if (i >= n) {
341
+ break;
342
+ }
343
+ yield yield __await(a);
344
+ }
345
+ }
346
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
347
+ finally {
348
+ try {
349
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
350
+ }
351
+ finally { if (e_7) throw e_7.error; }
352
+ }
353
+ });
354
+ };
355
+ exports.take = take;
356
+ const drop = (n) => (as) => function () {
357
+ return __asyncGenerator(this, arguments, function* () {
358
+ var e_8, _b;
359
+ try {
360
+ for (var _c = __asyncValues(function_1.pipe(as, exports.zip(exports.range(0)))()), _d; _d = yield __await(_c.next()), !_d.done;) {
361
+ const [a, i] = _d.value;
362
+ if (i < n) {
363
+ continue;
364
+ }
365
+ yield yield __await(a);
366
+ }
367
+ }
368
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
369
+ finally {
370
+ try {
371
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
372
+ }
373
+ finally { if (e_8) throw e_8.error; }
374
+ }
375
+ });
376
+ };
377
+ exports.drop = drop;
378
+ const zip = (bs) => (as) => function () {
379
+ return __asyncGenerator(this, arguments, function* () {
380
+ var e_9, _b;
381
+ const _bs = bs();
382
+ try {
383
+ for (var _c = __asyncValues(as()), _d; _d = yield __await(_c.next()), !_d.done;) {
384
+ const a = _d.value;
385
+ const b = yield __await(_bs.next());
386
+ if (b.done) {
387
+ break;
388
+ }
389
+ yield yield __await([a, b.value]);
390
+ }
391
+ }
392
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
393
+ finally {
394
+ try {
395
+ if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
396
+ }
397
+ finally { if (e_9) throw e_9.error; }
398
+ }
399
+ });
400
+ };
401
+ exports.zip = zip;
402
+ const uniq = (E) => exports.sieve((init, a) => !function_1.pipe(init, RA.elem(E)(a)));
403
+ exports.uniq = uniq;
404
+ const match = (onEmpty, onNonEmpty) => (as) => function_1.pipe(as().next(), (a) => () => a.then((_a) => _a.done ? onEmpty() : onNonEmpty(_a.value, function_1.pipe(as, exports.drop(1)))));
405
+ exports.match = match;
406
+ const toTask = (as) => () => __awaiter(void 0, void 0, void 0, function* () {
407
+ var e_10, _b;
408
+ const _as = [];
409
+ try {
410
+ for (var _c = __asyncValues(as()), _d; _d = yield _c.next(), !_d.done;) {
411
+ const a = _d.value;
412
+ _as.push(a);
413
+ }
414
+ }
415
+ catch (e_10_1) { e_10 = { error: e_10_1 }; }
416
+ finally {
417
+ try {
418
+ if (_d && !_d.done && (_b = _c.return)) yield _b.call(_c);
419
+ }
420
+ finally { if (e_10) throw e_10.error; }
421
+ }
422
+ return _as;
423
+ });
424
+ exports.toTask = toTask;
425
+ exports.isEmpty = exports.match(function_1.constTrue, function_1.constFalse);
426
+ exports.isNonEmpty = function_1.flow(exports.isEmpty, T.map((a) => !a));
427
+ const lookup = (i) => (as) => i < 0
428
+ ? T.of(O.none)
429
+ : function_1.pipe(as, exports.drop(i), exports.match(() => O.none, (a) => O.some(a)));
430
+ exports.lookup = lookup;
431
+ const head = (as) => function_1.pipe(as, exports.lookup(0));
432
+ exports.head = head;
433
+ function find(predicate) {
434
+ return (as) => () => __awaiter(this, void 0, void 0, function* () {
435
+ var e_11, _b;
436
+ try {
437
+ for (var _c = __asyncValues(as()), _d; _d = yield _c.next(), !_d.done;) {
438
+ const a = _d.value;
439
+ if (predicate(a)) {
440
+ return O.some(a);
441
+ }
442
+ }
443
+ }
444
+ catch (e_11_1) { e_11 = { error: e_11_1 }; }
445
+ finally {
446
+ try {
447
+ if (_d && !_d.done && (_b = _c.return)) yield _b.call(_c);
448
+ }
449
+ finally { if (e_11) throw e_11.error; }
450
+ }
451
+ return O.none;
452
+ });
453
+ }
454
+ exports.find = find;
455
+ const elem = (Eq) => (a) => find((_a) => Eq.equals(a, _a));
456
+ exports.elem = elem;
package/lib/Log.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import * as IO from 'fp-ts/IO';
2
+ import { void as _void } from './log/Void';
3
+ export declare type Logger = (...as: ReadonlyArray<unknown>) => IO.IO<void>;
4
+ export { _void as void };
package/lib/Log.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.void = void 0;
4
+ const Void_1 = require("./log/Void");
5
+ Object.defineProperty(exports, "void", { enumerable: true, get: function () { return Void_1.void; } });
package/lib/Magma.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import * as M from 'fp-ts/Magma';
2
+ export declare const concatAll: <A>(M: M.Magma<A>) => (startWith: A) => (as: readonly A[]) => A;
package/lib/Magma.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.concatAll = void 0;
23
+ const function_1 = require("fp-ts/function");
24
+ const RA = __importStar(require("fp-ts/ReadonlyArray"));
25
+ const concatAll = (M) => (startWith) => (as) => function_1.pipe(as, RA.reduce(startWith, M.concat));
26
+ exports.concatAll = concatAll;
@@ -0,0 +1,9 @@
1
+ import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray';
2
+ import * as t from 'io-ts';
3
+ interface MatrixBrand {
4
+ readonly Matrix: unique symbol;
5
+ }
6
+ export declare type Matrix<A> = t.Branded<ReadonlyArray<RNEA.ReadonlyNonEmptyArray<A>>, MatrixBrand>;
7
+ export declare const MatrixC: <C extends t.Mixed>(item: C) => t.BrandC<t.ReadonlyArrayC<import("io-ts-types").ReadonlyNonEmptyArrayC<C>>, MatrixBrand>;
8
+ export declare const transpose: <A>(as: Matrix<A>) => Matrix<A>;
9
+ export {};
package/lib/Matrix.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.transpose = exports.MatrixC = void 0;
23
+ const Ei = __importStar(require("fp-ts/Either"));
24
+ const function_1 = require("fp-ts/function");
25
+ const RA = __importStar(require("fp-ts/ReadonlyArray"));
26
+ const RR = __importStar(require("fp-ts/ReadonlyRecord"));
27
+ const t = __importStar(require("io-ts"));
28
+ const io_ts_types_1 = require("io-ts-types");
29
+ const $Eq = __importStar(require("./Eq"));
30
+ const $RA = __importStar(require("./ReadonlyArray"));
31
+ const $RR = __importStar(require("./ReadonlyRecord"));
32
+ const is = (item) => (u) => function_1.pipe(u, t.readonlyArray(io_ts_types_1.readonlyNonEmptyArray(item)).decode, Ei.filterOrElseW($RA.same($Eq.getEqSize(RA)), function_1.constNull), Ei.match(function_1.constFalse, function_1.constTrue));
33
+ const MatrixC = (item) => t.brand(t.readonlyArray(io_ts_types_1.readonlyNonEmptyArray(item)), is(item), 'Matrix');
34
+ exports.MatrixC = MatrixC;
35
+ const transpose = (as) => function_1.pipe(as, RA.reduceWithIndex({}, (i, bs, row) => function_1.pipe(row, RA.reduceWithIndex(bs, (j, bs, a) => (Object.assign(Object.assign({}, bs), { [String(j)]: Object.assign(Object.assign({}, bs[String(j)]), { [String(i)]: a }) }))))), RR.map($RR.values), $RR.values);
36
+ exports.transpose = transpose;
package/lib/Mock.d.ts ADDED
@@ -0,0 +1,76 @@
1
+ import * as Appli from 'fp-ts/Applicative';
2
+ import * as _Apply from 'fp-ts/Apply';
3
+ import * as C from 'fp-ts/Chain';
4
+ import * as FIO from 'fp-ts/FromIO';
5
+ import * as F from 'fp-ts/Functor';
6
+ import * as IO from 'fp-ts/IO';
7
+ import * as M from 'fp-ts/Monad';
8
+ import * as MIO from 'fp-ts/MonadIO';
9
+ import * as P from 'fp-ts/Pointed';
10
+ import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray';
11
+ import * as RR from 'fp-ts/ReadonlyRecord';
12
+ import { PartialDeep } from '.';
13
+ export declare const URI = "Mock";
14
+ export declare type URI = typeof URI;
15
+ declare module 'fp-ts/HKT' {
16
+ interface URItoKind<A> {
17
+ readonly [URI]: Mock<A>;
18
+ }
19
+ }
20
+ declare type EnforceNonEmptyRecord<R> = keyof R extends never ? never : R;
21
+ export interface Mock<A> {
22
+ (...as: ReadonlyArray<PartialDeep<A>>): IO.IO<A>;
23
+ }
24
+ export declare const Functor: F.Functor1<URI>;
25
+ export declare const map: <A, B>(a: (a: A) => B) => (b: Mock<A>) => Mock<B>;
26
+ export declare const flap: <A>(a: A) => <B>(fab: Mock<(a: A) => B>) => Mock<B>;
27
+ export declare const bindTo: <N extends string>(name: N) => <A>(fa: Mock<A>) => Mock<{ readonly [K in N]: A; }>;
28
+ export declare const Pointed: P.Pointed1<URI>;
29
+ export declare const of: <A>(a: A) => Mock<A>;
30
+ export declare const Do: Mock<{}>;
31
+ export declare const Apply: _Apply.Apply1<URI>;
32
+ export declare const ap: <A, B>(a: Mock<A>) => (b: Mock<(a: A) => B>) => Mock<B>;
33
+ export declare const apFirst: <B>(second: Mock<B>) => <A>(first: Mock<A>) => Mock<A>;
34
+ export declare const apSecond: <B>(second: Mock<B>) => <A>(first: Mock<A>) => Mock<B>;
35
+ export declare const apS: <N extends string, A, B>(name: Exclude<N, keyof A>, fb: Mock<B>) => (fa: Mock<A>) => Mock<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B; }>;
36
+ export declare const Applicative: Appli.Applicative1<URI>;
37
+ export declare const Chain: C.Chain1<URI>;
38
+ export declare const chain: <A, B>(a: (a: A) => Mock<B>) => (b: Mock<A>) => Mock<B>;
39
+ export declare const chainFirst: <A, B>(f: (a: A) => Mock<B>) => (first: Mock<A>) => Mock<A>;
40
+ export declare const bind: <N extends string, A, B>(name: Exclude<N, keyof A>, f: (a: A) => Mock<B>) => (ma: Mock<A>) => Mock<{ readonly [K in N | keyof A]: K extends keyof A ? A[K] : B; }>;
41
+ export declare const Monad: M.Monad1<URI>;
42
+ export declare const FromIO: FIO.FromIO1<URI>;
43
+ export declare const fromIO: import("fp-ts/lib/NaturalTransformation").NaturalTransformation11<"IO", "Mock">;
44
+ export declare const fromIOK: <A extends readonly unknown[], B>(f: (...a: A) => IO.IO<B>) => (...a: A) => Mock<B>;
45
+ export declare const chainIOK: <A, B>(f: (a: A) => IO.IO<B>) => (first: Mock<A>) => Mock<B>;
46
+ export declare const chainFirstIOK: <A, B>(f: (a: A) => IO.IO<B>) => (first: Mock<A>) => Mock<A>;
47
+ export declare const MonadIO: MIO.MonadIO1<URI>;
48
+ declare const _void: Mock<void>;
49
+ declare const _undefined: Mock<undefined>;
50
+ declare const _null: Mock<null>;
51
+ export declare const boolean: Mock<boolean>;
52
+ export declare const float: (min?: number, max?: number) => Mock<number>;
53
+ export declare const integer: (min?: number, max?: number) => Mock<number>;
54
+ export declare const number: (min?: number, max?: number) => Mock<number>;
55
+ export declare const string: Mock<string>;
56
+ export declare const literal: <A extends string | number | boolean>(a: A) => Mock<A>;
57
+ export declare const unknown: (depth?: number) => Mock<unknown>;
58
+ export declare const nullable: <A>(M: Mock<A>) => Mock<A | undefined>;
59
+ export declare const tuple: <T extends Mock<any>[]>(...t: T & {
60
+ readonly 0: Mock<any>;
61
+ }) => Mock<{ [K in keyof T]: [T[K]] extends [Mock<infer A>] ? A : never; }>;
62
+ export declare const struct: <NER extends Record<string, Mock<any>>>(r: keyof NER extends never ? never : NER) => Mock<{ [K in keyof NER]: [NER[K]] extends [Mock<infer A>] ? A : never; }>;
63
+ export declare const partial: <A>(Ms: EnforceNonEmptyRecord<{ readonly [K in keyof A]: Mock<A[K]>; }>) => Mock<Partial<Readonly<A>>>;
64
+ export declare function union<A, B, C, D, E, F, G, H, I, J>(a: Mock<A>, b: Mock<B>, c: Mock<C>, d: Mock<D>, e: Mock<E>, f: Mock<F>, g: Mock<G>, h: Mock<H>, i: Mock<I>, j: Mock<J>): Mock<A | B | C | D | E | F | G | H | I | J>;
65
+ export declare function union<A, B, C, D, E, F, G, H, I>(a: Mock<A>, b: Mock<B>, c: Mock<C>, d: Mock<D>, e: Mock<E>, f: Mock<F>, g: Mock<G>, h: Mock<H>, i: Mock<I>): Mock<A | B | C | D | E | F | G | H | I>;
66
+ export declare function union<A, B, C, D, E, F, G, H>(a: Mock<A>, b: Mock<B>, c: Mock<C>, d: Mock<D>, e: Mock<E>, f: Mock<F>, g: Mock<G>, h: Mock<H>): Mock<A | B | C | D | E | F | G | H>;
67
+ export declare function union<A, B, C, D, E, F, G>(a: Mock<A>, b: Mock<B>, c: Mock<C>, d: Mock<D>, e: Mock<E>, f: Mock<F>, g: Mock<G>): Mock<A | B | C | D | E | F | G>;
68
+ export declare function union<A, B, C, D, E, F>(a: Mock<A>, b: Mock<B>, c: Mock<C>, d: Mock<D>, e: Mock<E>, f: Mock<F>): Mock<A | B | C | D | E | F>;
69
+ export declare function union<A, B, C, D, E>(a: Mock<A>, b: Mock<B>, c: Mock<C>, d: Mock<D>, e: Mock<E>): Mock<A | B | C | D | E>;
70
+ export declare function union<A, B, C, D>(a: Mock<A>, b: Mock<B>, c: Mock<C>, d: Mock<D>): Mock<A | B | C | D>;
71
+ export declare function union<A, B, C>(a: Mock<A>, b: Mock<B>, c: Mock<C>): Mock<A | B | C>;
72
+ export declare function union<A, B>(a: Mock<A>, b: Mock<B>): Mock<A | B>;
73
+ export declare const readonlyArray: <A>(M: Mock<A>, min?: number, max?: number) => Mock<readonly A[]>;
74
+ export declare const readonlyNonEmptyArray: <A>(M: Mock<A>, min?: number, max?: number) => Mock<RNEA.ReadonlyNonEmptyArray<A>>;
75
+ export declare const readonlyRecord: <K extends string, T>(KM: Mock<K>, TM: Mock<T>, min?: number, max?: number) => Mock<Readonly<Record<K, T>>>;
76
+ export { _void as void, _undefined as undefined, _null as null };