Patch 766 Tidy Commands/Replace (and 6 more)

Title Tidy Commands/Replace (and 6 more)
Superseder Nosy List owst
Related Issues
Status accepted Assigned To

Created on 2012-03-30.00:15:25 by owst, last changed 2012-03-31.01:40:21 by gh.

File name Status Uploaded Type Edit Remove
patch-preview.txt owst, 2012-03-30.00:15:24 text/x-darcs-patch
tidy-commands_replace.dpatch owst, 2012-03-30.00:15:24 application/x-darcs-patch
unnamed owst, 2012-03-30.00:15:24
See mailing list archives for discussion on individual patches.
msg15415 (view) Author: owst Date: 2012-03-30.00:15:24
A bunch of clean up/refactorings of Commands/Replace and Patch/TokenReplace,
followed by a fix for issue2125.

7 patches for repository http://darcs.net:

Thu Mar 29 22:06:40 BST 2012  Owen Stephens <darcs@owenstephens.co.uk>
  * Tidy Commands/Replace

Thu Mar 29 22:10:17 BST 2012  Owen Stephens <darcs@owenstephens.co.uk>
  * camelcase a few identifiers in Commands/Replace

Thu Mar 29 23:52:59 BST 2012  Owen Stephens <darcs@owenstephens.co.uk>
  * Tidy Patch/TokenReplace

Thu Mar 29 23:54:54 BST 2012  Owen Stephens <darcs@owenstephens.co.uk>
  * Extract common token-breaking code in Patch/TokenReplace

Fri Mar 30 00:11:59 BST 2012  Owen Stephens <darcs@owenstephens.co.uk>
  * Refactor/tidy-up Commands/Replace

Fri Mar 30 00:33:06 BST 2012  Owen Stephens <darcs@owenstephens.co.uk>
  * Accept issue 2125: darcs replace always warns about forcing, even when unnecessary

Fri Mar 30 01:17:48 BST 2012  Owen Stephens <darcs@owenstephens.co.uk>
  * Resolve issue2125: only warn about forcing replaces, when a force is required.
msg15418 (view) Author: kowey Date: 2012-03-30.15:41:58
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


      [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
       x = does not actually depend on blah blah (less chance of 

3. Possible chance to use the case () of _ | pattern as a better refactor 
for the nested if
msg15443 (view) Author: gh Date: 2012-03-31.01:40:21
Looks like this bundle had already been pushed.
Date User Action Args
2012-03-30 00:15:25owstcreate
2012-03-30 15:41:59koweysetstatus: needs-screening -> accepted-pending-tests
messages: + msg15418
2012-03-31 01:40:21ghsetstatus: accepted-pending-tests -> accepted
messages: + msg15443