Skip to content
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

add hlint #131

Merged
merged 3 commits into from
Dec 7, 2023
Merged

add hlint #131

merged 3 commits into from
Dec 7, 2023

Conversation

4e554c4c
Copy link
Collaborator

@4e554c4c 4e554c4c commented Dec 4, 2023

No description provided.

@isovector
Copy link
Collaborator

Hi there! Thanks for the PR, but I am not very fussy about hlint's ideas of what good Haskell code looks like. In particular, I really hate the following hints:

  • fmap -> <$> hint, since it decreases syntactic compositionality---meaning if I ever change the code, I need to fuck around with sections rather than just inserting a few more $s.
  • Similarly, case @Bool -> if is a bad change, for the same reasons. If the type ever changes, now I need to rewrite the whole block.
  • Rules like fmap . fmap -> fmap (.) detract from readability in large pipelines; yes, they are equivalent to the computer, but they are not equivalent to the human reading the code

@4e554c4c
Copy link
Collaborator Author

4e554c4c commented Dec 4, 2023

re: fmap, it appears to prefer this only if the expression is fmap x $ y, in which case i think x <$> y is more readable

with regard to the others, it's pretty easy to configure hlint to ignore these specific kinds of errors.
hacking on cornelis with hls currently looks like a christmas tree of lint errors, and I would prefer if the style were codified somewhere so that my editor didn't complain

@isovector
Copy link
Collaborator

I would prefer if the style were codified somewhere so that my editor didn't complain

I'm open to this, so long as the hints I pointed out earlier are disabled.

...an easier solution might just be to disable hlint entirely, however ;)

@4e554c4c 4e554c4c force-pushed the lint branch 4 times, most recently from 98bab69 to eeb18a0 Compare December 5, 2023 11:37
@4e554c4c 4e554c4c marked this pull request as ready for review December 5, 2023 11:37
@4e554c4c
Copy link
Collaborator Author

4e554c4c commented Dec 5, 2023

should be ready for review now. the fmap and if refactors are not included

Copy link
Collaborator

@isovector isovector left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits, but otherwise I'm OK with this change. Thanks for the tidying effort!

src/Cornelis/Highlighting.hs Outdated Show resolved Hide resolved
src/Lib.hs Outdated Show resolved Hide resolved
src/Lib.hs Outdated Show resolved Hide resolved
@4e554c4c 4e554c4c requested a review from isovector December 7, 2023 11:35
src/Lib.hs Outdated Show resolved Hide resolved
@isovector
Copy link
Collaborator

Thanks so much!

@isovector isovector merged commit 8202a42 into agda:master Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants