[darcs-devel] [patch1609] make type Repository abstract
Ben Franksen
bugs at darcs.net
Wed Oct 4 05:52:46 UTC 2017
Ben Franksen <ben.franksen at online.de> added the comment:
I should, perhaps, remark on why I did this.
One reason is that this way of using pattern matching for the arguments
of top-level functions is abusive, IMO. It expresses a preference to
give a name to /things/, whereas the major strength of functional
programming is to give names to (small, re-usable) /functions/.
And, of course, there are the usual reasons: we can now add or remove
data members from Repository without having to change all functions that
take it as argument.
Last not least: we used pattern matching for two completely separate
reasons: (1) to get at (some of) the members and (2) to reconstruct an
identical copy with a different type, i.e. with "new" witnesses. These
two motives are now expressed with separate functions, making the
intention clear.
----------
status: needs-screening -> needs-review
__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1609>
__________________________________
More information about the darcs-devel
mailing list