Hi,

> Fri Nov 24 16:48:10 CET 2006  [EMAIL PROTECTED]
>   * 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.

Attachment: pgpQ3S8etD8li.pgp
Description: PGP signature

_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to