-
Notifications
You must be signed in to change notification settings - Fork 83
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
Make Ormolu print debug info about operator fixity inference #1097
Conversation
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.
My other PR also added troubleshooting docs to the README. Perhaps that would still be useful to add?
I'm still not a fan of manually passing Bools all the way down the stack. I also think it would be better if there were one way to log things, instead of some places using hPutStrLn stderr
and some using trace
.
@@ -261,7 +261,7 @@ checkFixities dependencies fixityImports expectedResult = | |||
where | |||
actualResult = | |||
fmap | |||
(\(k, _) -> (k, inferFixity k resultMap)) | |||
(\(k, _) -> (k, inferFixity False k resultMap)) |
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.
Call sites like this would make it nice if we used some dedicated type instead of Bool
, eg
data DebugLogging = DebugLoggingEnabled | DebugLoggingDisabled
(unless this is too annoying, but I don't immediately see a big obstacle)
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.
Yeah, but then in general it applies to pretty much any Bool
and we have quite a few of them, see Config
for example. Maybe a separate PR could be opened for this kind of refactoring.
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.
Do you have an opinion whether choice
might be worth it? I think it could be a nice as an alternative to our various "blind Bool
s" (and even some ad-hoc two-constructor types, like IsApplicand
or ForAllVisibility
).
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.
choice
looks nice!
Close #1060, close #1069.