hlint icon indicating copy to clipboard operation
hlint copied to clipboard

Hint "Functor law" is unaware of pipeline direction

Open andreasabel opened this issue 1 year ago • 1 comments

getContents <&> myLexer <&> pExp >>= \case
  ...

This triggers linter warning: Screenshot 2024-12-09 at 15 51 36

Applying this refactoring would create a pipeline where the flow in the middle is reversed:

getContents <&> pExp . myLexer >>= \case

The pipeline in question here is: read -> lex -> parse -> case.

andreasabel avatar Dec 09 '24 14:12 andreasabel

Yeah, I imagine most people don't want this hint. I think it should be removed.

zliu41 avatar Dec 13 '24 23:12 zliu41

See also #1606.

langston-barrett avatar Aug 14 '25 13:08 langston-barrett

The hint has been disabled in https://github.com/ndmitchell/hlint/pull/1659.

zliu41 avatar Aug 15 '25 18:08 zliu41