-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:. and :! aren't assigned fixity declarations #322
Comments
Ugh, it turns out that I'm the one who caused these shenanigans. The culprit is here: singletons/src/Data/Singletons/Promote.hs Lines 534 to 539 in 47a62de
Here, I boldly claim that no non-alphanumeric identifiers need to have their fixity declarations promoted, since their promoted names as the same as their unpromoted ones. However, there are exactly two exceptions to this rule: Fix incoming. |
Instead of manually hard-coding the special cases, we can simply check if a name is equal to its promoted counterpart, which is much more robust.
To see what I mean, observe that the following program fails to typecheck:
It ought to, though, since we declared the the fixity of
(!)
(and thus(:!)
) to beinfixr 2
, soFalse && True :! True
should associate as(False && True) :! True
. However, it appears that in practice,(:!)
isn't given a fixity declaration, so that expression actually associates asFalse && (True :! True)
.Indeed, searching through the
-ddump-splices
output reveals no fixity declaration for(:!)
. (There is one for(%!)
, however.)The same problem also affects
(.)
, which promotes to(:.)
.The text was updated successfully, but these errors were encountered: