> I am still in favor for a state monad to carry around all
> options, read from files, command line or environment variables.

Another argument in favour of the StateT monad: it would probably
generalise a couple of unrelated aspects of the darcs code.  Some
examples off the top of my head:

* We have this hacky-looking thing where each command calls
  System.exit(With) and then DarcsCommands traps the exit.

* Recently, Nathaniel Gray proposed a patch, if I understand correctly,
  to pass information generated during darcs commands to the posthooks,
  information such as the number of patches successfully applied.

Anything else anyone can think of?

> Then it would be clear from the type declaration which functions
> changed their behavior according to customizations. And we
> wouldn't have to pass the opt arg around, parsing it again and
> again possibly in slightly different ways by accident. But then
> again, this might affect almost every little function in darcs.

Fortunately, the functions mostly likely to be affected by this
will already be in IO.

I've been working on creating a DarcsIO monad (which would just
be StateT SomeDarcsStuff IO, but it will probably take me a
long time before I can submit a patch on it.  Starting to spread
myself a bit thin here.

> I think this fix will do nicely. Unless anyone objects I'll
> apply it to darcs stable soon.

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.

Attachment: pgpE58b43Z3aj.pgp
Description: PGP signature

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

Reply via email to