Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuple projections #452

Open
radrow opened this issue May 13, 2023 · 0 comments
Open

Tuple projections #452

radrow opened this issue May 13, 2023 · 0 comments
Labels
effort: low enhancement New feature or request

Comments

@radrow
Copy link
Member

radrow commented May 13, 2023

Tuple projections are awkward, even considering standard library which offers fst, snd etc. for pairs and triples. There should be a convenient generic way of accessing them:

let t = (1, "xd", true, [4,5,6,7])

t[1] + List.length(t[4])

It's to be discussed if we prefer indexing from 0 or 1. For reference, Erlang and Scala do it from 1, while Python and JS prefer 0. Note that computationally it does not matter, because the index has to be a fixed (syntactically) integer due to type consequences.

@radrow radrow added enhancement New feature or request effort: low labels May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: low enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant