Skip to content

Commit 265ff04

Browse files
committed
#979, flip is not always redundant with BlockArguments
1 parent 51a526b commit 265ff04

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Changelog for HLint (* = breaking change)
22

3+
#979, suggest removing flip only for simple final variables
34
#978, do is not redundant with non-decreasing indentation
45
#969, wrong redundant bracket suggestion with BlockArguments
56
#970, detect redundant sections, (a +) b ==> a + b

data/hlint.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
- warn: {lhs: (Data.Function.& f), rhs: f, name: Redundant Data.Function.&}
301301
- hint: {lhs: \x -> y, rhs: const y, side: isAtom y && not (isWildcard y)}
302302
# If any isWildcard recursively then x may be used but not mentioned explicitly
303-
- warn: {lhs: flip f x y, rhs: f y x, side: isApp original}
303+
- warn: {lhs: flip f x y, rhs: f y x, side: isApp original && isAtom y}
304304
- warn: {lhs: id x, rhs: x}
305305
- warn: {lhs: id . x, rhs: x, name: Redundant id}
306306
- warn: {lhs: x . id, rhs: x, name: Redundant id}
@@ -1170,4 +1170,5 @@
11701170
# test953 = for [] $ \n -> bar n >>= \case {Just n -> pure (); Nothing -> baz n} @NoRefactor
11711171
# f = map (flip (,) "a") "123" -- (,"a")
11721172
# f = map ((,) "a") "123" -- ("a",)
1173+
# test979 = flip Map.traverseWithKey blocks \k v -> lots_of_code_goes_here @NoRefactor
11731174
# </TEST>

0 commit comments

Comments
 (0)