@thi.ng/pointfree 3.1.20 → 3.1.22
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/CHANGELOG.md +40 -40
- package/package.json +11 -11
- package/bench/index.js +0 -55
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2022-
|
|
3
|
+
- **Last updated**: 2022-11-23T22:46:54Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -32,9 +32,9 @@ and/or version bumps of transitive dependencies.
|
|
|
32
32
|
|
|
33
33
|
#### ♻️ Refactoring
|
|
34
34
|
|
|
35
|
-
- update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
|
|
36
35
|
- update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
|
|
37
36
|
- add .js suffix for all relative imports
|
|
37
|
+
- update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
|
|
38
38
|
|
|
39
39
|
# [3.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@3.0.0) (2021-10-12)
|
|
40
40
|
|
|
@@ -55,22 +55,22 @@ and/or version bumps of transitive dependencies.
|
|
|
55
55
|
|
|
56
56
|
#### ♻️ Refactoring
|
|
57
57
|
|
|
58
|
+
- update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
|
|
59
|
+
- update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
|
|
60
|
+
- update imports ([138571a](https://github.com/thi-ng/umbrella/commit/138571a))
|
|
58
61
|
- update deps & imports in various pkgs ([e1cf29e](https://github.com/thi-ng/umbrella/commit/e1cf29e))
|
|
59
62
|
- largely related to recent updates/restructuring of these packages:
|
|
60
63
|
- api
|
|
61
64
|
- defmulti
|
|
62
65
|
- errors
|
|
63
66
|
- logger
|
|
64
|
-
- update imports ([138571a](https://github.com/thi-ng/umbrella/commit/138571a))
|
|
65
|
-
- update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
|
|
66
|
-
- update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
|
|
67
67
|
|
|
68
68
|
### [2.0.18](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@2.0.18) (2020-12-07)
|
|
69
69
|
|
|
70
70
|
#### ♻️ Refactoring
|
|
71
71
|
|
|
72
|
-
- update type-only imports ([34bb05c](https://github.com/thi-ng/umbrella/commit/34bb05c))
|
|
73
72
|
- update type-only imports in various tests/pkgs ([3fd9c24](https://github.com/thi-ng/umbrella/commit/3fd9c24))
|
|
73
|
+
- update type-only imports ([34bb05c](https://github.com/thi-ng/umbrella/commit/34bb05c))
|
|
74
74
|
|
|
75
75
|
# [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@2.0.0) (2020-04-16)
|
|
76
76
|
|
|
@@ -95,9 +95,9 @@ and/or version bumps of transitive dependencies.
|
|
|
95
95
|
|
|
96
96
|
#### 🚀 Features
|
|
97
97
|
|
|
98
|
-
- add $try word, update compile() to allow empty quotations ([41de106](https://github.com/thi-ng/umbrella/commit/41de106))
|
|
99
|
-
- add tojson()/fromjson() conversion ops ([829f3ab](https://github.com/thi-ng/umbrella/commit/829f3ab))
|
|
100
98
|
- add whenq(), ismatch() ([44ab1d7](https://github.com/thi-ng/umbrella/commit/44ab1d7))
|
|
99
|
+
- add tojson()/fromjson() conversion ops ([829f3ab](https://github.com/thi-ng/umbrella/commit/829f3ab))
|
|
100
|
+
- add $try word, update compile() to allow empty quotations ([41de106](https://github.com/thi-ng/umbrella/commit/41de106))
|
|
101
101
|
|
|
102
102
|
### [1.2.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.2.6) (2020-02-25)
|
|
103
103
|
|
|
@@ -114,9 +114,9 @@ and/or version bumps of transitive dependencies.
|
|
|
114
114
|
|
|
115
115
|
#### ♻️ Refactoring
|
|
116
116
|
|
|
117
|
-
- update op2v, extract loops ([6392657](https://github.com/thi-ng/umbrella/commit/6392657))
|
|
118
|
-
- update core stack fns (re-use) ([a7ebb2f](https://github.com/thi-ng/umbrella/commit/a7ebb2f))
|
|
119
117
|
- split into separate files ([86a27e5](https://github.com/thi-ng/umbrella/commit/86a27e5))
|
|
118
|
+
- update core stack fns (re-use) ([a7ebb2f](https://github.com/thi-ng/umbrella/commit/a7ebb2f))
|
|
119
|
+
- update op2v, extract loops ([6392657](https://github.com/thi-ng/umbrella/commit/6392657))
|
|
120
120
|
|
|
121
121
|
## [1.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.1.0) (2019-07-07)
|
|
122
122
|
|
|
@@ -187,9 +187,9 @@ and/or version bumps of transitive dependencies.
|
|
|
187
187
|
|
|
188
188
|
#### 🚀 Features
|
|
189
189
|
|
|
190
|
+
- add copy() word ([68a8dba](https://github.com/thi-ng/umbrella/commit/68a8dba))
|
|
190
191
|
- add math ops, update load/loadkey, update tests ([2101e92](https://github.com/thi-ng/umbrella/commit/2101e92))
|
|
191
192
|
- load/loadkey throws error if var doesn't exist
|
|
192
|
-
- add copy() word ([68a8dba](https://github.com/thi-ng/umbrella/commit/68a8dba))
|
|
193
193
|
|
|
194
194
|
#### ♻️ Refactoring
|
|
195
195
|
|
|
@@ -212,12 +212,6 @@ and/or version bumps of transitive dependencies.
|
|
|
212
212
|
|
|
213
213
|
#### 🚀 Features
|
|
214
214
|
|
|
215
|
-
- add more dataflow combinators, words & tests ([b096e43](https://github.com/thi-ng/umbrella/commit/b096e43))
|
|
216
|
-
- add tri/2/3
|
|
217
|
-
- add bis/2, tris/2
|
|
218
|
-
- add bia/2, tria/2
|
|
219
|
-
- add both, either
|
|
220
|
-
- add oneover
|
|
221
215
|
- add combinators, update controlflow words, remove execq ([3dc30a8](https://github.com/thi-ng/umbrella/commit/3dc30a8))
|
|
222
216
|
- add condq(), loopq()
|
|
223
217
|
- update dotimes() to use quotations from stack, no more HOF
|
|
@@ -227,6 +221,12 @@ and/or version bumps of transitive dependencies.
|
|
|
227
221
|
- add dup3
|
|
228
222
|
- refactor exec to work w/ quotations, remove execq
|
|
229
223
|
- add/update tests
|
|
224
|
+
- add more dataflow combinators, words & tests ([b096e43](https://github.com/thi-ng/umbrella/commit/b096e43))
|
|
225
|
+
- add tri/2/3
|
|
226
|
+
- add bis/2, tris/2
|
|
227
|
+
- add bia/2, tria/2
|
|
228
|
+
- add both, either
|
|
229
|
+
- add oneover
|
|
230
230
|
|
|
231
231
|
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.4.0) (2018-03-29)
|
|
232
232
|
|
|
@@ -244,7 +244,21 @@ and/or version bumps of transitive dependencies.
|
|
|
244
244
|
|
|
245
245
|
#### 🚀 Features
|
|
246
246
|
|
|
247
|
-
-
|
|
247
|
+
- update word/wordU, add append(), tuple(), join() ([f3f0bec](https://github.com/thi-ng/umbrella/commit/f3f0bec))
|
|
248
|
+
- update all words to return stack ([79b4ce3](https://github.com/thi-ng/umbrella/commit/79b4ce3))
|
|
249
|
+
- major refactor & restructure ([a48361d](https://github.com/thi-ng/umbrella/commit/a48361d))
|
|
250
|
+
- split out types into api.ts
|
|
251
|
+
- add StackContext and update all word functions to accept and return this type
|
|
252
|
+
- add comp() and update word/wordU() to precompile word
|
|
253
|
+
- add list/array fns: op2l, ladd/lsub/lmul/ldiv, lsplit, foldl
|
|
254
|
+
- further restructure, perf, add tests ([3252554](https://github.com/thi-ng/umbrella/commit/3252554))
|
|
255
|
+
- add rstack, update StackContext ([1c4cd2f](https://github.com/thi-ng/umbrella/commit/1c4cd2f))
|
|
256
|
+
- add 2nd stack (r-stack) to StackContext
|
|
257
|
+
- add supporting rstack words (rdrop/2, mov/cprd, mov/cpdr)
|
|
258
|
+
- add min/max
|
|
259
|
+
- add pushl
|
|
260
|
+
- add cat
|
|
261
|
+
- add printds/rs
|
|
248
262
|
- add new words, rename words, remove mapnth, pushl2 ([0f0c382](https://github.com/thi-ng/umbrella/commit/0f0c382))
|
|
249
263
|
- add mapl(), mapll() array transformers
|
|
250
264
|
- refactor foldl() in terms of mapl()
|
|
@@ -253,26 +267,12 @@ and/or version bumps of transitive dependencies.
|
|
|
253
267
|
- revert op2v to produce new result arrays
|
|
254
268
|
- add runE() syntax sugar
|
|
255
269
|
- update tests
|
|
256
|
-
-
|
|
257
|
-
- add 2nd stack (r-stack) to StackContext
|
|
258
|
-
- add supporting rstack words (rdrop/2, mov/cprd, mov/cpdr)
|
|
259
|
-
- add min/max
|
|
260
|
-
- add pushl
|
|
261
|
-
- add cat
|
|
262
|
-
- add printds/rs
|
|
263
|
-
- further restructure, perf, add tests ([3252554](https://github.com/thi-ng/umbrella/commit/3252554))
|
|
264
|
-
- major refactor & restructure ([a48361d](https://github.com/thi-ng/umbrella/commit/a48361d))
|
|
265
|
-
- split out types into api.ts
|
|
266
|
-
- add StackContext and update all word functions to accept and return this type
|
|
267
|
-
- add comp() and update word/wordU() to precompile word
|
|
268
|
-
- add list/array fns: op2l, ladd/lsub/lmul/ldiv, lsplit, foldl
|
|
269
|
-
- update all words to return stack ([79b4ce3](https://github.com/thi-ng/umbrella/commit/79b4ce3))
|
|
270
|
-
- update word/wordU, add append(), tuple(), join() ([f3f0bec](https://github.com/thi-ng/umbrella/commit/f3f0bec))
|
|
270
|
+
- major update readme, package ([e52b869](https://github.com/thi-ng/umbrella/commit/e52b869))
|
|
271
271
|
|
|
272
272
|
#### 🩹 Bug fixes
|
|
273
273
|
|
|
274
|
-
- add 0-arity comp() (identity fn) ([10d5a34](https://github.com/thi-ng/umbrella/commit/10d5a34))
|
|
275
274
|
- wordU(), add tests ([1a01f9a](https://github.com/thi-ng/umbrella/commit/1a01f9a))
|
|
275
|
+
- add 0-arity comp() (identity fn) ([10d5a34](https://github.com/thi-ng/umbrella/commit/10d5a34))
|
|
276
276
|
|
|
277
277
|
#### ♻️ Refactoring
|
|
278
278
|
|
|
@@ -299,10 +299,8 @@ and/or version bumps of transitive dependencies.
|
|
|
299
299
|
|
|
300
300
|
#### 🚀 Features
|
|
301
301
|
|
|
302
|
-
-
|
|
303
|
-
|
|
304
|
-
- update StackProgram type alias
|
|
305
|
-
- add collect() to create stack partitions
|
|
302
|
+
- initial import of refactored [@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/main/packages/pointfree) package ([25bbf05](https://github.com/thi-ng/umbrella/commit/25bbf05))
|
|
303
|
+
- add dropIf, neg, nop, update cond,condM, add docs/readme ([58f5716](https://github.com/thi-ng/umbrella/commit/58f5716))
|
|
306
304
|
- add unwrap, quatations, math/bitops, array/obj access ([f75486d](https://github.com/thi-ng/umbrella/commit/f75486d))
|
|
307
305
|
- add runU(), wordU() & unwrap()
|
|
308
306
|
- add execQ() for running quotations
|
|
@@ -310,5 +308,7 @@ and/or version bumps of transitive dependencies.
|
|
|
310
308
|
- add at(), storeAt()
|
|
311
309
|
- add mapN()
|
|
312
310
|
- various small optimizations / refactorings
|
|
313
|
-
-
|
|
314
|
-
-
|
|
311
|
+
- support data vals in program, add collect(), update readme ([6cac0c7](https://github.com/thi-ng/umbrella/commit/6cac0c7))
|
|
312
|
+
- any non-function values in program place themselves on stack
|
|
313
|
+
- update StackProgram type alias
|
|
314
|
+
- add collect() to create stack partitions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/pointfree",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.22",
|
|
4
4
|
"description": "Pointfree functional composition / Forth style stack execution engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.
|
|
38
|
-
"@thi.ng/checks": "^3.3.
|
|
39
|
-
"@thi.ng/compose": "^2.1.
|
|
40
|
-
"@thi.ng/equiv": "^2.1.
|
|
41
|
-
"@thi.ng/errors": "^2.2.
|
|
37
|
+
"@thi.ng/api": "^8.5.0",
|
|
38
|
+
"@thi.ng/checks": "^3.3.3",
|
|
39
|
+
"@thi.ng/compose": "^2.1.19",
|
|
40
|
+
"@thi.ng/equiv": "^2.1.13",
|
|
41
|
+
"@thi.ng/errors": "^2.2.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "^7.33.5",
|
|
45
|
-
"@thi.ng/testament": "^0.3.
|
|
45
|
+
"@thi.ng/testament": "^0.3.5",
|
|
46
46
|
"rimraf": "^3.0.2",
|
|
47
47
|
"tools": "^0.0.1",
|
|
48
|
-
"typedoc": "^0.23.
|
|
48
|
+
"typedoc": "^0.23.20",
|
|
49
49
|
"typescript": "^4.8.4"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"node": ">=12.7"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
|
-
"
|
|
74
|
-
"
|
|
73
|
+
"./*.js",
|
|
74
|
+
"./*.d.ts"
|
|
75
75
|
],
|
|
76
76
|
"exports": {
|
|
77
77
|
".": {
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"thi.ng": {
|
|
133
133
|
"year": 2015
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "75ec32ff7f1b7b5e72e7a04ace24732cd5d6c774\n"
|
|
136
136
|
}
|
package/bench/index.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const Benchmark = require("benchmark");
|
|
2
|
-
const pf = require("../index");
|
|
3
|
-
|
|
4
|
-
pf.safeMode(false);
|
|
5
|
-
|
|
6
|
-
const dotp = pf.word([pf.vmul, pf.push(pf.add), 0, pf.foldl]);
|
|
7
|
-
const dotpQ = pf.word([pf.vmul, [pf.add], 0, pf.foldl]);
|
|
8
|
-
const normalize = pf.word([pf.dup, pf.dup, dotp, pf.sqrt, pf.vdiv]);
|
|
9
|
-
const normalizeQ = pf.word([pf.dup, pf.dup, dotpQ, pf.sqrt, pf.vdiv]);
|
|
10
|
-
|
|
11
|
-
function dotpI(a, b) {
|
|
12
|
-
let sum = 0;
|
|
13
|
-
for (let i = 0; i < a.length; i++) {
|
|
14
|
-
sum += a[i] * b[i];
|
|
15
|
-
}
|
|
16
|
-
return sum;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function normalizeI(v) {
|
|
20
|
-
const mag = Math.sqrt(dotpI(v, v));
|
|
21
|
-
for (let i = 0; i < v.length; i++) {
|
|
22
|
-
v[i] /= mag;
|
|
23
|
-
}
|
|
24
|
-
return v;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let i = 0;
|
|
28
|
-
|
|
29
|
-
new Benchmark.Suite()
|
|
30
|
-
.add("dotp", () =>
|
|
31
|
-
dotp([
|
|
32
|
-
[
|
|
33
|
-
[i++, 2, 3],
|
|
34
|
-
[4, 5, 6],
|
|
35
|
-
],
|
|
36
|
-
])
|
|
37
|
-
)
|
|
38
|
-
.add("dotpQ", () =>
|
|
39
|
-
dotpQ([
|
|
40
|
-
[
|
|
41
|
-
[i++, 2, 3],
|
|
42
|
-
[4, 5, 6],
|
|
43
|
-
],
|
|
44
|
-
])
|
|
45
|
-
)
|
|
46
|
-
.add("dotpI", () => dotpI([i++, 2, 3], [4, 5, 6]))
|
|
47
|
-
.on("cycle", (e) => ((i = 0), console.log(String(e.target))))
|
|
48
|
-
.run({ async: false });
|
|
49
|
-
|
|
50
|
-
new Benchmark.Suite()
|
|
51
|
-
.add("normalize", () => normalize([[[10, 10, 0]]]))
|
|
52
|
-
.add("normalizeQ", () => normalizeQ([[[10, 10, 0]]]))
|
|
53
|
-
.add("normalizeI", () => normalizeI([10, 10, 0]))
|
|
54
|
-
.on("cycle", (e) => console.log(String(e.target)))
|
|
55
|
-
.run({ async: false });
|