[darcs-devel] darcs patch: refactor: replace recursive indent with more concise f...

David Roundy droundy at darcs.net
Fri Jan 4 14:13:47 UTC 2008


On Tue, Jan 01, 2008 at 03:30:46PM -0500, mark at summersault.com wrote:
> Tue Jan  1 15:04:47 EST 2008  Mark Stosberg <mark at summersault.com>
>   * refactor: replace recursive indent with more concise find-and-replace syntax

Applied.  Thanks, Mark!

Although I'd rather not use Text.Regex for this (I have a longstanding fear
of the Regex libraries, ever since a traumatic encounter with a segfaulting
regex... back in ghc 4.x or something), less code does seem better.  Your
code is less efficient, but for an error message that won't matter.  I
suspect we could get something even more elegant with lines
and unlines... hmmmm:

indent = unlines . map ("    "++) . lines

Okay, I've gone ahead and implemented this change.  But thanks for finding
the less-than-elegant code!
-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-devel mailing list