[darcs-devel] module Darcs.Patch

Ben Franksen ben.franksen at online.de
Wed Aug 28 09:49:41 UTC 2019


I would like to do something about Darcs.Patch.

(a) Either we delete it and always import everything explicitly.

(b) Or we extend it to cover everything from under Darcs.Patch that we
consider part of the external API and from the outside import only from
that module.

The problem with (a) is that we have to import from many different
modules, often just to get at one single item; we also cannot easily
re-organize things under Darcs.Patch without changing lots of modules
all over the place.

The problem with (b) is that in the importing modules we loose the
information about where the items we import are defined.

It looks to me as if we can't have the cake and eat it. So this comes
down to a trade-off.

If we decide on (b) we should re-write Darcs.Patch to replace explicit
exports of single items with module exports. If we want to exclude an
item because it is only meant for internal use inside of Darcs.Patch.*
we can do that by restricting the import. I would also export all the
classes with all associated methods and types instead of only the
methods (we need the class names often enough that this makes no sense).

If we decide on (a) we should perhaps be a bit more liberal with
re-exports. For instance, Darcs.Patch.RepoPatch could re-export all its
superclasses including their methods, so we could at least import things
like Commute(..), Invert(..), etc from a single module.



More information about the darcs-devel mailing list