Skip to content

Conversation

@gldubc
Copy link
Member

@gldubc gldubc commented Jun 20, 2025

Adopt a fully normalized representation for tuples, as union of (non-empty, see below) positive tuples. All negations are eliminated as soon as they appear.

This simplifies the code for many tuple operators.

Additionally: made tuple constructor tuple_descr check emptiness of the list of types used to create a tuple. This makes tuple([none(), integer()]) instantly create none(). Combined with the new representation, this allows checking for emptiness of tuple types in constant time (if the field is present, it is non-empty).

@josevalim josevalim merged commit cc9a5e7 into elixir-lang:main Jun 20, 2025
13 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@josevalim josevalim deleted the new-tuple-representation branch June 20, 2025 12:20
ggVGc pushed a commit to ggVGc/elixir-verbatim that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants