Sample [p1 | p2] [p1 | p2] corresponds to a non-empty list whose head matches the pattern p1 and whose tail matches the pattern p2 . Since the pattern _ matches anything, [_ | _] [_ | _] matches any non-empty list.
_ By itself, on the other hand, matches anyone, including an empty list.
source share