I’d like to ask whether it is somehow possible to write pattern match (in
case in this example) with multiple occurrences of single variable “placeholder”. By this I would be able to “constraint”
cased expression even more…
case ( cookie.selectedCategoryId, c.id ) of ( Just selectedId, selectedId ) -> "It equals!" (_, _ ) -> "It does not equal or 1st item of tuple is Noothing"
In this example I would like to check that
Just a and
a equals to
But it produces following error:
-- NAME CLASH --------------- C:\....\Main.elm This `case` pattern has multiple `selectedId` variables. 651| ( Just selectedId, selectedId ) -> ^^^^^^^^^^ How can I know which one you want? Rename one of them!
Should it be possible to write something like that or shall I figure it out using additional