Skip to content

Commit 755a0ce

Browse files
committed
Ignore "traverse_" from hlint
In https://travis-ci.org/reflex-frp/reflex/builds/616304027 we notice that hlint suggests: linting file src/Reflex/Spider/Internal.hs... reflex-0.6.2.4/src/Reflex/Spider/Internal.hs:497:13: Warning: Use traverse_ Found: WeakBag.traverse (coincidenceSubscribedSubscribers subscribed) $ invalidateSubscriberHeight outerHeight Perhaps: traverse_ (coincidenceSubscribedSubscribers subscribed) $ invalidateSubscriberHeight outerHeight 1 hint This suggestion isn’t relevant because we don’t have a “traverse_” equivalent for WeakBag.traverse. Looking at the code in Hlint (src/Hint/Monad.hs), it becomes clear that it’s a dumb search for any usage of “traverse”, regardless of being in the Traversable typeclass. What’s less clear is why this used to not be a problem before recently. This error appears to coincide with an update of hlint from v2.2.2 to v2.2.4. To fix this, tell Hlint to ignore “Use traverse_” hints in Reflex. This can be removed once Hlint is taught to distinguise between traverse from the Traversable typeclass and from somewhere else.
1 parent de9d2b0 commit 755a0ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/hlint.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ main = do
2323
, "--ignore=Reduce duplication"
2424
, "--cpp-define=USE_TEMPLATE_HASKELL"
2525
, "--ignore=Use tuple-section"
26+
, "--ignore=Use traverse_"
2627
]
2728
recurseInto = and <$> sequence
2829
[ fileType ==? Directory

0 commit comments

Comments
 (0)