Skip to content

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

Open
@carloosaf

Description

@carloosaf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions