The next code snippet
$case [1, 2, 3]
$of x:xs
#{x}
$forall y <- xs
, #{y}
causes an error:
unexpected ":"
expecting letter or digit, "_", "'", " ", "@", "," or ")"
The pattern of empty list [] is supported, but the support for compound list constructor (:) is not. Is it a bug or a feature? It is possible to make a workaround, using $if clause, but the case pattern seems to be more natural here.
The next code snippet
causes an error:
The pattern of empty list [] is supported, but the support for compound list constructor (:) is not. Is it a bug or a feature? It is possible to make a workaround, using
$ifclause, but the case pattern seems to be more natural here.