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

Add [head, ..tail] Pattern to List Patterns page #128

Open
carloosaf opened this issue Sep 5, 2024 · 2 comments
Open

Add [head, ..tail] Pattern to List Patterns page #128

carloosaf opened this issue Sep 5, 2024 · 2 comments

Comments

@carloosaf
Copy link

carloosaf commented Sep 5, 2024

The List Patterns section does not include any example of a patterns that destructures the tail of the list into a variable like [head, ..tail]. This kind of pattern is then shown in the List Recursion section but in my opinion it should also be included in the patterns page for clarity.
I was looking for this kind of pattern while working on a little project and I assumed that this kind of destructuring wasn't possible because it wasn't mentioned. Including it earlier would help avoid confusion for users exploring list pattern matching.

@lpil
Copy link
Member

lpil commented Sep 17, 2024

How would you teach that?

@carloosaf
Copy link
Author

Sorry for the delayed response. I've created a PR with the proposed changes.

P.S.: This is my first time contributing to an open-source project with both an Issue and a PR, so please let me know if I've missed anything or made any mistakes.

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

No branches or pull requests

2 participants