printUser users =
case users of
Set.empty ->
text "Empty"
_ ->
text users
caused the syntax error below which is confusing:
-- SYNTAX PROBLEM --------------------------------------------------------------
I ran into something unexpected when parsing your code!
6| Set.empty ->
^
I am looking for one of the following things:
an upper case name
I will suggest @jessta 's answer to my question in the slack, which is much clearer and helpful:
The pattern in case..of need to be literals, they can't be functions or variables.
Set.empty is a function.
You probably want to use a
if..then..else and Set.isEmpty, eg.
if Set.isEmpty users then text "empty" else text users
The following code:
caused the syntax error below which is confusing:
I will suggest @jessta 's answer to my question in the slack, which is much clearer and helpful: