[darcs-devel] [patch1660] Eliminate redundant constraints in Util, Repository and Patch

Guillaume Hoffmann bugs at darcs.net
Sat Mar 10 20:38:18 UTC 2018


Guillaume Hoffmann <guillaumh at gmail.com> added the comment:

My previous comment about Patchy made me look into what was this
typeclass for.

Patchy is simply a subclass of Apply, Invert and Commute. The idea
seemed to be to write smaller contexts. However, I found that in most
places, Patchy was used instead of just one or two of the aforementioned
classes.

Also, "Patchy" is not a very informative name, unlike for instance,
Matchable, another empty class. Nor is it very all-encompassing, unlike
RepoPatch which is a subclass of almost 20 classes.

Moreover, many modules import Darcs.Patch.Patchy in order to import
other class definitions, so API-wise this does not look great.

So I went ahead and removed the Patchy class, and found that many
functions now have amore understandable context.

After that, I compiled again Darcs with -fwarn-redundant-constraints,
and could further removed unneeded constraints all over the place.

I'm screening this followup bundle.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1660>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stop-using-patchy-in-the-test-harness.dpatch
Type: application/octet-stream
Size: 93599 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20180310/6290aade/attachment-0001.obj>


More information about the darcs-devel mailing list