Skip to content

Document @ binding syntax for pattern matching #7173

Closed
@kvanbere

Description

@kvanbere

Pattern matching binding syntax is not intuitive and requires documentation, as evidenced by the original issue below

Original

Sometimes it is desirable to be able to bind the entire pattern matched to a separate variable. Haskell uses @ for this, and it works nicely.

Consider input (1,2) fed into...

match vector {
  c@(a, b) => ...
}

...where c = (1,2), a = 1 and b = 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions