[darcs-devel] darcs patch: Rename AtExit module to Global. (and 2 more)

Eric Y. Kow eric.kow at gmail.com
Sun Aug 20 11:58:13 PDT 2006


> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20060820/f42d97f5/attachment.pgp


More information about the darcs-devel mailing list