Constants in node patterns
What is the purpose of the constant not allowed in a node pattern
error in checkFunctionBodies?
It prevents you from writing things like:
Start
# [] = [1]
= 1
This is useful. Without the error you might think that the program will check that the pattern matches. However, we are allowed to write the following, and there you would then also want an error:
Start
# [_:_] = []
= 1
So this can't be it, or it would be more useful to check whether any variables are bound instead of whether the pattern has arity 0.
Or is the problem that the pattern match would never be performed? But then should this not be a warning instead of an error (and also appear for patterns that do not bind any variables)?