| 18 | } from '../common/type/primitive.js'; |
| 19 | import { typeToString } from '../common/type/serialize.js'; |
| 20 | import { Type } from '../common/type/types.js'; |
| 21 | import { CancellationError, checkDeadline } from '../common/interruptible.js'; |
| 22 | import { Expression, CollectionHandlers, Sign } from './global-types.js'; |
| 23 | import type { MathJsonExpression } from '../math-json/types.js'; |
| 24 | import { |
| 25 | isFunction, |
| 26 | isNumber, |
| 27 | isString, |
| 28 | isSymbol, |
| 29 | sym, |
| 30 | } from './boxed-expression/type-guards.js'; |
| 31 | |
| 32 | /** If a collection has fewer than this many elements, eagerly evaluate it. |
| 33 | * |
| 34 | * For example, evaluate the Union of two sets with 10 elements each will |
| 35 | * result in a set with 20 elements. |
| 36 | * |
| 37 | * If the sum of the sizes of the two sets is greater than |
| 38 | * `MAX_SIZE_EAGER_COLLECTION`, the result is a Union expression |
| 39 | * |
| 40 | */ |
| 41 | export const MAX_SIZE_EAGER_COLLECTION = 100; |
| 42 | |
| 43 | export function isFiniteIndexedCollection(col: Expression): boolean { |