hclang 0.18.0 → 0.19.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.
- package/esm/lib/frames/frame.js +8 -5
- package/esm/lib/version.js +1 -1
- package/package.json +1 -1
package/esm/lib/frames/frame.js
CHANGED
|
@@ -370,17 +370,20 @@ export class Frame extends MetaFrame {
|
|
|
370
370
|
* and never of the source, which is why no source has to declare an element
|
|
371
371
|
* type. Nothing is materialized on the receiver's behalf.
|
|
372
372
|
*
|
|
373
|
-
* An empty stream answers
|
|
374
|
-
*
|
|
375
|
-
*
|
|
373
|
+
* An empty stream answers the receiver it started from. The receiver is the
|
|
374
|
+
* accumulator before any element arrives, so a fold over nothing is that
|
|
375
|
+
* accumulator: an empty collect is `[]`, an empty join `“”`, an empty product
|
|
376
|
+
* `1`. This is what keeps a reduce compositional, since folding a whole stream
|
|
377
|
+
* must equal folding its first part and continuing from that answer, even
|
|
378
|
+
* when the first part is empty.
|
|
376
379
|
*/
|
|
377
380
|
reduce(receiver, receiverState) {
|
|
378
381
|
return Frame.reduceInto(this.elements(), receiver, receiverState);
|
|
379
382
|
}
|
|
380
|
-
/** Threads one stream through a receiver, answering
|
|
383
|
+
/** Threads one stream through a receiver, answering the receiver for an empty one. */
|
|
381
384
|
static reduceInto(values, receiver, receiverState) {
|
|
382
385
|
if (values.length === 0) {
|
|
383
|
-
return
|
|
386
|
+
return receiver;
|
|
384
387
|
}
|
|
385
388
|
return values.reduce((accumulator, value) => accumulator.call(value, Frame.nil, receiverState), receiver);
|
|
386
389
|
}
|
package/esm/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.19.0";
|