[darcs-devel] [patch766] Tidy Commands/Replace (and 6 more)

Eric Kow bugs at darcs.net
Fri Mar 30 15:41:59 UTC 2012


Eric Kow <kowey at darcs.net> added the comment:

Yup, looks good (I didn't understand the gap stuff, but apparently that's 
not a big deal).

Three silly style details I think we could follow up on (that I'm feeling 
a little less shy now we're cleaning up)

1. Before

     foo <- long long thing x
     bar <- long long thing y

   After

      [foo, bar] <- mapM (long long thing) [x,y]

   Better yet?

       let shorter = long long thing
       foo <- shorter x
       bar <- shorter y

2. Keep scope small (the less knowledge the better)

   Before: do
      blah blah
      let x = does not actually depend on blah blah
      other blah
 
    After: do
       blah blah blah
       other blah
     where
       x = does not actually depend on blah blah (less chance of 
error/misunderstanding?)

3. Possible chance to use the case () of _ | pattern as a better refactor 
for the nested if

----------
status: needs-screening -> accepted-pending-tests

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch766>
__________________________________


More information about the darcs-devel mailing list