[darcs-devel] darcs patch: enhanced pretty printing of SlurpDir debug output.

Eric Y. Kow eric.kow at gmail.com
Sat Nov 25 08:23:01 PST 2006


Hi,

> Fri Nov 24 16:48:10 CET 2006  fis at etc-network.de
>   * enhanced pretty printing of SlurpDir debug output.

Thanks again.  I'm going to wait for a resubmission, because unless I am
mistaken, this would slightly mess up the display of empty directories.
It seems like an empty directory would give us
Dir foo
 End Dir foo

Also, where is this show instance used?  Is there a verbose version of
some darcs command that shows slurpies, or is this used more from ghci,
or something else?

> indent = {- ("  " ++) . -} f
>     where
>     f [] = []
>     f ('\n':[]) = "\n"
>     f ('\n':s) = "\n  " ++ f s
>     f (c:s) = c : f s

It seems that something similar could be achieved by
indent = unlines . map (' ':) . lines

This lets you simplify the show code as well

        "Dir " ++ (fn2fp fn) ++ "\n" ++
                    indent (concatMap show l) ++ "End Dir " ++ (fn2fp fn) ++ "\n"

(note the lack of initial space, also, throwing in a concatMap while
we're at it)

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20061125/3e1e8fe9/attachment.pgp


More information about the darcs-devel mailing list