[darcs-users] darcs patch: make stringify cut the string
Eric Kow
kowey at darcs.net
Sun Jan 4 16:42:23 UTC 2009
On Sun, Jan 04, 2009 at 17:05:21 +0100, florent.becker at ens-lyon.org wrote:
> Sun Jan 4 11:21:25 CET 2009 florent.becker at ens-lyon.org
> * make stringify cut the string
> This avoids choking utilities such as grep (or emacs' internal grep) which parse haskell files line-by-line.
Applied, thanks! (Minor stylistic comments below)
> - thedata <- getContents
> + thedata <- liftM lines $ getContents
Why not thedata <- lines `fmap` getContents?
> - putStrLn $ varname ++ " = " ++ show thedata
> + putStrLn $ varname ++ " =\"\""
> + forM_ thedata $ \line -> putStrLn (" ++" ++ show line)
Why not putStrLn . unlines . map (\l -> " ++" ++ show l) $ thedata
(which is admittably longer)
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20090104/7afa0d1a/attachment.pgp
More information about the darcs-users
mailing list