Re: [Haskell-beginners] HLint: use void instead of return()

In corner cases like this, it really looks like six of one, half dozen of
So when is void better?
Kim-Ee Yeoh
In other words, feel free to ignore hlint when you need to. The heuristics aren't tuned to be 100% perfect.

If you think it looks prettier, then use it. But it is just (\x -> x >>
return ()) under the hood so it makes no difference.
On Mon, Apr 22, 2013 at 9:29 AM, harry
So when is void better?
Kim-Ee Yeoh
writes: 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.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Mon, Apr 22, 2013 at 8:29 PM, harry
So when is void better?
The short answer is when you have a single quux. Then void quux is probably more natural than quux >> return (). Not having read hlint's code, my guess is that hlint is blindly flagging instances of blahblah >> return (). Implementing this single quux condition may only be a tweak away, and I'm inclined to think the maintainer would happily accept the patch. Nevertheless David has a good point about void not being in the prelude. Also, too many void's in the code raises alarm bells for me. -- Kim-Ee
participants (3)
-
David McBride
-
harry
-
Kim-Ee Yeoh