You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
M.hs:2:11: error: Not in scope: ‘x’
|
2 | pattern P x = ()
| ^
I think this is too terse and the error should give more explanation. For a newcomer, it's very natural to expect it to work, because f x = () works.
For comparison,
patternQ= x
gives
M.hs:2:13: error:
Invalid right-hand side of bidirectional pattern synonym ‘Q’:
‘x’ is not bound by the LHS of the pattern synonym
RHS pattern: x
|
2 | pattern Q = x
| ^
This is better, though it could also suggest adding 'x' to the LHS, or changing it to a wildcard, or making the pattern synonym unidirectional.
The text was updated successfully, but these errors were encountered:
This
gives
I think this is too terse and the error should give more explanation. For a newcomer, it's very natural to expect it to work, because
f x = ()
works.For comparison,
gives
This is better, though it could also suggest adding 'x' to the LHS, or changing it to a wildcard, or making the pattern synonym unidirectional.
The text was updated successfully, but these errors were encountered: