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

Proposal: add tuple destructuring definition in LET/IN blocks #14

Open
ahelwer opened this issue Nov 18, 2024 · 0 comments
Open

Proposal: add tuple destructuring definition in LET/IN blocks #14

ahelwer opened this issue Nov 18, 2024 · 0 comments

Comments

@ahelwer
Copy link

ahelwer commented Nov 18, 2024

Often I will have some function handling a tuple as an intermediate result. It would be nice to have some way to destructure it instead of having to use indices. It makes sense to add this as an additional definition type inside LET/IN blocks, like:

LET
  result == f[x]
  <<y, z>> == result
IN expr

This would semantically decompose to:

LET
  result == f[x]
  y == result[1]
  z == result[2]
IN expr

Tuple destructuring is present in set map/filter syntax, which is convenient, but it would be nice to have it when dealing with only a single value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant