chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.78k stars 419 forks source link

What Sort module symbols should the Search module reexport? #25849

Open jabraham17 opened 1 month ago

jabraham17 commented 1 month ago

Currently the Search module reexports the two provided comparators by Sort, DefaultComparator and ReverseComparator. This is done so that users of Search can make use of the same comparators.

The old Sort module API (prior to Chapel 2.2) allowed users to define their own comparators through ducktyping/magic methods, but the new API requires a custom comparator to implement one of three interfaces. Presumably, the Search module will take a similar approach. So it may be useful for the Search module to also reexport the comparator interfaces (keyComparator, keyPartComparator, relativeComparator, and sortComparator).

bradcray commented 1 month ago

This sound good to me. Or maybe better… should the comparator-related things go into their own module that's re-exported by both?