-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: Check that all overs and unders are used in toplevel defs #48
Conversation
f(x) = x | ||
^ | ||
|
||
Type mismatch when checking (x,「x」) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this (x,「x」)
coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, but that doesn't look right! My guess is that (x, 「x」)
is the LHS and RHS of this clause
brat/Brat/Checker.hs
Outdated
where | ||
checkConnectorsUsed _ _ _ ([], []) = pure () | ||
checkConnectorsUsed (_, tmFC) tm (_, unders) ([], rightUnders) = localFC tmFC $ | ||
err (TypeMismatch tm (showRow unders) (showRow (filter ((`notElem` (fst <$> rightUnders)) . fst) unders))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you do drop (length rightUnders) unders
instead of the filter? The unused unders should always be on the right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually want to drop
everything until rightUnders
, it's quite annoying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idiomatic ways i thought of to do this all involved a double reverse, which seems a bit objectionable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So drop (length unders - length rightUnders) unders
also doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 yes, that should work
No description provided.