elementsHasSplit = (
    elements,
    elementPatt,
    bound,
    inResults = undefined,
    outResults = undefined,
    check = identChecker,
  ) => {
    let count = 0n;
    // Since this feature is motivated by ERTP's use on
    // non-fungible (`set`, `copySet`) amounts,
    // their arrays store their elements in decending lexicographic order.
    // But this function has to make some choice amoung equally good minimal
    // results. It is more intuitive for the choice to be the first `bound`
    // matching elements in ascending lexicigraphic order, rather than
    // decending. Thus we iterate `elements` in reverse order.
    for (let i = elements.length - 1; i >= 0; i -= 1) {
      const element = elements[i];
      if (count < bound) {
        if (matches(element, elementPatt)) {
          count += 1n;
          if (inResults) inResults.push(element);
        } else if (outResults) {
          outResults.push(element);
        }
      } else if (outResults === undefined) {
        break;
      } else {
        outResults.push(element);
      }
    }
    return check(
      count >= bound,
      X`Has only ${q(count)} matches, but needs ${q(bound)}`,
    );
  }
@param {CopyArray} elements
@param {Pattern} elementPatt
@param {bigint} bound Must be >= 1n
@param {CopyArray} [inResults]
@param {CopyArray} [outResults]
@param {Checker} [check]
@returns {boolean}