Skip to content

Constructor for lists (:) does not work in hamlet template #222

@EugineKosenko

Description

@EugineKosenko

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.

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