Pattern match multiple values without a Tuple in PureScript
To pattern match multiple values in PureScript, it's very tempting to wrap them with Tuple
data constructor imported from Data.Tuple
as follows:
case (Tuple path role) of
(Tuple "/admin" Admin) -> Allow
(Tuple "/admin" _) -> Deny
_ -> Allow
That's not really necessary!
In fact, it can be easier done with no extra imports and a single comma:
case path, role of
"/admin", Admin -> Allow
"/admin", _ -> Deny
_, _ -> Allow