Skip to content

Conversation

@wtetzner
Copy link

The numeric singleton types already have comparison operators, but for some reason this was still missing for singleton String types.

This enables a lot of potential valuable type-level computations, but one in particular is the ability to sort a named tuple, which means that if you're commonly adding/removing entries from a named tuple, this provides a way to normalize them, so two named tuples that were constructed in a different order can still be treated as equivalent types.

Test results: https://gist.github.com/wtetzner/6f38842c5d06a5d70ba5eea2cf7ce298

@wtetzner wtetzner requested a review from a team as a code owner December 14, 2025 02:59
…ring.

The numeric singleton types already have comparison operators, but for
some reason this was still missing for singleton String types.

This enables a lot of potential valuable type-level computations, but
one in particular is the ability to sort a named tuple, which means that
if you're commonly adding/removing entries from a named tuple, this
provides a way to normalize them, so two named tuples that were
constructed in a different order can still be treated as equivalent
types.
@wtetzner wtetzner force-pushed the string-singleton-comparisons branch from 881ae82 to f5d3a15 Compare December 14, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant