[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-beginners
Subject:    Re: [Haskell-beginners] HLint: use void instead of return()
From:       Kim-Ee Yeoh <ky3 () atamo ! com>
Date:       2013-04-22 16:18:12
Message-ID: CAPY+ZdS8YG=1cYN1iypY0f3BQm3OCvJ=rNxb6dX0B+3rm0qJVg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Mon, Apr 22, 2013 at 8:29 PM, harry <voldermort@hotmail.com> wrote:

> 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

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_extra">On Mon, Apr 22, 2013 at 8:29 PM, harry <span \
dir="ltr">&lt;<a href="mailto:voldermort@hotmail.com" \
target="_blank">voldermort@hotmail.com</a>&gt;</span> wrote:<br><div \
class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div id=":ur">So when is void \
better?</div></blockquote></div><div class="gmail_extra"><br></div><div \
class="gmail_extra" style>

The short answer is when you have a single quux. Then void quux is probably more \
natural than quux &gt;&gt; return ().</div><div class="gmail_extra" \
style><br></div><div class="gmail_extra" style>Not having read hlint&#39;s code, my \
guess is that hlint is blindly flagging instances of blahblah &gt;&gt; return (). \
Implementing this single quux condition may only be a tweak away, and I&#39;m \
inclined to think the maintainer would happily accept the patch.</div>

<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Nevertheless \
David has a good point about void not being in the prelude.</div><div \
class="gmail_extra" style><br></div><div class="gmail_extra" style>

Also, too many void&#39;s in the code raises alarm bells for me.</div><br \
clear="all"><div>-- Kim-Ee</div> </div></div>



_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic