Make test default more explicit.
--------------------------------
> +data WantTest = WantTest | WantNoTest
It occurred to me on the walk home that here actually, it probably
doesn't make any sense to re-invent Bool. It was a good idea in lots of
other cases because it avoided passing around a lot of meaningless
looking identical Bools, but since there's little risk of this
happening, it seems like the wantTest function should just return Bool.
> + case wantTest opts of
> + WantNoTest -> return ()
> + WantTest -> withCurrentDirectory dir $
In any case, my more general point was that the default values of flags
should not be buried deep down in the Darcs.Repository level, but should
be closer to the surface so that (A) we can just flip a default without
worrying about breaking some obscure part of the code and (B) we always
know what the defaults are without having to dig through the code.
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
|