Follow HLint suggestion: use <$>#12015
Open
philderbeast wants to merge 19 commits into
Open
Conversation
032d9c5 to
c0f2629
Compare
c0f2629 to
d6f48d1
Compare
d6f48d1 to
388296c
Compare
Bodigrim
reviewed
Jul 5, 2026
Bodigrim
reviewed
Jul 5, 2026
Bodigrim
reviewed
Jul 5, 2026
| Map.lookup pkgid availableTargetsByPackageId = | ||
| fmap (componentTargets WholeComponent) $ | ||
| selectPackageTargets bt ats | ||
| maybe id filterTargetsKind mkfilter <$> Map.lookup pkgid availableTargetsByPackageId = |
Collaborator
There was a problem hiding this comment.
Could maybe id filterTargetsKind mkfilter be moved from pattern guard to the RHS? LIke
| Just ats <- Map.lookup ...
= componentTargets WholeComponent <$> selectPackageTargets bt (maybe id filterTargetsKind mkfilter ats)(I didn't check if it compiles)
Same question below.
Bodigrim
reviewed
Jul 5, 2026
| _ <- Parse.char ':' | ||
| b <- tokenQEnd | ||
| return (TargetString2 a b) | ||
| TargetString2 a <$> tokenQEnd |
Collaborator
There was a problem hiding this comment.
Could we do TargetString2 <$> tokenQ0 <* Parse.char ':' <$> tokenQEnd? Same below.
Bodigrim
reviewed
Jul 5, 2026
Bodigrim
reviewed
Jul 5, 2026
| getEntries ProgramSearchPathDefault = do | ||
| env <- getEnvironment | ||
| return (maybe [] splitSearchPath (lookup "PATH" env)) | ||
| getEntries ProgramSearchPathDefault = maybe [] splitSearchPath . lookup "PATH" <$> getEnvironment |
Collaborator
There was a problem hiding this comment.
If we are changing it anyway, let's use lookupEnv.
Bodigrim
reviewed
Jul 5, 2026
Bodigrim
reviewed
Jul 5, 2026
1834ec6 to
91914a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #9110. Discharges and no longer ignores HLint's "use <$>" suggestion so that this will be suggested by our CI linting.
A similar suggestion, "use fmap", was merged earlier, with #11742.
There were some cascading suggestions that I tackled individually. I'll squash commits before applying the merge label if this pull request is approved.