MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / tally

Function tally

src/compute-engine/library/collections.ts:3051–3071  ·  view source on GitHub ↗
(collection: Expression)

Source from the content-addressed store, hash-verified

3049 * `Join` narrows does not admit (issue #487).
3050 *
3051 * A rejection record that is still present after the LAST step of a fold
3052 * whose own fixpoint fails is also read by the admission pass that follows
3053 * (`admitted` in `refinedFoldCombiner`: the callback admitted again with its
3054 * nested folds refined, which is the literal the fold keeps). Such a record
3055 * was written in that step, or in an earlier one and read again in each
3056 * later step, under a binding that is at or below the binding of the last
3057 * step by the widening assumption above. The record is kept only when the
3058 * binding of the fold's accumulator at the end of the last step is a subtype of
3059 * its binding at the end of the admission pass that held the nested folds
3060 * back, and also of its binding at the end of the pass that reads the
3061 * records. When the second test fails (the accumulator's inferred type
3062 * depends on the refined type of a nested fold), that literal is dropped and
3063 * the callback is admitted again with no record of the steps. The nested
3064 * fold then meets a seed and an enclosing accumulator that are the same or
3065 * wider, as in a further step, and the assumption above applies. Both tests
3066 * read the binding at the END of each pass, while a nested fold reads it
3067 * when it is canonicalized, before the uses that come after it in the body
3068 * narrow it: this is not checked either. Every other record of the steps is
3069 * dropped for that pass, as before.
3070 *
3071 * A settled record is not kept, because a
3072 * fixpoint that it starts can settle on a type wider than the one that the
3073 * iteration from the seed reaches in the admission pass, even when the
3074 * bindings are ordered as above: the types of a body are not always monotone

Callers 1

collections.tsFile · 0.70

Calls 2

indexOfFunction · 0.85
eachMethod · 0.65

Tested by

no test coverage detected