[darcs-devel] [patch1844] automatically specialize merging and equality for sequences of patches with identity

Ben Franksen bugs at darcs.net
Sun Jun 30 19:49:46 UTC 2019


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

Here we go. Equality for patches fully cleaned up. Test suite adapted
accordingly. Unfortunatey still with the unrelated dependency.

10 patches for repository http://darcs.net/screened:

patch bf544a1f29a9874e1fd87a8b127c105ff1cbcad7
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sat Jun 29 15:33:45 CEST 2019
  * fix in D.P.Named.Wrapped
  
  Defining Eq2 with DeriveAnyClass means that a call to any of its methods
  will loop. It is better to throw an error in this case.

patch d0ceafb4f82172393861c70aac0bc8a76ecaa7c4
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sun Jun 30 10:58:01 CEST 2019
  * remove unneeded Eq2 instances from Darcs.Patch.Choices

patch 374bb15dd587e89dfb2842a884b227b1f664bdf1
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sun Jun 30 16:23:29 CEST 2019
  * define default methods class Eq more symmetrically

patch 6214e01928baab9123f03566f12d15e91d86c3f5
Author: Ben Franksen <ben.franksen at online.de>
Date:   Tue Feb 26 23:29:10 CET 2019
  * fix a bug in darcs1->darcs-2 conversion
  
  The test data for threewayanddep threewayandmultideps were quite obviously
  wrong! The darcs-2 Conflictors are complete bogus, referring to patches that
  don't appear in the repo. This is caused by erroneous calls to
  sortCoalesceFL in the RepoPatchV1 implementation in unravel and in effect.
  The way these functions are normally used (effect when we apply a patch and
  unravel to generate conflict markup) is quite tolerant wrt coalescing.
  However, unravel is also used to convert darcs-1 Mergers to darcs-2
  Conflictors, and here the result is catastrophic. Instead of sortCoalesceFL
  we must merely cancel inverses, just like we do in the darcs-2 and darcs-3
  theory when we construct contexted patches (aka Nons).

patch e49eac4940f25f09e46b34dbccc3a550bb71e7bb
Author: Ben Franksen <ben.franksen at online.de>
Date:   Fri Jun 28 20:25:32 CEST 2019
  * automatically specialize merging and equality for sequences of patches with identity
  
  The idea is to allow patch sequences to adapt their behavior depending on
  whether the patch type has an Ident instance or not. This is done for two
  reasons:
  (1) equality tests for, and removing elements from sequences of patches is
      much faster if we can use PatchIds;
  (2) merging sequences of patches with identity must first remove duplicate
      patches, otherwise these would be wrongly treated as conflicting.
  The new class Sequence abstracts over the basic operations we want to
  specialize for FL and RL: equality and removing elements. Similarly, class
  Merge gets a new method mergeFLs.
  By using the new DerivingVia extension we can derive the Sequence instances
  for patch types with an Ident instance from one template definition for a
  suitable newtype wrapper named HasIdent.
  The fastRemoveXXX functions are now gone from the Patch API and only used
  internally inside D.P.Ident, the ugly IdEq2 class could be fully removed.

patch cd24cd3cda462108ce3d96d302b6050dd626f4dc
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sun Jun 30 16:21:12 CEST 2019
  * fix documentation in D.P.W.Eq

patch 98401fdc043a962ab32113b9b729b23fbfd672ed
Author: Ben Franksen <ben.franksen at online.de>
Date:   Fri Jun 21 15:30:40 CEST 2019
  * harness: remove unused propFail
  
  While a comment said this is "handy for debugging arbitrary code" I could
  not find an any further explanation or an example. I guess it can be
  re-added easily if needed.

patch b5f82f0bd3b4a6c02d4f5ca39a86b1ee876da43a
Author: Ben Franksen <ben.franksen at online.de>
Date:   Fri Jun 21 21:47:26 CEST 2019
  * harness: move nontrivialX conditions to D.T.P.A.Generic and remove dead code

patch efaca89dba06b22e2394a9a263e22216f84ddc23
Author: Ben Franksen <ben.franksen at online.de>
Date:   Fri Jun 28 11:00:00 CEST 2019
  * remove unused eqFLRev

patch 20cb6a18c141a4fc0139e6fed81263c82915976a
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sun Jun 30 21:26:07 CEST 2019
  * clean up patch equality
  
  We make a clear distinction between semantic and structural equality. The
  former is captured by Eq2, the latter by the new class StructuralEq2. We use
  nominal equality as optimization for semantic equality where available.
  Structural equality is understood to be local; it should not refer to
  structural equality of its components but rather to their semantic equality.
  Thus the new definitions for StructuralEq2 are quite similar to those which
  previously defined Eq2. Some of the equality definitions have been cleaned
  up and streamlined, for instance the two basic prim patch types now use
  deriving Eq instead of manually written definitions.
  There remain no /uses/ of unsafeCompare throughout the code except in
  RepoPatchV1 and in the default method definitions for Eq2. It still appears
  in many places to define Eq2, though, since this is quite convenient.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1844>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 72816 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20190630/802eb52b/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-in-d_p_named_wrapped.dpatch
Type: application/x-darcs-patch
Size: 122032 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20190630/802eb52b/attachment-0003.bin>
-------------- next part --------------
.





More information about the darcs-devel mailing list