Hi! More Haskell comments. Again, it may be useful for somebody else to look into the actual logic behind the code...
resolve issue1117: warn if file does not exist in whatsnew
----------------------------------------------------------
> - when (areFileArgs files) $
> - putStrLn $ "What's new in "++unwords (map show files)++":\n"
> + when (areFileArgs files)
> + (do warn_if_bogus (slurp_recorded_and_unrecorded repository) files
> + putStrLn $ "What's new in "++unwords (map show files)++":\n")
You can get rid of the parens if you use the ($) operator
when (areFileArgs files) $
do warn_if_bogus (slurp_recorded_and_unrecorded repository) files
putStrLn $ "What's new in "++unwords (map show files)++":\n"
> +warn_if_bogus :: IO (Slurpy,Slurpy) -> [SubPath] -> IO()
Maybe instead of taking IO (Slurpy, Slurpy), you could take
(Slurpy, Slurpy) instead?
> + when (not $ or [(slurp_has fp rec),(slurp_has fp
> pend)])
And maybe this would be simpler as
when (not (slurp_has fp rec || slurp_has fp pend)) $
putStrLn $ "WARNING: File '"++file++"' not in repository!"
> + else do putStrLn $ "WARNING: File '"++file++"' does not
> exist!"
If you want, you can get rid of the 'do' statement here (do is useful
when you have more than one IO action to run).
> + warn_if_bogus slurps fs
> + where fp = toFilePath f
> + file = encode_white fp
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
