list pattern

A pattern in square brackets that matches a sequence element by element, where two dots (..) stand for any run of elements.

In more detail

It can also capture elements into variables while matching. ids is [1, .., 3] asks whether an array starts with 1 and ends with 3; [var first, ..] captures the first element.

Related terms

Taught in

References