Skip to content

Move sorted collection helpers from quiter to collections_slice #30

@friedenberg

Description

@friedenberg

Summary

3 TODOs in lib/charlie/quiter/strings.go say "move to collections_slice"
(lib/bravo), but the functions have intra-package dependencies that prevent a
straightforward move:

  • SortedValuesBy calls quiter.CollectSlice
  • SortedStrings calls quiter.Strings (also in the same file)

Moving to lib/bravo/collections_slice would require either:

  1. Moving CollectSlice and Strings too (cascading move), or
  2. Having collections_slice import quiter (bravo importing charlie — NATO
    violation), or
  3. Duplicating/inlining the dependencies

Affected functions

Function Dependency on quiter
SortedValuesBy[ELEMENT] calls CollectSlice
SortedValues[ELEMENT] uses only stdlib slices.Collectcan move as-is
SortedStrings[ELEMENT] calls Strings (same file)

Suggested approach

  • SortedValues can move directly since it only depends on stdlib + lib/alfa
  • For the other two, either move CollectSlice down first, or inline the
    collection step using slices.Collect + an All() call

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions