[darcs-devel] [patch1267] changed the argument order of PatchSet and backward op...

Ben Franksen bugs at darcs.net
Tue Feb 10 16:23:17 UTC 2015


New submission from Ben Franksen <benjamin.franksen at helmholtz-berlin.de>:

Obviously this is open for discussion. I am ready to defend this proposal
and explain how and why I think this is better by means of one or two
concrete examples. That is, if you actually need convincing...

A big hurray to the type indexing (witnesses). Without this I would never
have dared to make such a far-reaching change down in the core of Darcs. As
it was, I made the three basic changes explained in the comment and then
fixed all the resulting type errors. The first version that compiled also
ran all the tests without error.

1 patch for repository http://darcs.net/screened:

patch d55e1b7ccb59a93675bb5c475eb37ebd7b95b6a2
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Tue Feb 10 17:02:40 CET 2015
  * changed the argument order of PatchSet and backward operators
  
  This simple (if tedious) refactoring makes the constructor :<: of RL and the
  backward concatenation operator +<+ left-associative and flips their
  argument order. This means backward lists (RL) are constructed by adding
  elements to the right (xs :<: x). Concatenating backward lists (xs +<+ ys)
  means the xs are earlier than the ys, in symmetry with (xs +>+ ys). IMO this
  greatly improves the ease with which one can read and write patch
  commutation code, since the order of identifiers in patterns and expressions
  is now always the same: left = apply earlier to right = apply later, no
  matter from which end we add elements.
  
  The data type PatchSet was changed to match this: first come the tagged
  chunks, then the rest of the patches. Thus we now pattern match and
  construct PatchSets in the intuitive order e.g.  PatchSet tagged (ps :<: p)
  gives us the latest patch p.

----------
files: changed-the-argument-order-of-patchset-and-backward-operators.dpatch, patch-preview.txt, unnamed
messages: 18058
nosy: bf
status: needs-screening
title: changed the argument order of PatchSet and backward op...

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1267>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 42279 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150210/57fb342f/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changed-the-argument-order-of-patchset-and-backward-operators.dpatch
Type: application/x-darcs-patch
Size: 57181 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150210/57fb342f/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed
Type: application/octet-stream
Size: 5 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150210/57fb342f/attachment-0001.obj>


More information about the darcs-devel mailing list