[darcs-devel] [patch1870] WIP add module Darcs.Patch.Theory

Ben Franksen bugs at darcs.net
Fri Aug 16 08:48:41 UTC 2019


Ben Franksen <ben.franksen at online.de> added the comment:

> Would the darcs code or tests end up depending on this module?

I am not sure but I don't think so. My original plan was to gather all
the class properties there instead of them being scattered among all the
classes/modules. It would be perfect if in the documentation for the
classes we could refer to the Theory module but I guess this would
result in cyclic dependencies...

> If not, does it belong in the darcs codebase proper? Perhaps there's still
> value in the haddock appearing alongside the rest of darcs.

The generated docs are (currently) the only reason the module exists at
all. If you want to read it you should definitely look at that and not
the sources. (The reason I sent the patch is so you can apply, run cabal
(new-) haddock and read it! I wasn't planning to screen it any time soon.)

What I like about having it in haddock format inside the code base is
that we can reference code items. The kept the theory pretty close to
the actual source code; the only major deviation is the Apply class: I
treat ApplyState as tagged with a witness and regard apply as a pure
function (which is now also total, due to the witnesses). You can always
jump directly to the docs for the actual definitions; and I don't have
to repeat every detail, for instance most of the data types defined in
Darcs.Patch.Witnesses are only informally described in the theory.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1870>
__________________________________


More information about the darcs-devel mailing list