HLint: use void instead of return()

I have some monadiccode of the form: foo >>= something >>= bar >> return () HLint is telling me to change this to: void (foo >>= something >>= bar) Why is the second form considered better? I actually find the original to be clearer.

In corner cases like this, it really looks like six of one, half dozen of
the other.
In other words, feel free to ignore hlint when you need to. The heuristics
aren't tuned to be 100% perfect.
-- Kim-Ee
On Mon, Apr 22, 2013 at 6:41 PM, harry
I have some monadiccode of the form: foo >>= something >>= bar >> return ()
HLint is telling me to change this to: void (foo >>= something >>= bar)
Why is the second form considered better? I actually find the original to be clearer.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

The vast majority of people use the first form. I guess the second form
would be used if void were in prelude but it isn't, so no one does.
On Mon, Apr 22, 2013 at 7:41 AM, harry
I have some monadiccode of the form: foo >>= something >>= bar >> return ()
HLint is telling me to change this to: void (foo >>= something >>= bar)
Why is the second form considered better? I actually find the original to be clearer.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (3)
-
David McBride
-
harry
-
Kim-Ee Yeoh