@thi.ng/pointfree 3.0.8 → 3.1.3
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 +231 -88
- package/bench/index.js +41 -0
- package/package.json +135 -130
package/CHANGELOG.md
CHANGED
|
@@ -1,171 +1,314 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
- **Last updated**: 2021-12-13T10:26:00Z
|
|
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.
|
|
7
|
+
See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
|
|
7
8
|
|
|
8
|
-
**Note:**
|
|
9
|
+
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
|
+
and/or version bumps of transitive dependencies.
|
|
9
11
|
|
|
12
|
+
## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@3.1.0) (2021-11-17)
|
|
10
13
|
|
|
14
|
+
#### 🚀 Features
|
|
11
15
|
|
|
16
|
+
- Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
|
|
17
|
+
Improving the overall build ergonomics
|
|
18
|
+
- introduced a tools workspaces
|
|
19
|
+
- imported it in all needed packages/examples
|
|
20
|
+
- inclusive project root
|
|
12
21
|
|
|
22
|
+
#### ♻️ Refactoring
|
|
13
23
|
|
|
14
|
-
|
|
24
|
+
- testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
|
|
25
|
+
this commit reverts (partly) changes made in:
|
|
26
|
+
ef346d7a8753590dc9094108a3d861a8dbd5dd2c
|
|
27
|
+
overall purpose is better testament ergonomics:
|
|
28
|
+
instead of having to pass NODE_OPTIONS with every invocation
|
|
29
|
+
having a binary to handle this for us.
|
|
15
30
|
|
|
16
|
-
|
|
31
|
+
### [3.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@3.0.1) (2021-10-13)
|
|
17
32
|
|
|
33
|
+
#### ♻️ Refactoring
|
|
18
34
|
|
|
35
|
+
- update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
|
|
36
|
+
- update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
|
|
37
|
+
- add .js suffix for all relative imports
|
|
19
38
|
|
|
39
|
+
# [3.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@3.0.0) (2021-10-12)
|
|
20
40
|
|
|
41
|
+
#### 🛑 Breaking changes
|
|
21
42
|
|
|
22
|
-
|
|
43
|
+
- major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
|
|
44
|
+
- BREAKING CHANGE: discontinue CommonJS & UMD versions
|
|
45
|
+
- only ESM modules will be published from now on
|
|
46
|
+
- CJS obsolete due to ESM support in recent versions of node:
|
|
47
|
+
- i.e. launch NodeJS via:
|
|
48
|
+
- `node --experimental-specifier-resolution=node --experimental-repl-await`
|
|
49
|
+
- in the node REPL use `await import(...)` instead of `require()`
|
|
50
|
+
- UMD obsolete due to widespread browser support for ESM
|
|
51
|
+
Also:
|
|
52
|
+
- normalize/restructure/reorg all package.json files
|
|
53
|
+
- cleanup all build scripts, remove obsolete
|
|
54
|
+
- switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
|
|
23
55
|
|
|
56
|
+
#### ♻️ Refactoring
|
|
24
57
|
|
|
25
|
-
|
|
58
|
+
- update deps & imports in various pkgs ([e1cf29e](https://github.com/thi-ng/umbrella/commit/e1cf29e))
|
|
59
|
+
- largely related to recent updates/restructuring of these packages:
|
|
60
|
+
- api
|
|
61
|
+
- defmulti
|
|
62
|
+
- errors
|
|
63
|
+
- 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)
|
|
26
67
|
|
|
27
|
-
|
|
68
|
+
### [2.0.18](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@2.0.18) (2020-12-07)
|
|
28
69
|
|
|
70
|
+
#### ♻️ Refactoring
|
|
29
71
|
|
|
30
|
-
|
|
72
|
+
- update type-only imports ([34bb05c](https://github.com/thi-ng/umbrella/commit/34bb05c))
|
|
73
|
+
- update type-only imports in various tests/pkgs ([3fd9c24](https://github.com/thi-ng/umbrella/commit/3fd9c24))
|
|
31
74
|
|
|
32
|
-
|
|
75
|
+
# [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@2.0.0) (2020-04-16)
|
|
33
76
|
|
|
34
|
-
|
|
35
|
-
- CJS obsolete due to ESM support in recent versions of node:
|
|
36
|
-
- i.e. launch NodeJS via:
|
|
37
|
-
- `node --experimental-specifier-resolution=node --experimental-repl-await`
|
|
38
|
-
- in the node REPL use `await import(...)` instead of `require()`
|
|
39
|
-
- UMD obsolete due to widespread browser support for ESM
|
|
77
|
+
#### 🛑 Breaking changes
|
|
40
78
|
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
79
|
+
- add new words, rename HOF words ([0d19c9a](https://github.com/thi-ng/umbrella/commit/0d19c9a))
|
|
80
|
+
- BREAKING CHANGE: rename HOF words
|
|
81
|
+
- add `def` prefix for all HOF words ([#210](https://github.com/thi-ng/umbrella/issues/210))
|
|
82
|
+
- word/U => defWord/U
|
|
83
|
+
- tuple => defTuple
|
|
84
|
+
- join => defJoin
|
|
85
|
+
- op1/2/2v => defOp1/2/2v
|
|
86
|
+
- cond => defCond
|
|
87
|
+
- cases => defCases
|
|
88
|
+
- loadkey => defLoadKey
|
|
89
|
+
- storekey => defStoreKey
|
|
90
|
+
- loop => defLoop
|
|
91
|
+
- push => defPush
|
|
92
|
+
- add new plain words: catr, join
|
|
45
93
|
|
|
94
|
+
## [1.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.3.0) (2020-03-29)
|
|
46
95
|
|
|
96
|
+
#### 🚀 Features
|
|
47
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
|
+
- add whenq(), ismatch() ([44ab1d7](https://github.com/thi-ng/umbrella/commit/44ab1d7))
|
|
48
101
|
|
|
102
|
+
### [1.2.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.2.6) (2020-02-25)
|
|
49
103
|
|
|
104
|
+
#### ♻️ Refactoring
|
|
50
105
|
|
|
51
|
-
|
|
106
|
+
- update imports ([fad6887](https://github.com/thi-ng/umbrella/commit/fad6887))
|
|
52
107
|
|
|
53
|
-
|
|
108
|
+
## [1.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.2.0) (2019-08-21)
|
|
54
109
|
|
|
55
|
-
|
|
110
|
+
#### 🚀 Features
|
|
56
111
|
|
|
57
|
-
|
|
112
|
+
- add new r-stack words, refactor ([dbad162](https://github.com/thi-ng/umbrella/commit/dbad162))
|
|
113
|
+
- add rdup2, rdup3, rover
|
|
58
114
|
|
|
59
|
-
|
|
115
|
+
#### ♻️ Refactoring
|
|
60
116
|
|
|
61
|
-
|
|
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
|
+
- split into separate files ([86a27e5](https://github.com/thi-ng/umbrella/commit/86a27e5))
|
|
62
120
|
|
|
63
|
-
|
|
121
|
+
## [1.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.1.0) (2019-07-07)
|
|
64
122
|
|
|
65
|
-
|
|
66
|
-
- **pointfree:** add tojson()/fromjson() conversion ops ([829f3ab](https://github.com/thi-ng/umbrella/commit/829f3ab129084619c05b434732b46b6c26d32b5e))
|
|
67
|
-
- **pointfree:** add whenq(), ismatch() ([44ab1d7](https://github.com/thi-ng/umbrella/commit/44ab1d7f5ff52a9226b873b42adada3eac1674e9))
|
|
123
|
+
#### 🚀 Features
|
|
68
124
|
|
|
69
|
-
|
|
125
|
+
- enable TS strict compiler flags (refactor) ([1f9d155](https://github.com/thi-ng/umbrella/commit/1f9d155))
|
|
70
126
|
|
|
71
|
-
|
|
127
|
+
#### ♻️ Refactoring
|
|
72
128
|
|
|
73
|
-
-
|
|
129
|
+
- address TS strictNullChecks flag ([50bf59a](https://github.com/thi-ng/umbrella/commit/50bf59a))
|
|
74
130
|
|
|
75
|
-
|
|
131
|
+
### [1.0.14](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.0.14) (2019-05-22)
|
|
76
132
|
|
|
77
|
-
|
|
133
|
+
#### 🩹 Bug fixes
|
|
78
134
|
|
|
79
|
-
-
|
|
135
|
+
- update safeMode handling ([d27bcba](https://github.com/thi-ng/umbrella/commit/d27bcba))
|
|
136
|
+
- actually disable checks if safeMode(false) is called
|
|
80
137
|
|
|
81
|
-
|
|
138
|
+
### [1.0.7](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.0.7) (2019-03-10)
|
|
82
139
|
|
|
83
|
-
|
|
140
|
+
#### ♻️ Refactoring
|
|
84
141
|
|
|
85
|
-
-
|
|
142
|
+
- re-use type aliases from [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/main/packages/api) ([0d2fdff](https://github.com/thi-ng/umbrella/commit/0d2fdff))
|
|
86
143
|
|
|
87
|
-
#
|
|
144
|
+
# [1.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@1.0.0) (2019-01-21)
|
|
88
145
|
|
|
89
|
-
|
|
146
|
+
#### 🛑 Breaking changes
|
|
90
147
|
|
|
91
148
|
- update package build scripts & outputs, imports in ~50 packages ([b54b703](https://github.com/thi-ng/umbrella/commit/b54b703))
|
|
149
|
+
- BREAKING CHANGE: enabled multi-outputs (ES6 modules, CJS, UMD)
|
|
150
|
+
- build scripts now first build ES6 modules in package root, then call
|
|
151
|
+
`scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
|
|
152
|
+
- all imports MUST be updated to only refer to package level
|
|
153
|
+
(not individual files anymore). tree shaking in user land will get rid of
|
|
154
|
+
all unused imported symbols.
|
|
155
|
+
|
|
156
|
+
### [0.8.15](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.8.15) (2018-12-27)
|
|
157
|
+
|
|
158
|
+
#### ♻️ Refactoring
|
|
159
|
+
|
|
160
|
+
- re-use comp() from [@thi.ng/compose](https://github.com/thi-ng/umbrella/tree/main/packages/compose) ([3f9b244](https://github.com/thi-ng/umbrella/commit/3f9b244))
|
|
161
|
+
|
|
162
|
+
### [0.8.6](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.8.6) (2018-08-01)
|
|
92
163
|
|
|
93
|
-
|
|
164
|
+
#### ♻️ Refactoring
|
|
94
165
|
|
|
95
|
-
-
|
|
96
|
-
- build scripts now first build ES6 modules in package root, then call `scripts/bundle-module` to build minified CJS & UMD bundles in `/lib`
|
|
97
|
-
- all imports MUST be updated to only refer to package level (not individual files anymore). tree shaking in user land will get rid of all unused imported symbols.
|
|
166
|
+
- TS3.0 PropertyKey handling ([bf2a307](https://github.com/thi-ng/umbrella/commit/bf2a307))
|
|
98
167
|
|
|
99
|
-
|
|
168
|
+
## [0.8.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.8.0) (2018-05-13)
|
|
100
169
|
|
|
101
|
-
|
|
170
|
+
#### 🚀 Features
|
|
102
171
|
|
|
103
|
-
-
|
|
172
|
+
- add execjs for host calls, update readme ([373701b](https://github.com/thi-ng/umbrella/commit/373701b))
|
|
104
173
|
|
|
105
|
-
|
|
174
|
+
### [0.7.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.7.9) (2018-05-10)
|
|
106
175
|
|
|
107
|
-
|
|
176
|
+
#### 🩹 Bug fixes
|
|
108
177
|
|
|
109
|
-
-
|
|
178
|
+
- minor update error handling ([5391d98](https://github.com/thi-ng/umbrella/commit/5391d98))
|
|
110
179
|
|
|
111
|
-
|
|
180
|
+
### [0.7.8](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.7.8) (2018-05-10)
|
|
112
181
|
|
|
113
|
-
|
|
182
|
+
#### ♻️ Refactoring
|
|
114
183
|
|
|
115
|
-
-
|
|
116
|
-
- **pointfree:** add math ops, update load/loadkey, update tests ([2101e92](https://github.com/thi-ng/umbrella/commit/2101e92))
|
|
184
|
+
- update deps & imports in all packages due to [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/main/packages/api) split ([bc45636](https://github.com/thi-ng/umbrella/commit/bc45636))
|
|
117
185
|
|
|
118
|
-
##
|
|
186
|
+
## [0.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.7.0) (2018-04-03)
|
|
119
187
|
|
|
120
|
-
|
|
188
|
+
#### 🚀 Features
|
|
121
189
|
|
|
122
|
-
-
|
|
190
|
+
- add math ops, update load/loadkey, update tests ([2101e92](https://github.com/thi-ng/umbrella/commit/2101e92))
|
|
191
|
+
- load/loadkey throws error if var doesn't exist
|
|
192
|
+
- add copy() word ([68a8dba](https://github.com/thi-ng/umbrella/commit/68a8dba))
|
|
123
193
|
|
|
124
|
-
|
|
194
|
+
#### ♻️ Refactoring
|
|
125
195
|
|
|
126
|
-
|
|
196
|
+
- update/rename storeat => setat, update tests ([92d2d68](https://github.com/thi-ng/umbrella/commit/92d2d68))
|
|
197
|
+
- change behavior to keep obj on stack
|
|
127
198
|
|
|
128
|
-
|
|
199
|
+
### [0.6.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.6.1) (2018-03-31)
|
|
129
200
|
|
|
130
|
-
|
|
201
|
+
#### 🩹 Bug fixes
|
|
131
202
|
|
|
132
|
-
|
|
203
|
+
- reexport ensureStack fns ([a0bf781](https://github.com/thi-ng/umbrella/commit/a0bf781))
|
|
133
204
|
|
|
134
|
-
|
|
135
|
-
- **pointfree:** add more dataflow combinators, words & tests ([b096e43](https://github.com/thi-ng/umbrella/commit/b096e43))
|
|
205
|
+
## [0.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.6.0) (2018-03-31)
|
|
136
206
|
|
|
137
|
-
|
|
207
|
+
#### 🚀 Features
|
|
138
208
|
|
|
139
|
-
|
|
209
|
+
- add caseq() ([5db90c5](https://github.com/thi-ng/umbrella/commit/5db90c5))
|
|
140
210
|
|
|
141
|
-
|
|
211
|
+
## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.5.0) (2018-03-29)
|
|
142
212
|
|
|
143
|
-
|
|
213
|
+
#### 🚀 Features
|
|
144
214
|
|
|
145
|
-
|
|
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
|
+
- add combinators, update controlflow words, remove execq ([3dc30a8](https://github.com/thi-ng/umbrella/commit/3dc30a8))
|
|
222
|
+
- add condq(), loopq()
|
|
223
|
+
- update dotimes() to use quotations from stack, no more HOF
|
|
224
|
+
- add dip/2/3/4 combinators
|
|
225
|
+
- add keep/2/3 combinators
|
|
226
|
+
- add bi/2/3 combinators
|
|
227
|
+
- add dup3
|
|
228
|
+
- refactor exec to work w/ quotations, remove execq
|
|
229
|
+
- add/update tests
|
|
146
230
|
|
|
147
|
-
|
|
148
|
-
- **pointfree:** wordU(), add tests ([1a01f9a](https://github.com/thi-ng/umbrella/commit/1a01f9a))
|
|
231
|
+
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.4.0) (2018-03-29)
|
|
149
232
|
|
|
150
|
-
|
|
233
|
+
#### 🚀 Features
|
|
151
234
|
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
235
|
+
- add new words, constructs, aliases, fix re-exports ([943b4f9](https://github.com/thi-ng/umbrella/commit/943b4f9))
|
|
236
|
+
- add dotimes() loop construct
|
|
237
|
+
- add obj(), bindkeys() object words
|
|
238
|
+
- add rinc/rdec() r-stack words
|
|
239
|
+
- add sin/cos/atan2/rand/log math ops
|
|
240
|
+
- add vec2/3/4 tuple aliases
|
|
241
|
+
- add API types & comp() to re-exports
|
|
159
242
|
|
|
160
|
-
##
|
|
243
|
+
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.3.0) (2018-03-28)
|
|
161
244
|
|
|
162
|
-
|
|
245
|
+
#### 🚀 Features
|
|
163
246
|
|
|
164
|
-
-
|
|
247
|
+
- major update readme, package ([e52b869](https://github.com/thi-ng/umbrella/commit/e52b869))
|
|
248
|
+
- add new words, rename words, remove mapnth, pushl2 ([0f0c382](https://github.com/thi-ng/umbrella/commit/0f0c382))
|
|
249
|
+
- add mapl(), mapll() array transformers
|
|
250
|
+
- refactor foldl() in terms of mapl()
|
|
251
|
+
- add even/odd()
|
|
252
|
+
- rename ladd etc. vadd...
|
|
253
|
+
- revert op2v to produce new result arrays
|
|
254
|
+
- add runE() syntax sugar
|
|
255
|
+
- update tests
|
|
256
|
+
- add rstack, update StackContext ([1c4cd2f](https://github.com/thi-ng/umbrella/commit/1c4cd2f))
|
|
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))
|
|
165
271
|
|
|
166
|
-
|
|
272
|
+
#### 🩹 Bug fixes
|
|
167
273
|
|
|
168
|
-
|
|
274
|
+
- add 0-arity comp() (identity fn) ([10d5a34](https://github.com/thi-ng/umbrella/commit/10d5a34))
|
|
275
|
+
- wordU(), add tests ([1a01f9a](https://github.com/thi-ng/umbrella/commit/1a01f9a))
|
|
169
276
|
|
|
170
|
-
|
|
171
|
-
|
|
277
|
+
#### ♻️ Refactoring
|
|
278
|
+
|
|
279
|
+
- rename core words & change case ([ba0bcc2](https://github.com/thi-ng/umbrella/commit/ba0bcc2))
|
|
280
|
+
- runU => runu
|
|
281
|
+
- map => maptos
|
|
282
|
+
- mapN => mapnth
|
|
283
|
+
- dropIf/dupIf => dropif/dupif
|
|
284
|
+
- condM => cases
|
|
285
|
+
- bitAnd/Or/Not => bitand/or/not
|
|
286
|
+
- isPos/Neg/Null/Zero => ispos/neg/null/zero
|
|
287
|
+
- execQ => execq
|
|
288
|
+
- storeAt => storeat
|
|
289
|
+
- pushEnv => pushenv
|
|
290
|
+
- loadKey/storeKey => loadkey/storekey
|
|
291
|
+
|
|
292
|
+
### [0.2.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.2.1) (2018-03-23)
|
|
293
|
+
|
|
294
|
+
#### 🩹 Bug fixes
|
|
295
|
+
|
|
296
|
+
- fix readme/docs ([f211c39](https://github.com/thi-ng/umbrella/commit/f211c39))
|
|
297
|
+
|
|
298
|
+
## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/pointfree@0.2.0) (2018-03-23)
|
|
299
|
+
|
|
300
|
+
#### 🚀 Features
|
|
301
|
+
|
|
302
|
+
- support data vals in program, add collect(), update readme ([6cac0c7](https://github.com/thi-ng/umbrella/commit/6cac0c7))
|
|
303
|
+
- any non-function values in program place themselves on stack
|
|
304
|
+
- update StackProgram type alias
|
|
305
|
+
- add collect() to create stack partitions
|
|
306
|
+
- add unwrap, quatations, math/bitops, array/obj access ([f75486d](https://github.com/thi-ng/umbrella/commit/f75486d))
|
|
307
|
+
- add runU(), wordU() & unwrap()
|
|
308
|
+
- add execQ() for running quotations
|
|
309
|
+
- add more math ops
|
|
310
|
+
- add at(), storeAt()
|
|
311
|
+
- add mapN()
|
|
312
|
+
- various small optimizations / refactorings
|
|
313
|
+
- add dropIf, neg, nop, update cond,condM, add docs/readme ([58f5716](https://github.com/thi-ng/umbrella/commit/58f5716))
|
|
314
|
+
- 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))
|
package/bench/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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", () => dotp([[[i++, 2, 3], [4, 5, 6]]]))
|
|
31
|
+
.add("dotpQ", () => dotpQ([[[i++, 2, 3], [4, 5, 6]]]))
|
|
32
|
+
.add("dotpI", () => dotpI([i++, 2, 3], [4, 5, 6]))
|
|
33
|
+
.on("cycle", (e) => (i = 0, console.log(String(e.target))))
|
|
34
|
+
.run({ async: false });
|
|
35
|
+
|
|
36
|
+
new Benchmark.Suite()
|
|
37
|
+
.add("normalize", () => normalize([[[10, 10, 0]]]))
|
|
38
|
+
.add("normalizeQ", () => normalizeQ([[[10, 10, 0]]]))
|
|
39
|
+
.add("normalizeI", () => normalizeI([10, 10, 0]))
|
|
40
|
+
.on("cycle", (e) => console.log(String(e.target)))
|
|
41
|
+
.run({ async: false });
|
package/package.json
CHANGED
|
@@ -1,131 +1,136 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
2
|
+
"name": "@thi.ng/pointfree",
|
|
3
|
+
"version": "3.1.3",
|
|
4
|
+
"description": "Pointfree functional composition / Forth style stack execution engine",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "./index.js",
|
|
7
|
+
"typings": "./index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree#readme",
|
|
14
|
+
"funding": [
|
|
15
|
+
{
|
|
16
|
+
"type": "github",
|
|
17
|
+
"url": "https://github.com/sponsors/postspectacular"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "patreon",
|
|
21
|
+
"url": "https://patreon.com/thing_umbrella"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"author": "Karsten Schmidt <k+npm@thi.ng>",
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "yarn clean && tsc --declaration",
|
|
28
|
+
"clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
|
|
29
|
+
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
30
|
+
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
31
|
+
"doc:readme": "yarn doc:stats && tools:readme",
|
|
32
|
+
"doc:stats": "tools:module-stats",
|
|
33
|
+
"pub": "yarn npm publish --access public",
|
|
34
|
+
"test": "testament test"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@thi.ng/api": "^8.3.3",
|
|
38
|
+
"@thi.ng/checks": "^3.1.3",
|
|
39
|
+
"@thi.ng/compose": "^2.1.3",
|
|
40
|
+
"@thi.ng/equiv": "^2.1.3",
|
|
41
|
+
"@thi.ng/errors": "^2.1.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@microsoft/api-extractor": "^7.19.2",
|
|
45
|
+
"@thi.ng/testament": "^0.2.3",
|
|
46
|
+
"rimraf": "^3.0.2",
|
|
47
|
+
"tools": "^0.0.1",
|
|
48
|
+
"typedoc": "^0.22.10",
|
|
49
|
+
"typescript": "^4.5.3"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"binary",
|
|
53
|
+
"composition",
|
|
54
|
+
"concatenative",
|
|
55
|
+
"dataflow",
|
|
56
|
+
"datastructure",
|
|
57
|
+
"dsl",
|
|
58
|
+
"forth",
|
|
59
|
+
"functional",
|
|
60
|
+
"pipeline",
|
|
61
|
+
"pointfree",
|
|
62
|
+
"stack",
|
|
63
|
+
"transformation",
|
|
64
|
+
"typescript"
|
|
65
|
+
],
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=12.7"
|
|
71
|
+
},
|
|
72
|
+
"files": [
|
|
73
|
+
"*.js",
|
|
74
|
+
"*.d.ts"
|
|
75
|
+
],
|
|
76
|
+
"exports": {
|
|
77
|
+
".": {
|
|
78
|
+
"import": "./index.js"
|
|
79
|
+
},
|
|
80
|
+
"./api": {
|
|
81
|
+
"import": "./api.js"
|
|
82
|
+
},
|
|
83
|
+
"./array": {
|
|
84
|
+
"import": "./array.js"
|
|
85
|
+
},
|
|
86
|
+
"./binary": {
|
|
87
|
+
"import": "./binary.js"
|
|
88
|
+
},
|
|
89
|
+
"./cond": {
|
|
90
|
+
"import": "./cond.js"
|
|
91
|
+
},
|
|
92
|
+
"./context": {
|
|
93
|
+
"import": "./context.js"
|
|
94
|
+
},
|
|
95
|
+
"./dataflow": {
|
|
96
|
+
"import": "./dataflow.js"
|
|
97
|
+
},
|
|
98
|
+
"./env": {
|
|
99
|
+
"import": "./env.js"
|
|
100
|
+
},
|
|
101
|
+
"./io": {
|
|
102
|
+
"import": "./io.js"
|
|
103
|
+
},
|
|
104
|
+
"./logic": {
|
|
105
|
+
"import": "./logic.js"
|
|
106
|
+
},
|
|
107
|
+
"./loop": {
|
|
108
|
+
"import": "./loop.js"
|
|
109
|
+
},
|
|
110
|
+
"./math": {
|
|
111
|
+
"import": "./math.js"
|
|
112
|
+
},
|
|
113
|
+
"./ops": {
|
|
114
|
+
"import": "./ops.js"
|
|
115
|
+
},
|
|
116
|
+
"./run": {
|
|
117
|
+
"import": "./run.js"
|
|
118
|
+
},
|
|
119
|
+
"./safe": {
|
|
120
|
+
"import": "./safe.js"
|
|
121
|
+
},
|
|
122
|
+
"./stack": {
|
|
123
|
+
"import": "./stack.js"
|
|
124
|
+
},
|
|
125
|
+
"./string": {
|
|
126
|
+
"import": "./string.js"
|
|
127
|
+
},
|
|
128
|
+
"./word": {
|
|
129
|
+
"import": "./word.js"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"thi.ng": {
|
|
133
|
+
"year": 2015
|
|
134
|
+
},
|
|
135
|
+
"gitHead": "2db9dd34c0c2c60cbfde3dad0bca352b20292f5c\n"
|
|
136
|
+
}
|