Skip to content

Support array filter and sort #39

Closed as not planned
Closed as not planned

Description

@Mearman

A filter removes elements and a sort discards the original order, so neither can be undone from the output alone.

Decision: decline. Wildcards are index-aligned (element i of a source array is element i of its target array), and that alignment is what makes every wildcard rule invertible. A filter or sort applied to an array two-way rules write would move elements away from the positions those rules decode from, so it would break their inverse silently rather than declare a loss. A filtered or sorted copy written somewhere else is a derived one-way value with an element predicate and a sort key, which is a query rather than a crosswalk rule. The position-preserving form of "only some elements" is per-element when gating (#40), which leaves skipped elements in place.

Revisit if a target format requires a sorted or compacted array as its only representation, with the permutation recorded in the target so decode can restore the original order.

The README reason for this omission is updated in #56.

Activity

  1. added
    enhancementNew feature or request
    deferredDeliberately not built yet, with a trigger for revisiting
    on Oct 20, 2026
  2. added theissue type on Oct 20, 2026
  3. Mearman commented on Oct 21, 2026

    @Mearman
    MemberAuthor

    Declined as recorded: filter and sort break index alignment, which is what makes wildcard rules invertible. Per-element when gating is the position-preserving form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferredDeliberately not built yet, with a trigger for revisitingenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions