darcs

Patch 631 Fix up test group labels

Title Fix up test group labels
Superseder Nosy List mornfall
Related Issues
Status accepted Assigned To
Milestone

Created on 2011-06-21.17:46:44 by mornfall, last changed 2011-12-28.02:24:45 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
bootstrap-the-v3-prim-patches-as-a-clone-of-v1_.dpatch mornfall, 2011-08-14.09:06:21 application/octet-stream
fix-a-couple-of-ghc-7-deprecation-warnings_.dpatch dead mornfall, 2011-06-27.19:59:27 application/x-darcs-patch
fix-up-test-group-labels_.dpatch ganesh, 2011-08-14.10:49:01 application/x-darcs-patch
merge-set2_-set2unwitnessed-and-set3unwitnessed-in-test_patch_examples_.dpatch mornfall, 2011-06-21.17:46:42 application/x-darcs-patch
unnamed mornfall, 2011-06-21.17:46:42 text/x-darcs-patch
unnamed mornfall, 2011-06-21.17:46:42
unnamed iago, 2011-06-26.11:49:55 text/html
unnamed mornfall, 2011-06-27.19:59:27 text/x-darcs-patch
unnamed mornfall, 2011-06-27.19:59:27
unnamed iago, 2011-07-11.10:25:38 text/html
unnamed ganesh, 2011-08-14.10:49:01 text/x-darcs-patch
unnamed ganesh, 2011-08-14.10:49:01
See mailing list archives for discussion on individual patches.
Messages
msg14546 (view) Author: mornfall Date: 2011-06-21.17:46:42
More test suite reworking. It does use ImpredicativeTypes, but this should be
fairly harmless (I haven't tried with anything but GHC7 yet, though). I'd
expect more things could be conflated (some properties are still at least
duplicated, if not triplicated). There are quite a few properties that are
simply commented out and something should be done about those as well (probably
removing them or maybe fixing them).

I'll keep conflating commonalities together, although I think that reuse is now
quite good. It also shows that our property coverage is rather weak: even
though the original test lists were pretty long, they were more or less just
repeating themselves.

I'll still do some final cleanups, but other than that, I am done with the
test-suite for now, on the general level. I'll write arbitrary instances for V3
Prims next and then based on that, I'll start adding properties and fill in the
V3 implementation. I expect that the properties will be reusable in other
contexts, with the current testsuite structure.

Yours,
   Petr

13 patches for repository http://darcs.net:

Sun Jun  5 23:55:12 CEST 2011  Petr Rockai <me@mornfall.net>
  * Merge Set2, Set2Unwitnessed and Set3Unwitnessed in Test.Patch.Examples.
  
  Set2 have been only used to implement Set3, and not directly by any
  tests. Everything is internal to Set2Unwitnessed now.

Mon Jun 20 11:06:41 CEST 2011  Petr Rockai <me@mornfall.net>
  * Add a Show1 instance for (:>).

Mon Jun 20 11:06:58 CEST 2011  Petr Rockai <me@mornfall.net>
  * Make (V1) Prim an instance of PrimPatchBase/FromPrim.

Mon Jun 20 11:07:18 CEST 2011  Petr Rockai <me@mornfall.net>
  * Remove redundant imports in Darcs.Repository.Internal.

Mon Jun 20 11:18:10 CEST 2011  Petr Rockai <me@mornfall.net>
  * Reorganise the Patch tests further.

Mon Jun 20 14:30:27 CEST 2011  Petr Rockai <me@mornfall.net>
  * Generalise the V1.Prim Arbitrary instance based on Tree to any PrimPatch.

Mon Jun 20 14:33:54 CEST 2011  Petr Rockai <me@mornfall.net>
  * Generalise a bunch of merge/commute properties over the patch type & generator.

Mon Jun 20 15:36:51 CEST 2011  Petr Rockai <me@mornfall.net>
  * Split Test.Patch.Test into Properties.Check and Arbitrary.PatchV1.

Tue Jun 21 16:11:12 CEST 2011  Petr Rockai <me@mornfall.net>
  * Print detailed diagnostic in patchAndInverseCommute.

Tue Jun 21 16:12:34 CEST 2011  Petr Rockai <me@mornfall.net>
  * Slightly restructure and expand the Prim Arbitrary instances.

Tue Jun 21 16:13:11 CEST 2011  Petr Rockai <me@mornfall.net>
  * Further restructuring of QC properties of patches.

Tue Jun 21 16:22:50 CEST 2011  Petr Rockai <me@mornfall.net>
  * Replace tCommuteRecommute with recommute from Properties.Generic.

Tue Jun 21 16:23:03 CEST 2011  Petr Rockai <me@mornfall.net>
  * Replace tMergeSwapMerge with Properties.Generic mergeEitherWay.
Attachments
msg14554 (view) Author: kowey Date: 2011-06-26.08:54:42
Hi Iago,

As you may be aware, Petr is working on GSoC project towards V3 of Darcs
primitive patches [1].  He wants to do it in a TDD way (!), but writing
all the Arbitrary instances is quite boring and involves cleaning up a
lot of the pre-existing QC infrastructure.  Do you think you might have
time and/or be interested in commenting on his cleanup patch?

Thanks!

Eric

[1] http://web.mornfall.net/blog/soc_reloaded:_darcs_primitive_patches_version_3.html

On Tue, Jun 21, 2011 at 17:46:44 +0000, Petr Ročkai wrote:
> More test suite reworking. It does use ImpredicativeTypes, but this should be
> fairly harmless (I haven't tried with anything but GHC7 yet, though). I'd
> expect more things could be conflated (some properties are still at least
> duplicated, if not triplicated). There are quite a few properties that are
> simply commented out and something should be done about those as well (probably
> removing them or maybe fixing them).
> 
> I'll keep conflating commonalities together, although I think that reuse is now
> quite good. It also shows that our property coverage is rather weak: even
> though the original test lists were pretty long, they were more or less just
> repeating themselves.
> 
> I'll still do some final cleanups, but other than that, I am done with the
> test-suite for now, on the general level. I'll write arbitrary instances for V3
> Prims next and then based on that, I'll start adding properties and fill in the
> V3 implementation. I expect that the properties will be reusable in other
> contexts, with the current testsuite structure.
> 
> Yours,
>    Petr
> 
> 13 patches for repository http://darcs.net:
> 
> Sun Jun  5 23:55:12 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Merge Set2, Set2Unwitnessed and Set3Unwitnessed in Test.Patch.Examples.
>   
>   Set2 have been only used to implement Set3, and not directly by any
>   tests. Everything is internal to Set2Unwitnessed now.
> 
> Mon Jun 20 11:06:41 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Add a Show1 instance for (:>).
> 
> Mon Jun 20 11:06:58 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Make (V1) Prim an instance of PrimPatchBase/FromPrim.
> 
> Mon Jun 20 11:07:18 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Remove redundant imports in Darcs.Repository.Internal.
> 
> Mon Jun 20 11:18:10 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Reorganise the Patch tests further.
> 
> Mon Jun 20 14:30:27 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Generalise the V1.Prim Arbitrary instance based on Tree to any PrimPatch.
> 
> Mon Jun 20 14:33:54 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Generalise a bunch of merge/commute properties over the patch type & generator.
> 
> Mon Jun 20 15:36:51 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Split Test.Patch.Test into Properties.Check and Arbitrary.PatchV1.
> 
> Tue Jun 21 16:11:12 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Print detailed diagnostic in patchAndInverseCommute.
> 
> Tue Jun 21 16:12:34 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Slightly restructure and expand the Prim Arbitrary instances.
> 
> Tue Jun 21 16:13:11 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Further restructuring of QC properties of patches.
> 
> Tue Jun 21 16:22:50 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Replace tCommuteRecommute with recommute from Properties.Generic.
> 
> Tue Jun 21 16:23:03 CEST 2011  Petr Rockai <me@mornfall.net>
>   * Replace tMergeSwapMerge with Properties.Generic mergeEitherWay.
> 
> ----------
> files: merge-set2_-set2unwitnessed-and-set3unwitnessed-in-test_patch_examples_.dpatch, unnamed, unnamed
> messages: 14546
> nosy: mornfall
> status: needs-screening
> title: Merge Set2, Set2Unwitnessed and Set3Unwi... (and 12 more)
> 
> __________________________________
> Darcs bug tracker <bugs@darcs.net>
> <http://bugs.darcs.net/patch631>
> __________________________________

> 
> [Merge Set2, Set2Unwitnessed and Set3Unwitnessed in Test.Patch.Examples.
> Petr Rockai <me@mornfall.net>**20110605215512
>  Ignore-this: 8c718a43d7e780f582b91900dd7464c5
>  
>  Set2 have been only used to implement Set3, and not directly by any
>  tests. Everything is internal to Set2Unwitnessed now.
> ] hunk ./src/Darcs/Test/Patch/Examples/Set2.hs 1
> -{-# LANGUAGE CPP #-}
> -
> -#include "gadts.h"
> -
> -module Darcs.Test.Patch.Examples.Set2
> -    ( mergeExamples, commuteExamples, tripleExamples
> -    , realPatchLoopExamples
> -    )
> -    where
> -
> -import Darcs.Patch.Invert ( Invert )
> -import Darcs.Patch.Merge ( Merge )
> -import Darcs.Patch.Prim ( PrimPatchBase(..), FromPrim )
> -import Darcs.Patch.Prim.V1.Core ( Prim(FP), FilePatchType(Hunk) )
> -import Darcs.Patch.FileName ( FileName, fp2fn )
> -
> -import Darcs.Witnesses.Ordered ( (:>), (:\/:) )
> -import Darcs.Witnesses.Sealed ( Sealed(..), Sealed2, seal2, unseal2 )
> -
> -import qualified Data.ByteString as B ( ByteString )
> -import qualified Data.ByteString.Char8 as BC ( pack )
> -
> -import Darcs.Test.Patch.RepoModel ( RepoModel, Content
> -                                   , makeRepo, makeName, makeFile)
> -import Darcs.Test.Patch.WithState ( WithStartState(..) )
> -
> -import Darcs.Test.Patch.Arbitrary.Generic
> -    ( Tree(..)
> -    , TreeWithFlattenPos(..)
> -    , commutePairFromTree, commuteTripleFromTree
> -    , mergePairFromCommutePair, commutePairFromTWFP
> -    , canonizeTree
> -    )
> -import Darcs.Test.Patch.Arbitrary.PrimV1 () -- instances
> -
> -
> -
> -makeSimpleRepo :: String -> Content -> RepoModel C(x)
> -makeSimpleRepo filename content = makeRepo [(makeName filename, makeFile content)]
> -
> -
> -tripleExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p :> p :> p)]
> -tripleExamples = [commuteTripleFromTree seal2 $
> -                   WithStartState (makeSimpleRepo "file" [])
> -                   (ParTree
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "g"]))
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack "j"]))
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "s"])) NilTree)))
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "e"])) NilTree))
> -                  ,commuteTripleFromTree seal2 $
> -                   WithStartState (makeSimpleRepo "file" [BC.pack "j"])
> -                   (ParTree
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "s"]))
> -                     (ParTree
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "j"] [])) NilTree)
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "j"] [])) NilTree)))
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"] [])) NilTree))
> -                  ]
> -
> -
> -mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p :\/: p)]
> -mergeExamples = map (unseal2 (mergePairFromCommutePair seal2)) commuteExamples
> -
> -commuteExamples :: (FromPrim p, Merge p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p :> p)]
> -commuteExamples = [
> -                   commutePairFromTWFP seal2 $
> -                   WithStartState (makeSimpleRepo "file" [])
> -                   (TWFP 3
> -                    (ParTree
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"])) NilTree)
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "b"]))
> -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"]))
> -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"]))
> -                           (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "f"] [])) NilTree)))))),
> -                   commutePairFromTWFP seal2 $
> -                   WithStartState
> -                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "s",BC.pack "d"])
> -                   (TWFP 3
> -                    (ParTree
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "d"] [])) NilTree)
> -                     (ParTree
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f"] [])) NilTree)
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f"] []))
> -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "s",BC.pack "d"] []))
> -                          (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree)))))),
> -{-                   commutePairFromTWFP seal2 $
> -                   WithStartState
> -                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "u",
> -                                            BC.pack "s",BC.pack "d"])
> -                   (TWFP 5
> -                    (ParTree
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 5 [] [BC.pack "x"]))
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "d"] [])) NilTree))
> -                     (ParTree
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f",BC.pack "u"] [])) NilTree)
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f"] []))
> -                       (SeqTree (FP(fp2fn "./file") (Hunk 1 [BC.pack "u",BC.pack "s",BC.pack "d"] []))
> -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "a"]))
> -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "a"] [])) NilTree))))))),-}
> -                   commutePairFromTree seal2 $
> -                   WithStartState (makeSimpleRepo "file" [BC.pack "n",BC.pack "t",BC.pack "h"])
> -                   (ParTree
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n",BC.pack "t",BC.pack "h"] []))
> -                     NilTree)
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "h"] []))
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n"] []))
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"] [])) NilTree)))),
> -                  commutePairFromTree seal2 $
> -                  WithStartState (makeSimpleRepo "file" [])
> -                  (ParTree
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "n"])) NilTree)
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "i"]))
> -                                (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "i"])) NilTree))),
> -                  commutePairFromTree seal2 $
> -                  WithStartState (makeSimpleRepo "file" [])
> -                  (ParTree
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "c"]))
> -                     (ParTree
> -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "c"] [BC.pack "r"])) NilTree)
> -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"]))
> -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "d"])) NilTree))))
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"])) NilTree)),
> -                  commutePairFromTWFP seal2 $
> -                  WithStartState (makeSimpleRepo "file" [])
> -                  (TWFP 1
> -                  (ParTree
> -                   (ParTree
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "t"])) NilTree)
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "t"])) NilTree))
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"])) NilTree))),
> -                   commutePairFromTWFP seal2 $
> -                   WithStartState (makeSimpleRepo "file" [BC.pack "f",BC.pack " r",
> -                                                            BC.pack "c",BC.pack "v"])
> -                   (TWFP 4
> -                    (ParTree
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c",BC.pack "v"] []))
> -                        (ParTree
> -                         (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "r"] []))
> -                          (SeqTree (FP (fp2fn "fi le") (Hunk 1 [BC.pack "f"] [])) NilTree))
> -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f",BC.pack "r"] []))
> -                          (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "y"])) NilTree))))
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "v"] [])) NilTree))),
> -                   commutePairFromTree seal2 $
> -                   WithStartState (makeSimpleRepo "file" [])
> -                   (ParTree
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "z"])) NilTree)
> -                    (ParTree
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"])) NilTree)
> -                     (ParTree
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "r"])) NilTree)
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "d"])) NilTree))))
> -                 , commutePairFromTree seal2 $
> -                   WithStartState (makeSimpleRepo "file" [BC.pack "t",BC.pack "r",BC.pack "h"])
> -                   (ParTree
> -                    (ParTree
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t",BC.pack "r",BC.pack "h"] []))
> -                              NilTree)
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "o"])) NilTree))
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"] []))
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "h"] [])) NilTree)))
> -                 , commutePairFromTWFP seal2 $
> -                   WithStartState (makeSimpleRepo "file" []) $
> -                   TWFP 2
> -                   (ParTree
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"])) NilTree)
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "y"]))
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack "m"]))
> -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree))))
> -                 , commutePairFromTree seal2 $
> -                 WithStartState (makeSimpleRepo "file" [])
> -                 (ParTree
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "p"]))
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "p"] []))
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "c"])) NilTree)))
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "z"])) NilTree))
> -                 , commutePairFromTree seal2 $
> -                 WithStartState (makeSimpleRepo "file" [])
> -                 (ParTree
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j" ]))
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"] [])) NilTree))
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree))
> -                 , commutePairFromTree seal2 $
> -                 WithStartState (makeSimpleRepo "file" [])
> -                 (ParTree
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree)
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j" ]))
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"] [])) NilTree)))
> -                 , commutePairFromTree seal2 $
> -                 WithStartState (makeSimpleRepo "file" [BC.pack "x",BC.pack "c"])
> -                 (ParTree
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"]))
> -                   (ParTree
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c"] [])) NilTree)
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "x"] []))
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"])) NilTree))))
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "l"])) NilTree))
> -                 , commutePairFromTree seal2 $
> -                 WithStartState (makeSimpleRepo "file" [])
> -                 (ParTree
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] (packStringLetters "s"))) NilTree)
> -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] (packStringLetters "k")))
> -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 (packStringLetters "k") []))
> -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] (packStringLetters "m")))
> -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 (packStringLetters "m") [])) NilTree)))))
> -                 ]
> -
> -packStringLetters :: String -> [B.ByteString]
> -packStringLetters = map (BC.pack . (:[]))
> -
> -realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> -realPatchLoopExamples =
> -    [Sealed (WithStartState (makeSimpleRepo fx_name [])
> -     $ canonizeTree
> -     (ParTree
> -      (SeqTree (FP fx (Hunk 1 [] (packStringLetters "pkotufogbvdabnmbzajvolwviqebieonxvcvuvigkfgybmqhzuaaurjspd")))
> -       (ParTree
> -        (SeqTree (FP fx (Hunk 47 (packStringLetters "qhzu") (packStringLetters "zafybdcokyjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmh")))
> -         (ParTree
> -          (ParTree
> -           NilTree
> -           (ParTree
> -            (ParTree
> -             (ParTree
> -              (SeqTree (FP fx (Hunk 15 (packStringLetters "mbzajvolwviqebieonxvcvuvigkfgyb") (packStringLetters "vujnxnhvybvpouyciaabszfmgssezlwwjgnethvrpnfrkubphzvdgymjjoacppqps")))
> -               (ParTree
> -                NilTree
> -                (ParTree
> -                 (SeqTree (FP fx (Hunk 40 (packStringLetters "ssezlwwjgnethvrpnfrkubphzvdgymjjoacppqpsmzafybdcokyjskcgnvhkbz") (packStringLetters "wnesidpccwoiqiichxaaejdsyrhrusqljlcoro")))
> -                  (ParTree
> -                   (ParTree
> -                    (SeqTree (FP fx (Hunk 12 (packStringLetters "abnvujnxnhvybvpouyciaabszfmgwnesidpccwoiqii") (packStringLetters "czfdhqkipdstfjycqaxwnbxrihrufdeyneqiiiafwzlmg"))) NilTree)
> -                    NilTree)
> -                   NilTree))
> -                 (SeqTree (FP fx (Hunk 25 [] (packStringLetters "dihgmsotezucqdgxczvcivijootyvhlwymbiueufnvpwpeukmskqllalfe"))) NilTree))))
> -              (SeqTree (FP fx (Hunk 56 (packStringLetters "yjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmhaaurjsp") (packStringLetters "xldhrutyhcyaqeezwujiguawfyawjjqlirxshjddvq"))) NilTree))
> -             (SeqTree (FP fx (Hunk 20 [] (packStringLetters "ooygwiyogqrqnytixqtmvdxx")))
> -              (SeqTree (FP fx (Hunk 26 (packStringLetters "yogqrqnytixqtmvdxxvolwviqebieonxvcvuvigkfgybmzafybdcokyjskcgnvhkbz") (packStringLetters "akhsmlbkdxnvfoikmiatfbpzdrsyykkpoxvvddeaspzxe")))
> -               (SeqTree (FP fx (Hunk 39 [] (packStringLetters "ji")))
> -                (ParTree
> -                 NilTree
> -                 (ParTree
> -                  NilTree
> -                  (ParTree
> -                   (ParTree
> -                    NilTree
> -                    (SeqTree (FP fx (Hunk 26 (packStringLetters "akhsmlbkdxnvfjioikmiatfbpzdrsyykkpoxvvddeaspzxepysaafnjjhcstgrczplxs") (packStringLetters "onjbhddskcj")))
> -                     (SeqTree (FP fx (Hunk 39 [] (packStringLetters "fyscunxxxjjtyqpfxeznhtwvlphmp"))) NilTree)))
> -                   (ParTree
> -                    NilTree
> -                    (SeqTree (FP fx (Hunk 44 [] (packStringLetters "xcchzwmzoezxkmkhcmesplnjpqriypshgiqklgdnbmmkldnydiy")))
> -                     (ParTree
> -                      NilTree
> -                      (SeqTree (FP fx (Hunk 64 (packStringLetters "plnjpqriypshgiqklgdnbmmkldnydiymiatfbpzdrsyykkpoxvvddeaspzxepysaafn") (packStringLetters "anjlzfdqbjqbcplvqvkhwjtkigp"))) NilTree)))))))))))
> -            (ParTree
> -             NilTree
> -             NilTree)))
> -          NilTree))
> -        NilTree))
> -      (ParTree
> -       NilTree
> -       (SeqTree (FP fx (Hunk 1 [] (packStringLetters "ti")))
> -        (SeqTree (FP fx (Hunk 1 (packStringLetters "t") (packStringLetters "ybcop")))
> -         (SeqTree (FP fx (Hunk 2 [] (packStringLetters "dvlhgwqlpaeweerqrhnjtfolczbqbzoccnvdsyqiefqitrqneralf")))
> -          (SeqTree (FP fx (Hunk 15 [] (packStringLetters "yairbjphwtnaerccdlfewujvjvmjakbc")))
> -           (SeqTree (FP fx (Hunk 51 [] (packStringLetters "xayvfuwaiiogginufnhsrmktpmlbvxiakjwllddkiyofyfw")))
> -            (ParTree
> -             NilTree
> -             NilTree)))))))))]
> -  where
> -      fx_name :: String
> -      fx_name = "F"
> -
> -      fx :: FileName
> -      fx = fp2fn "./F"
> -  
> rmfile ./src/Darcs/Test/Patch/Examples/Set2.hs
> hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 1
> -module Darcs.Test.Patch.Examples.Set2Unwitnessed where
> -
> -import qualified Darcs.Test.Patch.Examples.Set2 as W
> -     ( mergeExamples, commuteExamples, tripleExamples
> -     , realPatchLoopExamples
> -     )
> -import Darcs.Test.Patch.RepoModel ( RepoModel )
> -import Darcs.Test.Patch.WithState ( WithStartState )
> -import Darcs.Test.Patch.WSub
> -import Darcs.Test.Patch.Arbitrary.Generic ( Tree )
> -
> -import Darcs.Witnesses.Sealed
> -
> -import Darcs.Patch.Prim.V1 ( Prim )
> -import Darcs.Patch.V2 ( RealPatch )
> -
> -mergeExamples :: [Sealed2 (RealPatch Prim :\/: RealPatch Prim)]
> -mergeExamples = map (mapSeal2 fromW) W.mergeExamples
> -
> -realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> -realPatchLoopExamples = W.realPatchLoopExamples
> -
> -commuteExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim)]
> -commuteExamples = map (mapSeal2 fromW) W.commuteExamples
> -
> -tripleExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim :> RealPatch Prim)]
> -tripleExamples = map (mapSeal2 fromW) W.tripleExamples
> -
> rmfile ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs
> move ./src/Darcs/Test/Patch/Examples/Set3Unwitnessed.hs ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs
> hunk ./darcs.cabal 606
>      other-modules:    Darcs.Test.Email
>                        Darcs.Test.Patch.Check
>                        Darcs.Test.Patch.Examples.Set1
> -                      Darcs.Test.Patch.Examples.Set2
>                        Darcs.Test.Patch.Examples.Set2Unwitnessed
> hunk ./darcs.cabal 607
> -                      Darcs.Test.Patch.Examples.Set3Unwitnessed
>                        Darcs.Test.Patch.WSub
>                        Darcs.Test.Patch.Info
>                        Darcs.Test.Patch.Properties.V1Set1
> hunk ./src/Darcs/Test/Patch.hs 46
>  import qualified Darcs.Test.Patch.Info
>  
>  import qualified Darcs.Test.Patch.Examples.Set1 as Ex
> +import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
> +
>  import qualified Darcs.Test.Patch.Properties.V1Set1 as Prop
>  import qualified Darcs.Test.Patch.Properties.V1Set2 as Prop
>  import qualified Darcs.Test.Patch.Properties.Generic as Prop
> hunk ./src/Darcs/Test/Patch.hs 52
>  import qualified Darcs.Test.Patch.Properties.Real as Prop
> -
> -import qualified Darcs.Test.Patch.WSub as WSub
> -import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
> -import qualified Darcs.Test.Patch.Examples.Set3Unwitnessed as ExU
>  import qualified Darcs.Test.Patch.Properties.GenericUnwitnessed as PropU
>  
> hunk ./src/Darcs/Test/Patch.hs 54
> +import qualified Darcs.Test.Patch.WSub as WSub
>  import Darcs.Test.Patch.Arbitrary.PrimV1
>  
>  #include "gadts.h"
> hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 23
>  
>  #include "gadts.h"
>  
> -module Darcs.Test.Patch.Examples.Set3Unwitnessed
> +module Darcs.Test.Patch.Examples.Set2Unwitnessed
>         ( primPermutables, primPatches
>         , commutables, commutablesFL
> hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 26
> -       , realCommutables , realMergeables, realTriples, realNonduplicateTriples, realPatches
> +       , realCommutables , realMergeables, realTriples
> +       , realNonduplicateTriples, realPatches, realPatchLoopExamples
>         ) where
>  
>  import Data.Maybe ( catMaybes )
> hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 40
>  import Darcs.Patch.V2 ( RealPatch )
>  import Darcs.Patch.V2.Real ( prim2real )
>  -- import Darcs.Test.Patch.Test () -- for instance Eq Patch
> -import Darcs.Test.Patch.Examples.Set2Unwitnessed
> +-- import Darcs.Test.Patch.Examples.Set2Unwitnessed
>  import Darcs.Witnesses.Unsafe ( unsafeCoerceP )
>  import qualified Darcs.Test.Patch.Arbitrary.Real as W ( notDuplicatestriple )
>  --import Printer ( greenText )
> hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 49
>  import Darcs.ColorPrinter () -- for instance Show Doc
>  import Darcs.Test.Patch.WSub
>  
> +import qualified Darcs.Witnesses.Ordered as W ( (:>), (:\/:) )
> +import qualified Data.ByteString as B ( ByteString )
> +import Darcs.Test.Patch.RepoModel ( RepoModel, Content
> +                                   , makeRepo, makeName, makeFile)
> +import Darcs.Test.Patch.WithState ( WithStartState(..) )
> +import Darcs.Patch.Prim.V1.Core ( Prim(FP), FilePatchType(Hunk) )
> +import Darcs.Patch.FileName ( FileName, fp2fn )
> +import Darcs.Patch.Prim ( PrimPatchBase(..), FromPrim )
> +import Darcs.Patch.Merge ( Merge )
> +import Darcs.Test.Patch.Arbitrary.Generic
> +    ( Tree(..)
> +    , TreeWithFlattenPos(..)
> +    , commutePairFromTree, commuteTripleFromTree
> +    , mergePairFromCommutePair, commutePairFromTWFP
> +    , canonizeTree
> +    )
> +
>  -- import Debug.Trace
>  -- #include "impossible.h"
>  
> hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 69
> +makeSimpleRepo :: String -> Content -> RepoModel C(x)
> +makeSimpleRepo filename content = makeRepo [(makeName filename, makeFile content)]
> +
> +
> +w_tripleExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p W.:> p W.:> p)]
> +w_tripleExamples = [commuteTripleFromTree seal2 $
> +                   WithStartState (makeSimpleRepo "file" [])
> +                   (ParTree
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "g"]))
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack "j"]))
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "s"])) NilTree)))
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "e"])) NilTree))
> +                  ,commuteTripleFromTree seal2 $
> +                   WithStartState (makeSimpleRepo "file" [BC.pack "j"])
> +                   (ParTree
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "s"]))
> +                     (ParTree
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "j"] [])) NilTree)
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "j"] [])) NilTree)))
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"] [])) NilTree))
> +                  ]
> +
> +
> +w_mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p W.:\/: p)]
> +w_mergeExamples = map (unseal2 (mergePairFromCommutePair seal2)) w_commuteExamples
> +
> +w_commuteExamples :: (FromPrim p, Merge p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p W.:> p)]
> +w_commuteExamples = [
> +                   commutePairFromTWFP seal2 $
> +                   WithStartState (makeSimpleRepo "file" [])
> +                   (TWFP 3
> +                    (ParTree
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"])) NilTree)
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "b"]))
> +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"]))
> +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"]))
> +                           (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "f"] [])) NilTree)))))),
> +                   commutePairFromTWFP seal2 $
> +                   WithStartState
> +                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "s",BC.pack "d"])
> +                   (TWFP 3
> +                    (ParTree
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "d"] [])) NilTree)
> +                     (ParTree
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f"] [])) NilTree)
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f"] []))
> +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "s",BC.pack "d"] []))
> +                          (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree)))))),
> +{-                   commutePairFromTWFP seal2 $
> +                   WithStartState
> +                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "u",
> +                                            BC.pack "s",BC.pack "d"])
> +                   (TWFP 5
> +                    (ParTree
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 5 [] [BC.pack "x"]))
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "d"] [])) NilTree))
> +                     (ParTree
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f",BC.pack "u"] [])) NilTree)
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f"] []))
> +                       (SeqTree (FP(fp2fn "./file") (Hunk 1 [BC.pack "u",BC.pack "s",BC.pack "d"] []))
> +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "a"]))
> +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "a"] [])) NilTree))))))),-}
> +                   commutePairFromTree seal2 $
> +                   WithStartState (makeSimpleRepo "file" [BC.pack "n",BC.pack "t",BC.pack "h"])
> +                   (ParTree
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n",BC.pack "t",BC.pack "h"] []))
> +                     NilTree)
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "h"] []))
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n"] []))
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"] [])) NilTree)))),
> +                  commutePairFromTree seal2 $
> +                  WithStartState (makeSimpleRepo "file" [])
> +                  (ParTree
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "n"])) NilTree)
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "i"]))
> +                                (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "i"])) NilTree))),
> +                  commutePairFromTree seal2 $
> +                  WithStartState (makeSimpleRepo "file" [])
> +                  (ParTree
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "c"]))
> +                     (ParTree
> +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "c"] [BC.pack "r"])) NilTree)
> +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"]))
> +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "d"])) NilTree))))
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"])) NilTree)),
> +                  commutePairFromTWFP seal2 $
> +                  WithStartState (makeSimpleRepo "file" [])
> +                  (TWFP 1
> +                  (ParTree
> +                   (ParTree
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "t"])) NilTree)
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "t"])) NilTree))
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"])) NilTree))),
> +                   commutePairFromTWFP seal2 $
> +                   WithStartState (makeSimpleRepo "file" [BC.pack "f",BC.pack " r",
> +                                                            BC.pack "c",BC.pack "v"])
> +                   (TWFP 4
> +                    (ParTree
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c",BC.pack "v"] []))
> +                        (ParTree
> +                         (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "r"] []))
> +                          (SeqTree (FP (fp2fn "fi le") (Hunk 1 [BC.pack "f"] [])) NilTree))
> +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "f",BC.pack "r"] []))
> +                          (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "y"])) NilTree))))
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "v"] [])) NilTree))),
> +                   commutePairFromTree seal2 $
> +                   WithStartState (makeSimpleRepo "file" [])
> +                   (ParTree
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "z"])) NilTree)
> +                    (ParTree
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "f"])) NilTree)
> +                     (ParTree
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "r"])) NilTree)
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "d"])) NilTree))))
> +                 , commutePairFromTree seal2 $
> +                   WithStartState (makeSimpleRepo "file" [BC.pack "t",BC.pack "r",BC.pack "h"])
> +                   (ParTree
> +                    (ParTree
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t",BC.pack "r",BC.pack "h"] []))
> +                              NilTree)
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "o"])) NilTree))
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"] []))
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "h"] [])) NilTree)))
> +                 , commutePairFromTWFP seal2 $
> +                   WithStartState (makeSimpleRepo "file" []) $
> +                   TWFP 2
> +                   (ParTree
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"])) NilTree)
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "y"]))
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack "m"]))
> +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree))))
> +                 , commutePairFromTree seal2 $
> +                 WithStartState (makeSimpleRepo "file" [])
> +                 (ParTree
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "p"]))
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "p"] []))
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "c"])) NilTree)))
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "z"])) NilTree))
> +                 , commutePairFromTree seal2 $
> +                 WithStartState (makeSimpleRepo "file" [])
> +                 (ParTree
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j" ]))
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"] [])) NilTree))
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree))
> +                 , commutePairFromTree seal2 $
> +                 WithStartState (makeSimpleRepo "file" [])
> +                 (ParTree
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "v"])) NilTree)
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j" ]))
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"] [])) NilTree)))
> +                 , commutePairFromTree seal2 $
> +                 WithStartState (makeSimpleRepo "file" [BC.pack "x",BC.pack "c"])
> +                 (ParTree
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "h"]))
> +                   (ParTree
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c"] [])) NilTree)
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "x"] []))
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"])) NilTree))))
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "l"])) NilTree))
> +                 , commutePairFromTree seal2 $
> +                 WithStartState (makeSimpleRepo "file" [])
> +                 (ParTree
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] (packStringLetters "s"))) NilTree)
> +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] (packStringLetters "k")))
> +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 (packStringLetters "k") []))
> +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] (packStringLetters "m")))
> +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 (packStringLetters "m") [])) NilTree)))))
> +                 ]
> +
> +packStringLetters :: String -> [B.ByteString]
> +packStringLetters = map (BC.pack . (:[]))
> +
> +w_realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> +w_realPatchLoopExamples =
> +    [Sealed (WithStartState (makeSimpleRepo fx_name [])
> +     $ canonizeTree
> +     (ParTree
> +      (SeqTree (FP fx (Hunk 1 [] (packStringLetters "pkotufogbvdabnmbzajvolwviqebieonxvcvuvigkfgybmqhzuaaurjspd")))
> +       (ParTree
> +        (SeqTree (FP fx (Hunk 47 (packStringLetters "qhzu") (packStringLetters "zafybdcokyjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmh")))
> +         (ParTree
> +          (ParTree
> +           NilTree
> +           (ParTree
> +            (ParTree
> +             (ParTree
> +              (SeqTree (FP fx (Hunk 15 (packStringLetters "mbzajvolwviqebieonxvcvuvigkfgyb") (packStringLetters "vujnxnhvybvpouyciaabszfmgssezlwwjgnethvrpnfrkubphzvdgymjjoacppqps")))
> +               (ParTree
> +                NilTree
> +                (ParTree
> +                 (SeqTree (FP fx (Hunk 40 (packStringLetters "ssezlwwjgnethvrpnfrkubphzvdgymjjoacppqpsmzafybdcokyjskcgnvhkbz") (packStringLetters "wnesidpccwoiqiichxaaejdsyrhrusqljlcoro")))
> +                  (ParTree
> +                   (ParTree
> +                    (SeqTree (FP fx (Hunk 12 (packStringLetters "abnvujnxnhvybvpouyciaabszfmgwnesidpccwoiqii") (packStringLetters "czfdhqkipdstfjycqaxwnbxrihrufdeyneqiiiafwzlmg"))) NilTree)
> +                    NilTree)
> +                   NilTree))
> +                 (SeqTree (FP fx (Hunk 25 [] (packStringLetters "dihgmsotezucqdgxczvcivijootyvhlwymbiueufnvpwpeukmskqllalfe"))) NilTree))))
> +              (SeqTree (FP fx (Hunk 56 (packStringLetters "yjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmhaaurjsp") (packStringLetters "xldhrutyhcyaqeezwujiguawfyawjjqlirxshjddvq"))) NilTree))
> +             (SeqTree (FP fx (Hunk 20 [] (packStringLetters "ooygwiyogqrqnytixqtmvdxx")))
> +              (SeqTree (FP fx (Hunk 26 (packStringLetters "yogqrqnytixqtmvdxxvolwviqebieonxvcvuvigkfgybmzafybdcokyjskcgnvhkbz") (packStringLetters "akhsmlbkdxnvfoikmiatfbpzdrsyykkpoxvvddeaspzxe")))
> +               (SeqTree (FP fx (Hunk 39 [] (packStringLetters "ji")))
> +                (ParTree
> +                 NilTree
> +                 (ParTree
> +                  NilTree
> +                  (ParTree
> +                   (ParTree
> +                    NilTree
> +                    (SeqTree (FP fx (Hunk 26 (packStringLetters "akhsmlbkdxnvfjioikmiatfbpzdrsyykkpoxvvddeaspzxepysaafnjjhcstgrczplxs") (packStringLetters "onjbhddskcj")))
> +                     (SeqTree (FP fx (Hunk 39 [] (packStringLetters "fyscunxxxjjtyqpfxeznhtwvlphmp"))) NilTree)))
> +                   (ParTree
> +                    NilTree
> +                    (SeqTree (FP fx (Hunk 44 [] (packStringLetters "xcchzwmzoezxkmkhcmesplnjpqriypshgiqklgdnbmmkldnydiy")))
> +                     (ParTree
> +                      NilTree
> +                      (SeqTree (FP fx (Hunk 64 (packStringLetters "plnjpqriypshgiqklgdnbmmkldnydiymiatfbpzdrsyykkpoxvvddeaspzxepysaafn") (packStringLetters "anjlzfdqbjqbcplvqvkhwjtkigp"))) NilTree)))))))))))
> +            (ParTree
> +             NilTree
> +             NilTree)))
> +          NilTree))
> +        NilTree))
> +      (ParTree
> +       NilTree
> +       (SeqTree (FP fx (Hunk 1 [] (packStringLetters "ti")))
> +        (SeqTree (FP fx (Hunk 1 (packStringLetters "t") (packStringLetters "ybcop")))
> +         (SeqTree (FP fx (Hunk 2 [] (packStringLetters "dvlhgwqlpaeweerqrhnjtfolczbqbzoccnvdsyqiefqitrqneralf")))
> +          (SeqTree (FP fx (Hunk 15 [] (packStringLetters "yairbjphwtnaerccdlfewujvjvmjakbc")))
> +           (SeqTree (FP fx (Hunk 51 [] (packStringLetters "xayvfuwaiiogginufnhsrmktpmlbvxiakjwllddkiyofyfw")))
> +            (ParTree
> +             NilTree
> +             NilTree)))))))))]
> +  where
> +      fx_name :: String
> +      fx_name = "F"
> +
> +      fx :: FileName
> +      fx = fp2fn "./F"
> +
> +
> +mergeExamples :: [Sealed2 (RealPatch Prim :\/: RealPatch Prim)]
> +mergeExamples = map (mapSeal2 fromW) w_mergeExamples
> +
> +realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> +realPatchLoopExamples = w_realPatchLoopExamples
> +
> +commuteExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim)]
> +commuteExamples = map (mapSeal2 fromW) w_commuteExamples
> +
> +tripleExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim :> RealPatch Prim)]
> +tripleExamples = map (mapSeal2 fromW) w_tripleExamples
> +
>  notDuplicatestriple :: (RealPatch Prim :> RealPatch Prim :> RealPatch Prim) C(x y) -> Bool
>  notDuplicatestriple = W.notDuplicatestriple . toW
>  
> hunk ./src/Darcs/Test/Patch/WSub.hs 5
>  module Darcs.Test.Patch.WSub where
>  
>  {-
> -The Examples.Set3 module builds a lot of test cases by pattern matching
> +The Examples.Set2Unwitnessed module builds a lot of test cases by pattern matching
>  on the results of merge/commute in where clauses. This would
>  be very painful to switch to using witnesses properly, because
>  we'd have to make them use case in series.
> [Add a Show1 instance for (:>).
> Petr Rockai <me@mornfall.net>**20110620090641
>  Ignore-this: f601c659c5a078eb1a337ff74e47d0dd
> ] hunk ./src/Darcs/Witnesses/Ordered.hs 110
>  instance Show2 a => Show2 (RL a) where
>     showDict2 = ShowDictClass
>  
> +instance (Show2 a, Show2 b) => Show1 ((a :> b) C(x)) where
> +   showDict1 = ShowDictClass
> +
>  -- reverse list
>  data RL a C(x z) where
>      (:<:) :: a C(y z) -> RL a C(x y) -> RL a C(x z)
> [Make (V1) Prim an instance of PrimPatchBase/FromPrim.
> Petr Rockai <me@mornfall.net>**20110620090658
>  Ignore-this: 2534da30774aac84a09342c3fbcda80e
> ] hunk ./src/Darcs/Patch/Prim/V1.hs 12
>  import Darcs.Patch.Prim.V1.Read ()
>  import Darcs.Patch.Prim.V1.Show ()
>  
> -import Darcs.Patch.Prim.Class ( PrimPatch )
> +import Darcs.Patch.Prim.Class ( PrimPatch, PrimPatchBase(..), FromPrim(..) )
>  import Darcs.Patch.Patchy ( Patchy )
>  
>  instance PrimPatch Prim
> hunk ./src/Darcs/Patch/Prim/V1.hs 17
>  instance Patchy Prim
> +instance PrimPatchBase Prim where
> +  type PrimOf Prim = Prim
> +
> +instance FromPrim Prim where
> +  fromPrim = id
> [Remove redundant imports in Darcs.Repository.Internal.
> Petr Rockai <me@mornfall.net>**20110620090718
>  Ignore-this: 85333a422e8c83d6b8080dfde97aee1
> ] hunk ./src/Darcs/Patch/Prim/V1/Details.hs 11
>  import Darcs.Patch.Prim.V1.Core
>      ( Prim(..), FilePatchType(..), DirPatchType(..) )
>  import Darcs.Patch.SummaryData ( SummDetail(..), SummOp(..) )
> -import Darcs.Patch.TokenReplace ( tryTokInternal )
> -import Darcs.Patch.FileName ( fn2fp, fp2fn, movedirfilename, fn2ps )
> -
> -import qualified Data.ByteString as B ( ByteString, concat )
> -import qualified Data.ByteString.Char8 as BC ( pack, split )
> -import Data.Maybe ( catMaybes )
>  
>  #include "gadts.h"
>  
> hunk ./src/Darcs/Repository/Internal.hs 71
>                                   writeProblem, readProblem, readfromAndWritetoProblem )
>  import System.Directory ( doesDirectoryExist, setCurrentDirectory,
>                            createDirectoryIfMissing, doesFileExist )
> -import Control.Monad ( liftM, when, unless, filterM )
> +import Control.Monad ( when, unless, filterM )
>  import Control.Applicative ( (<$>) )
>  import Workaround ( getCurrentDirectory, renameFile, setExecutable )
>  
> hunk ./src/Darcs/Repository/Internal.hs 90
>  import Darcs.Patch.Inspect ( PatchInspect )
>  import Darcs.Patch.Prim ( PrimPatchBase, PrimOf, tryShrinkingInverse, PrimPatch )
>  import Darcs.Patch.Bundle ( scanBundle, makeBundleN )
> -import Darcs.Patch.PatchInfoAnd ( PatchInfoAnd, info,
> -                         hopefully, hopefullyM )
> +import Darcs.Patch.PatchInfoAnd ( PatchInfoAnd, hopefully )
>  import qualified Darcs.Repository.HashedRepo as HashedRepo
>                              ( revertTentativeChanges, finalizeTentativeChanges,
>                                removeFromTentativeInventory,
> hunk ./src/Darcs/Repository/Internal.hs 110
>  import Darcs.Witnesses.Unsafe ( unsafeCoerceP, unsafeCoercePStart )
>  import Darcs.Witnesses.Ordered ( FL(..), RL(..),
>                               (:\/:)(..), (:/\:)(..), (:>)(..),
> -                             (+>+), lengthFL, dropWhileFL,
> +                             (+>+), lengthFL,
>                               allFL, filterFLFL,
>                               reverseFL, mapFL_FL, concatFL )
>  import Darcs.Patch ( RepoPatch, Patchy, merge,
> hunk ./src/Darcs/Repository/Internal.hs 115
>                       listConflictedFiles, listTouchedFiles,
> -                     Named, patchcontents,
> +                     Named,
>                       commuteRL, fromPrims,
>                       readPatch,
>                       effect, invert,
> hunk ./src/Darcs/Repository/Internal.hs 124
>                       apply, applyToTree,
>                     )
>  import Darcs.Patch.Permutations ( commuteWhatWeCanFL, removeFL )
> -import Darcs.Patch.Info ( PatchInfo )
>  import Darcs.Patch.Set ( PatchSet(..), SealedPatchSet, newset2FL )
>  #ifdef GADT_WITNESSES
>  import Darcs.Patch.Set ( Origin )
> [Reorganise the Patch tests further.
> Petr Rockai <me@mornfall.net>**20110620091810
>  Ignore-this: b9bc5870d025d29d9d3d2dbd0fe950ad
> ] hunk ./src/Darcs/Test/Patch.hs 24
>  import Test.Framework ( Test, testGroup )
>  import Test.Framework.Providers.HUnit ( testCase )
>  import Test.Framework.Providers.QuickCheck2 ( testProperty )
> +import Test.QuickCheck.Arbitrary( Arbitrary )
>  import Test.HUnit ( assertBool )
>  
>  import Darcs.Test.Util.TestResult ( TestResult, isOk, fromMaybe )
> hunk ./src/Darcs/Test/Patch.hs 33
>  import Darcs.Witnesses.Ordered
>  import Darcs.Witnesses.Sealed
>  import Darcs.Witnesses.Eq ( unsafeCompare )
> -import Darcs.Patch.Prim( PrimPatch, join )
> +import Darcs.Witnesses.Show
> +import Darcs.Patch.Prim( PrimPatch, join, FromPrim, PrimOf, PrimPatchBase )
>  import Darcs.Patch.Prim.V1 ( Prim )
>  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
>  import Darcs.Patch.Patchy ( Commute(..) )
> hunk ./src/Darcs/Test/Patch.hs 39
>  
> -import Darcs.Test.Patch.Arbitrary.Generic( Tree )
> +import Darcs.Test.Patch.Arbitrary.Generic
> +import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> +import Darcs.Test.Patch.Test( Check(..) )
>  import Darcs.Test.Patch.Arbitrary.Real
>  import Darcs.Test.Patch.Arbitrary.PrimV1 ()
>  import Darcs.Test.Patch.RepoModel( RepoModel )
> hunk ./src/Darcs/Test/Patch.hs 59
>  import qualified Darcs.Test.Patch.Properties.GenericUnwitnessed as PropU
>  
>  import qualified Darcs.Test.Patch.WSub as WSub
> -import Darcs.Test.Patch.Arbitrary.PrimV1
>  
>  #include "gadts.h"
>  
> hunk ./src/Darcs/Test/Patch.hs 72
>      where assertName = "Boolean assertion for \"" ++ name ++ "\""
>            res        = and $ map (isOk . test) datas
>  
> -patchExampleTests :: [Test]
> -patchExampleTests =
> +unit_V1P1:: [Test]
> +unit_V1P1 =
>    [ runPrimitiveTests "Checking known commutes" Prop.checkCommute Ex.knownCommutes
>    , runPrimitiveTests "Checking known non-commutes" Prop.checkCantCommute Ex.knownCantCommutes
>    , runPrimitiveTests "Checking known merges" Prop.checkMerge Ex.knownMerges
> hunk ./src/Darcs/Test/Patch.hs 90
>    , runPrimitiveTests "Checking primitive commute/recommute" Prop.tCommuteRecommute Ex.primitiveCommutePairs
>    ]
>  
> --- | The unit tests defined about patches
> -patchUnitTests :: [Test]
> -patchUnitTests =
> +unit_V2P1 :: [Test]
> +unit_V2P1 =
>    [ runPrimitiveTests "join commute" (PropU.joinCommute WSub.join) ExU.primPermutables
>    , runPrimitiveTests "prim recommute" (PropU.recommute WSub.commute) ExU.commutables
>    , runPrimitiveTests "prim patch and inverse commute" (PropU.patchAndInverseCommute WSub.commute) ExU.commutables
> hunk ./src/Darcs/Test/Patch.hs 122
>  mergeEitherWayReals :: PrimPatch prim => (RealPatch prim :\/: RealPatch prim) C(x y) -> TestResult
>  mergeEitherWayReals = Prop.mergeEitherWay
>  
> -patchUnitTests2 :: [Test]
> -patchUnitTests2 =
> +qc_prim :: forall prim C(x y a).
> +           (PrimPatch prim, ArbitraryPrim prim, Show2 prim
> +           , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> +           , FromPrim prim
> +           , Arbitrary (Sealed2 prim)
> +           , Arbitrary (Sealed2 (WithState RepoModel prim))
> +           , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> +           , Arbitrary (Sealed2 (WithState RepoModel (FL prim :> FL prim)))
> +           , Arbitrary (Sealed2 (WithState RepoModel (FL prim)))
> +           , Arbitrary (Sealed2 (FL prim))
> +           , Arbitrary (Sealed2 (prim :> prim))
> +           , Arbitrary (Sealed2 (prim :> prim :> prim))
> +           , Arbitrary (Sealed2 (FL prim :> FL prim))
> +           ) => prim C(x y) -> [Test]
> +qc_prim _ =
>    [ testProperty "Checking Prim invert symmetry..."
> hunk ./src/Darcs/Test/Patch.hs 138
> -    (unseal2 $ Prop.invertSymmetry :: Sealed2 Prim -> TestResult)
> +    (unseal2 $ Prop.invertSymmetry :: Sealed2 prim -> TestResult)
>    , testProperty "Checking FL Prim invert symmetry..."
> hunk ./src/Darcs/Test/Patch.hs 140
> -    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL Prim) -> TestResult)
> +    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL prim) -> TestResult)
>    , testProperty "Checking Prim invert rollback..."
> hunk ./src/Darcs/Test/Patch.hs 142
> -    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel Prim) -> TestResult)
> +    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel prim) -> TestResult)
>    , testProperty "Checking FL Prim invert rollback..."
> hunk ./src/Darcs/Test/Patch.hs 144
> -    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL Prim)) -> TestResult)
> +    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL prim)) -> TestResult)
>    , testConditional "Checking Prim effect preserving..."
> hunk ./src/Darcs/Test/Patch.hs 146
> -    (unseal2 $ nonEmptyHunksPair . wsPatch)
> -    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState RepoModel (Prim :> Prim)) -> TestResult)
> +    (unseal2 $ P1.nonEmptyHunksPair . wsPatch)
> +    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState RepoModel (prim :> prim)) -> TestResult)
>    , testConditional "Checking FL Prim effect preserving..."
> hunk ./src/Darcs/Test/Patch.hs 149
> -    (unseal2 $ nonEmptyHunksFLPair . wsPatch)
> -    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState RepoModel (FL Prim :> FL Prim)) -> TestResult)
> +    (unseal2 $ P1.nonEmptyHunksFLPair . wsPatch)
> +    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState RepoModel (FL prim :> FL prim)) -> TestResult)
>    , testProperty "Checking Prim recommute..."
> hunk ./src/Darcs/Test/Patch.hs 152
> -    (unseal2 $ Prop.recommute commute :: Sealed2 (Prim :> Prim) -> TestResult)
> +    (unseal2 $ Prop.recommute commute :: Sealed2 (prim :> prim) -> TestResult)
>    , testProperty "Checking FL Prim recommute..."
> hunk ./src/Darcs/Test/Patch.hs 154
> -    (unseal2 $ Prop.recommute commute :: Sealed2 (FL Prim :> FL Prim) -> TestResult)
> +    (unseal2 $ Prop.recommute commute :: Sealed2 (FL prim :> FL prim) -> TestResult)
>    , testProperty "Checking Prim inverses commute..."
> hunk ./src/Darcs/Test/Patch.hs 156
> -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (Prim :> Prim) -> TestResult)
> +    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (prim :> prim) -> TestResult)
>    , testProperty "Checking FL Prim inverses commute..."
> hunk ./src/Darcs/Test/Patch.hs 158
> -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL Prim :> FL Prim) -> TestResult)
> +    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL prim :> FL prim) -> TestResult)
>      --do putStr "Checking with quickcheck that real patches have consistent flattenings... "
>      --   quickCheck (not . isBottomTimeOut (Just 10) . propConsistentTreeFlattenings) >> return 0
>      -- The following fails because of setpref patches...
> hunk ./src/Darcs/Test/Patch.hs 165
>      --,do putStr "Checking prim inverse doesn't commute using QuickCheck... "
>      --    simpleCheck (inverseDoesntCommute :: Prim -> Maybe Doc)
>    , testProperty "Checking prim join effect preserving... "
> -    (unseal2 (Prop.joinEffectPreserving join :: WithState RepoModel (Prim :> Prim) C(x y) -> TestResult))
> +    (unseal2 $ Prop.joinEffectPreserving join :: Sealed2 (WithState RepoModel (prim :> prim)) -> TestResult)
>    , testConditional "Checking prim join commute using QuickCheck... "
> hunk ./src/Darcs/Test/Patch.hs 167
> -    (unseal2 nonEmptyHunksTriple)
> -    (unseal2 (Prop.joinCommute join :: (Prim :> Prim :> Prim) C(x y) -> TestResult))
> +    (unseal2 P1.nonEmptyHunksTriple)
> +    (unseal2 $ Prop.joinCommute join :: Sealed2 (prim :> prim :> prim) -> TestResult)
>      --,do putStr "Checking prim recommute using QuickCheck... "
>      --    simpleCheck (recommute
>      --                 (commute :: Prim :> Prim
> hunk ./src/Darcs/Test/Patch.hs 173
>      --                          -> Maybe (Prim :> Prim)))
> -  , testProperty "Checking that readPatch and showPatch work on RealPatch... "
> +  ]
> +
> +qc_V2P1 :: [Test]
> +qc_V2P1 =
> +  [ testProperty "Checking that readPatch and showPatch work on RealPatch... "
>      (unseal $ patchFromTree $ (Prop.show_read :: RealPatch Prim C(x y) -> TestResult))
>    , testProperty "Checking that readPatch and showPatch work on FL RealPatch... "
>      (unseal2 $ (Prop.show_read :: FL (RealPatch Prim) C(x y) -> TestResult))
> hunk ./src/Darcs/Test/Patch.hs 184
>    , testProperty "Checking that tree flattenings are consistent... "
>      Prop.propConsistentTreeFlattenings
>    , testProperty "Checking with quickcheck that real patches are consistent... "
> -    (unseal $ patchFromTree $ fromMaybe . isConsistent)
> +    (unseal $ P1.patchFromTree $ fromMaybe . isConsistent)
>  
>    , testProperty "Checking we can do merges using QuickCheck"
>      (isNothing . (Prop.propIsMergeable ::
> hunk ./src/Darcs/Test/Patch.hs 191
>                       Sealed (WithStartState RepoModel (Tree Prim))
>                       -> Maybe (Tree (RealPatch Prim) C(x))))
>    , testProperty "Checking recommute using QuickCheck Tree generator"
> -    (unseal $ commutePairFromTree $ Prop.recommute commuteReals)
> +    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
>    , testProperty "Checking recommute using QuickCheck TWFP generator"
> hunk ./src/Darcs/Test/Patch.hs 193
> -    (unseal $ commutePairFromTWFP $ Prop.recommute commuteReals)
> +    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
>    , testConditional "Checking nontrivial recommute"
> hunk ./src/Darcs/Test/Patch.hs 195
> -    (unseal $ commutePairFromTree $ nontrivialReals)
> -    (unseal $ commutePairFromTree $ Prop.recommute commuteReals)
> +    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> +    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
>    , testConditional "Checking nontrivial recommute using TWFP"
> hunk ./src/Darcs/Test/Patch.hs 198
> -    (unseal $ commutePairFromTWFP $ nontrivialReals)
> -    (unseal $ commutePairFromTWFP $ Prop.recommute commuteReals)
> +    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> +    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
>  
>    , testProperty "Checking inverses commute using QuickCheck Tree generator"
> hunk ./src/Darcs/Test/Patch.hs 202
> -    (unseal $ commutePairFromTree $
> +    (unseal $ P1.commutePairFromTree $
>       (Prop.commuteInverses commuteReals))
>    , testProperty "Checking inverses commute using QuickCheck TWFP generator"
> hunk ./src/Darcs/Test/Patch.hs 205
> -    (unseal $ commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> +    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses commuteReals)
>    , testConditional "Checking nontrivial inverses commute"
> hunk ./src/Darcs/Test/Patch.hs 207
> -    (unseal $ commutePairFromTree $ nontrivialReals)
> -    (unseal $ commutePairFromTree $ Prop.commuteInverses commuteReals)
> +    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> +    (unseal $ P1.commutePairFromTree $ Prop.commuteInverses commuteReals)
>    , testConditional "Checking nontrivial inverses commute using TWFP"
> hunk ./src/Darcs/Test/Patch.hs 210
> -    (unseal $ commutePairFromTWFP $ nontrivialReals)
> -    (unseal $ commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> +    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> +    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses commuteReals)
>  
>    , testProperty "Checking merge either way using QuickCheck TWFP generator"
> hunk ./src/Darcs/Test/Patch.hs 214
> -    (unseal $ mergePairFromTWFP $ mergeEitherWayReals)
> +    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
>    , testProperty "Checking merge either way using QuickCheck Tree generator"
> hunk ./src/Darcs/Test/Patch.hs 216
> -    (unseal $ mergePairFromTree $ mergeEitherWayReals)
> +    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
>    , testConditional "Checking nontrivial merge either way"
> hunk ./src/Darcs/Test/Patch.hs 218
> -    (unseal $ mergePairFromTree $ nontrivialMergeReals)
> -    (unseal $ mergePairFromTree $ mergeEitherWayReals)
> +    (unseal $ P1.mergePairFromTree $ nontrivialMergeReals)
> +    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
>    , testConditional "Checking nontrivial merge either way using TWFP"
> hunk ./src/Darcs/Test/Patch.hs 221
> -    (unseal $ mergePairFromTWFP $ nontrivialMergeReals)
> -    (unseal $ mergePairFromTWFP $ mergeEitherWayReals)
> +    (unseal $ P1.mergePairFromTWFP $ nontrivialMergeReals)
> +    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
>  
>    , testConditional "Checking permutivity"
> hunk ./src/Darcs/Test/Patch.hs 225
> -    (unseal $ commuteTripleFromTree notDuplicatestriple)
> -    (unseal $ commuteTripleFromTree $ Prop.permutivity commuteReals)
> +    (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> +    (unseal $ P1.commuteTripleFromTree $ Prop.permutivity commuteReals)
>    , testConditional "Checking partial permutivity"
> hunk ./src/Darcs/Test/Patch.hs 228
> -    (unseal $ commuteTripleFromTree notDuplicatestriple)
> -    (unseal $ commuteTripleFromTree $ Prop.partialPermutivity commuteReals)
> +    (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> +    (unseal $ P1.commuteTripleFromTree $ Prop.partialPermutivity commuteReals)
>    , testConditional "Checking nontrivial permutivity"
> hunk ./src/Darcs/Test/Patch.hs 231
> -    (unseal $ commuteTripleFromTree (\t -> nontrivialTriple t && notDuplicatestriple t))
> -    (unseal $ commuteTripleFromTree $ (Prop.permutivity commuteReals))
> +    (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t && notDuplicatestriple t))
> +    (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity commuteReals))
>    ]
>  
> hunk ./src/Darcs/Test/Patch.hs 235
> -patchPropertyTests :: [Test]
> -patchPropertyTests =
> +qc_V1P1 :: [Test]
> +qc_V1P1 =
>    [
>      testProperty "Checking that show and read work right" (unseal Prop.propReadShow)
>    ]
> hunk ./src/Darcs/Test/Patch.hs 272
>  
>  -- | This is the big list of tests that will be run using testrunner.
>  testSuite :: [Test]
> -testSuite = [ testGroup "Darcs.Patch (Properties.GenericUnwitnessed + Examples.Set3Unwitnessed)" patchUnitTests
> -            , testGroup "Darcs.Patch (Properties.Generic + Arbitrary)" patchUnitTests2
> -            , testGroup "Darcs.Patch (Properties.V1Set2 + Arbitrary)" patchPropertyTests
> -            , testGroup "Darcs.Patch (Properties.V1Set1 + Examples.Set1)" patchExampleTests
> +testSuite = [ testGroup "Darcs.Patch.Prim.V1" $ qc_prim (undefined :: Prim C(x y))
> +            , testGroup "Darcs.Patch.V1 (using Prim.V1)" $ unit_V1P1 ++ qc_V1P1
> +            , testGroup "Darcs.Patch.V2 (using Prim.V1)" $ unit_V2P1 ++ qc_V2P1
>              , Darcs.Test.Patch.Info.testSuite
>              ]
> [Generalise the V1.Prim Arbitrary instance based on Tree to any PrimPatch.
> Petr Rockai <me@mornfall.net>**20110620123027
>  Ignore-this: 289e1227afffcec6484ce10a477f977a
> ] hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 31
>  import Darcs.Patch.Patchy ( Invert(..), Commute(..) )
>  import Darcs.Patch.Prim ( PrimOf, PrimPatch, PrimPatchBase, FromPrim(..), move )
>  import Darcs.Patch.Prim.V1 ()
> +import Darcs.Patch.V2 ( RealPatch ) -- XXX this is more or less a hack
>  --import Darcs.ColorPrinter ( errorDoc )
>  --import Darcs.ColorPrinter ( traceDoc )
>  import Darcs.Witnesses.Show
> hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 222
>  getTriples (_:>:NilFL) = []
>  getTriples (_:>:_:>:NilFL) = []
>  getTriples (a:>:b:>:c:>:d) = seal2 (a:>b:>c) : getTriples (b:>:c:>:d)
> +
> +instance ArbitraryPrim prim => Arbitrary (Sealed (WithStartState RepoModel (TreeWithFlattenPos prim))) where
> +   arbitrary = do Sealed (WithStartState rm t) <- arbitrary
> +                  let num = unseal (length . getPairs) (flattenOneRP t)
> +                  if num == 0 then return $ Sealed $ WithStartState rm $ TWFP 0 NilTree
> +                    else do n <- choose (0, num - 1)
> +                            return $ Sealed $ WithStartState rm $ TWFP n t
> +                    where -- just used to get the length. In principle this should be independent of the patch type.
> +                          flattenOneRP :: Tree prim C(x) -> Sealed (FL (RealPatch prim) C(x))
> +                          flattenOneRP = flattenOne
> +
> hunk ./src/Darcs/Test/Patch/Arbitrary/Real.hs 19
>  import Darcs.Witnesses.Sealed
>  import Darcs.Witnesses.Eq
>  import Darcs.Patch.Prim ( FromPrim(..) )
> -import Darcs.Patch.Prim.V1 ( Prim )
>  
>  #include "gadts.h"
>  
> hunk ./src/Darcs/Test/Patch/Arbitrary/Real.hs 65
>          Just (c' :> b'') -> (not (a `unsafeCompare` a') || not (b `unsafeCompare` b')) &&
>                              (not (c' `unsafeCompare` c) || not (b'' `unsafeCompare` b)) &&
>                              (not (c'' `unsafeCompare` c) || not (a'' `unsafeCompare` a'))
> -
> -instance Arbitrary (Sealed (WithStartState RepoModel (TreeWithFlattenPos Prim))) where
> -   arbitrary = do Sealed (WithStartState rm t) <- arbitrary
> -                  let num = unseal (length . getPairs) (flattenOneRP t)
> -                  if num == 0 then return $ Sealed $ WithStartState rm $ TWFP 0 NilTree
> -                    else do n <- choose (0, num - 1)
> -                            return $ Sealed $ WithStartState rm $ TWFP n t
> -                    where -- just used to get the length. In principle this should be independent of the patch type.
> -                          flattenOneRP :: Tree Prim C(x) -> Sealed (FL (RealPatch Prim) C(x))
> -                          flattenOneRP = flattenOne
> -
> [Generalise a bunch of merge/commute properties over the patch type & generator.
> Petr Rockai <me@mornfall.net>**20110620123354
>  Ignore-this: fd5b45e576226d719531182bedd5ac9d
> ] hunk ./src/Darcs/Test/Patch.hs 1
> +{-# OPTIONS_GHC -fno-warn-orphans #-}
>  --  Copyright (C) 2002-2005,2007 David Roundy
>  --
>  --  This program is free software; you can redistribute it and/or modify
> hunk ./src/Darcs/Test/Patch.hs 26
>  import Test.Framework.Providers.HUnit ( testCase )
>  import Test.Framework.Providers.QuickCheck2 ( testProperty )
>  import Test.QuickCheck.Arbitrary( Arbitrary )
> +import Test.QuickCheck( Testable )
>  import Test.HUnit ( assertBool )
>  
>  import Darcs.Test.Util.TestResult ( TestResult, isOk, fromMaybe )
> hunk ./src/Darcs/Test/Patch.hs 38
>  import Darcs.Witnesses.Show
>  import Darcs.Patch.Prim( PrimPatch, join, FromPrim, PrimOf, PrimPatchBase )
>  import Darcs.Patch.Prim.V1 ( Prim )
> +import qualified Darcs.Patch.V1 as V1
>  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
> hunk ./src/Darcs/Test/Patch.hs 40
> -import Darcs.Patch.Patchy ( Commute(..) )
> +import Darcs.Patch.RepoPatch( RepoPatch )
> +import Darcs.Patch.Patchy ( Commute(..), Patchy )
>  
>  import Darcs.Test.Patch.Arbitrary.Generic
>  import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> hunk ./src/Darcs/Test/Patch.hs 120
>    , runPrimitiveTests "real partial permutivity" (PropU.partialPermutivity WSub.commute) ExU.realNonduplicateTriples
>    ]
>  
> +instance Check (RealPatch Prim) where
> +  checkPatch p = return $ isNothing $ isConsistent p
> +
>  commuteReals :: PrimPatch prim => (RealPatch prim :> RealPatch prim) C(x y) -> Maybe ((RealPatch prim :> RealPatch prim) C(x y))
>  commuteReals = commute
>  
> hunk ./src/Darcs/Test/Patch.hs 126
> -mergeEitherWayReals :: PrimPatch prim => (RealPatch prim :\/: RealPatch prim) C(x y) -> TestResult
> -mergeEitherWayReals = Prop.mergeEitherWay
> -
>  qc_prim :: forall prim C(x y a).
>             (PrimPatch prim, ArbitraryPrim prim, Show2 prim
>             , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> hunk ./src/Darcs/Test/Patch.hs 130
>             , FromPrim prim
> +           , Arbitrary (Sealed ((prim :> prim) C(a)))
> +           , Arbitrary (Sealed ((FL prim :> FL prim) C(a)))
> +           , Show1 ((PrimOf prim :> PrimOf prim) C(a))
>             , Arbitrary (Sealed2 prim)
>             , Arbitrary (Sealed2 (WithState RepoModel prim))
>             , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> hunk ./src/Darcs/Test/Patch.hs 158
>    , testConditional "Checking FL Prim effect preserving..."
>      (unseal2 $ P1.nonEmptyHunksFLPair . wsPatch)
>      (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState RepoModel (FL prim :> FL prim)) -> TestResult)
> -  , testProperty "Checking Prim recommute..."
> -    (unseal2 $ Prop.recommute commute :: Sealed2 (prim :> prim) -> TestResult)
> -  , testProperty "Checking FL Prim recommute..."
> -    (unseal2 $ Prop.recommute commute :: Sealed2 (FL prim :> FL prim) -> TestResult)
> -  , testProperty "Checking Prim inverses commute..."
> -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (prim :> prim) -> TestResult)
> -  , testProperty "Checking FL Prim inverses commute..."
> -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL prim :> FL prim) -> TestResult)
>      --do putStr "Checking with quickcheck that real patches have consistent flattenings... "
>      --   quickCheck (not . isBottomTimeOut (Just 10) . propConsistentTreeFlattenings) >> return 0
>      -- The following fails because of setpref patches...
> hunk ./src/Darcs/Test/Patch.hs 172
>      --    simpleCheck (recommute
>      --                 (commute :: Prim :> Prim
>      --                          -> Maybe (Prim :> Prim)))
> -  ]
> +  ] ++ commute_properties (undefined :: prim C(x y)) "arbitrary" arbitraryCommutePair
> +    ++ commute_properties (undefined :: FL prim C(x y)) "arbitrary FL" arbitraryFLCommutePair
> +    where arbitraryCommutePair
> +            :: (FORALL(xx yy) (prim :> prim) C(xx yy) -> t) ->
> +               ((prim :> prim) C(a bb) -> t)
> +          arbitraryCommutePair f p = f p
> +          arbitraryFLCommutePair :: (FORALL(xx yy) (FL prim :> FL prim) C(xx yy) -> t) ->
> +                                    ((FL prim :> FL prim) C(a bb) -> t)
> +          arbitraryFLCommutePair f p = f p
>  
>  qc_V2P1 :: [Test]
>  qc_V2P1 =
> hunk ./src/Darcs/Test/Patch.hs 184
> +  -- utilities ------------------------------------------------------------------------------
>    [ testProperty "Checking that readPatch and showPatch work on RealPatch... "
>      (unseal $ patchFromTree $ (Prop.show_read :: RealPatch Prim C(x y) -> TestResult))
>    , testProperty "Checking that readPatch and showPatch work on FL RealPatch... "
> hunk ./src/Darcs/Test/Patch.hs 198
>      (isNothing . (Prop.propIsMergeable ::
>                       Sealed (WithStartState RepoModel (Tree Prim))
>                       -> Maybe (Tree (RealPatch Prim) C(x))))
> -  , testProperty "Checking recommute using QuickCheck Tree generator"
> -    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> -  , testProperty "Checking recommute using QuickCheck TWFP generator"
> -    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> -  , testConditional "Checking nontrivial recommute"
> -    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> -    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> -  , testConditional "Checking nontrivial recommute using TWFP"
> -    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> -    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> -
> -  , testProperty "Checking inverses commute using QuickCheck Tree generator"
> -    (unseal $ P1.commutePairFromTree $
> -     (Prop.commuteInverses commuteReals))
> -  , testProperty "Checking inverses commute using QuickCheck TWFP generator"
> -    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> -  , testConditional "Checking nontrivial inverses commute"
> -    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> -    (unseal $ P1.commutePairFromTree $ Prop.commuteInverses commuteReals)
> -  , testConditional "Checking nontrivial inverses commute using TWFP"
> -    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> -    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> -
> -  , testProperty "Checking merge either way using QuickCheck TWFP generator"
> -    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> -  , testProperty "Checking merge either way using QuickCheck Tree generator"
> -    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> -  , testConditional "Checking nontrivial merge either way"
> -    (unseal $ P1.mergePairFromTree $ nontrivialMergeReals)
> -    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> -  , testConditional "Checking nontrivial merge either way using TWFP"
> -    (unseal $ P1.mergePairFromTWFP $ nontrivialMergeReals)
> -    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
>  
> hunk ./src/Darcs/Test/Patch.hs 199
> +  -- permutivity ----------------------------------------------------------------------------
>    , testConditional "Checking permutivity"
>      (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
>      (unseal $ P1.commuteTripleFromTree $ Prop.permutivity commuteReals)
> hunk ./src/Darcs/Test/Patch.hs 209
>    , testConditional "Checking nontrivial permutivity"
>      (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t && notDuplicatestriple t))
>      (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity commuteReals))
> +
> +  ] ++ merge_properties (undefined :: RealPatch Prim C(x y)) "tree" mergePairFromTree
> +    ++ merge_properties (undefined :: RealPatch Prim C(x y)) "twfp" mergePairFromTWFP
> +    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "tree" commutePairFromTree
> +    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "twfp" commutePairFromTWFP
> +
> +commute_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf p), FromPrim p
> +                                       , Show2 p, Show2 (PrimOf p), Patchy p
> +                                       , Show1 gen, Arbitrary (Sealed gen))
> +                 => p C(x y) -> String ->
> +                    (FORALL(ctx t) ((FORALL(xx yy) (p :> p) xx yy -> t) -> (gen ctx -> t))) ->
> +                    [Test]
> +commute_properties _ genname gen =
> +  [ prop "recommute" $ Prop.recommute commute
> +  , cond "nontrivial recommute" nontrivialCommute $ Prop.recommute commute
> +  , prop "inverses commute" $ Prop.commuteInverses commute
> +  , cond "nontrivial inverses" nontrivialCommute $ Prop.commuteInverses commute
>    ]
> hunk ./src/Darcs/Test/Patch.hs 227
> +  where prop :: String -> (FORALL (yy zz) (p :> p) C(yy zz) -> TestResult) -> Test
> +        prop t p = cond t (const True) p
> +        cond :: String ->
> +                (FORALL (yy zz) (p :> p) C(yy zz) -> Bool) ->
> +                (FORALL (yy zz) (p :> p) C(yy zz) -> TestResult) -> Test
> +        cond t c p =
> +          testConditional ("commute (" ++ genname ++ "): " ++ t)
> +          (unseal $ gen c) (unseal $ gen p)
> +
> +merge_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf p), FromPrim p
> +                                      , Show2 p, Show2 (PrimOf p), RepoPatch p
> +                                      , Show1 gen, Arbitrary (Sealed gen))
> +                 => p C(x y) -> String ->
> +                    (FORALL(ctx t) ((FORALL(xx yy) (p :\/: p) xx yy -> t) -> (gen ctx -> t))) ->
> +                    [Test]
> +merge_properties _ genname gen =
> +    [ prop "merge swap" Prop.tMergeSwapMerge
> +    , prop "merge either way" Prop.mergeEitherWay
> +    , prop "merge either way valid" Prop.tMergeEitherWayValid
> +    , cond "nontrivial merge either way" nontrivialMerge Prop.mergeEitherWay
> +    ]
> +  where prop :: Testable t => String -> (FORALL (yy zz) (p :\/: p) C(yy zz) -> t) -> Test
> +        prop t p = cond t (const True) p
> +        cond :: (Testable t) => String ->
> +                (FORALL (yy zz) (p :\/: p) C(yy zz) -> Bool) ->
> +                (FORALL (yy zz) (p :\/: p) C(yy zz) -> t) -> Test
> +        cond t c p =
> +          testConditional ("merge (" ++ genname ++ "): " ++ t)
> +          (unseal $ gen c) (unseal $ gen p)
>  
>  qc_V1P1 :: [Test]
>  qc_V1P1 =
> hunk ./src/Darcs/Test/Patch.hs 269
>    [ testProperty "Checking that commuting by patch and its inverse is ok" Prop.propCommuteInverse
>     --putStr "Checking that conflict resolution is valid... "
>     --runQuickCheckTest returnval propResolveConflictsValid
> -  , testProperty "Checking that a patch followed by its inverse is identity" Prop.propPatchAndInverseIsIdentity
> +  , testProperty "Checking that a patch followed by its inverse is identity"
> +    Prop.propPatchAndInverseIsIdentity
>    , testProperty "Checking 'simple smart merge'" Prop.propSimpleSmartMergeGoodEnough
>    , testProperty "Checking that commutes are equivalent" Prop.propCommuteEquivalency
>    , testProperty "Checking that merges are valid" Prop.propMergeValid
> hunk ./src/Darcs/Test/Patch.hs 291
>    , testProperty "Checking that merges commute and are well behaved" Prop.propMergeIsCommutableAndCorrect
>    , testProperty "Checking that merges can be swapped" Prop.propMergeIsSwapable
>    , testProperty "Checking again that merges can be swapped (I'm paranoid) " Prop.propMergeIsSwapable
> -  ]
> +
> +  ] -- the following properties are disabled, because they routinely lead to
> +    -- exponential cases, making the tests run for ever and ever; nevertheless,
> +    -- we would expect them to hold
> + {- ++ merge_properties (undefined :: V1.Patch Prim C(x y)) "tree" mergePairFromTree
> +    ++ merge_properties (undefined :: V1.Patch Prim C(x y)) "twfp" mergePairFromTWFP
> +    ++ commute_properties (undefined :: V1.Patch Prim C(x y)) "tree" commutePairFromTree
> +    ++ commute_properties (undefined :: V1.Patch Prim C(x y)) "twfp" commutePairFromTWFP -}
>  
>  -- | This is the big list of tests that will be run using testrunner.
>  testSuite :: [Test]
> hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 63
>  instance Show2 p => Show1 (Tree p) where
>      showDict1 = ShowDictClass
>  
> +instance Show2 p => Show1 (TreeWithFlattenPos p) where
> +    showDict1 = ShowDictClass
> +
>  sizeTree :: Tree p C(x) -> Int
>  sizeTree NilTree = 0
>  sizeTree (SeqTree _ t) = 1 + sizeTree t
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 18
>  import Darcs.Witnesses.Eq
>  import Darcs.Witnesses.Unsafe
>  import Darcs.Witnesses.Ordered
> -import Darcs.Witnesses.Show
> +-- import Darcs.Witnesses.Show
>  import Darcs.Patch.Prim.V1 ()
>  import Darcs.Patch.Prim.V1.Core ( FilePatchType( Hunk, TokReplace ), Prim( FP ), isIdentity )
>  import Darcs.Patch.RepoPatch ( RepoPatch )
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 84
>    arbitrary = do repo <- aSmallRepo
>                   liftM (unseal (seal2 . wesPatch)) $ arbitraryState repo
>  
> -instance Show1 (TreeWithFlattenPos Prim) where
> -   showDict1 = ShowDictClass
> +-- instance Show1 (TreeWithFlattenPos Prim) where
> +--   showDict1 = ShowDictClass
>  
>  -- WithState and propFail are handy for debugging arbitrary code
>  propFail :: Int -> Tree Prim C(x) -> Bool
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 339
>                   WithEndState pp _ <- aPrimPair repo
>                   return $ seal2 pp
>  
> +instance Arbitrary (Sealed ((Prim :> Prim) C(a))) where
> +  arbitrary = do repo <- aSmallRepo
> +                 WithEndState pp _ <- aPrimPair repo
> +                 return $ seal pp
> +
>  instance Arbitrary (Sealed2 (Prim :> Prim :> Prim)) where
>    arbitrary = makeGen aSmallRepo
>  
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 353
>  instance Arbitrary (Sealed2 (FL Prim :> FL Prim)) where
>    arbitrary = makeGen aSmallRepo
>  
> +instance Arbitrary (Sealed ((FL Prim :> FL Prim) C(a))) where
> +  arbitrary = makeSGen aSmallRepo
>  
>  instance Arbitrary (Sealed2 (WithState RepoModel Prim)) where
>    arbitrary = makeWSGen aSmallRepo
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 14
>       , readPatch, showPatch
>       , fromPrim, canonize, sortCoalesceFL )
>  import Darcs.Patch.Prim.V1 ( Prim )
> +import Darcs.Patch.Merge ( Merge )
>  import qualified Darcs.Patch.V1 as V1 ( Patch )
>  import Darcs.Test.Patch.Test
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 17
> -    ( checkAPatch )
> +    ( checkAPatch, Check )
>  import Printer ( renderPS )
>  import Darcs.Witnesses.Eq
>  import Darcs.Witnesses.Ordered
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 32
>  type Patch = V1.Patch Prim
>  
>  
> -quickmerge :: (FL Patch :\/: FL Patch) C(x y) -> FL Patch C(y z)
> +quickmerge :: (Patchy p, Merge p) => (p :\/: p ) C(x y) -> p C(y z)
>  quickmerge (p1:\/:p2) = case merge (p1:\/:p2) of
>                          _ :/\: p1' -> unsafeCoercePEnd p1'
>  
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 138
>                          else failed $ text $ "Failed to read shown:  "++(show2 p)++"\n"
>      Nothing -> failed $ text $ "Failed to read at all:  "++(show2 p)++"\n"
>  
> -tMergeEitherWayValid :: FORALL(x y) (FL Patch :\/: FL Patch) C(x y) -> TestResult
> +tMergeEitherWayValid :: FORALL(x y p) (Check p, Show2 p, Merge p, Patchy p) => (p :\/: p) C(x y) -> TestResult
>  tMergeEitherWayValid (p1 :\/: p2) =
>    case p2 :>: quickmerge (p1:\/: p2) :>: NilFL of
>    combo2 ->
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 145
>      case p1 :>: quickmerge (p2:\/: p1) :>: NilFL of
>      combo1 ->
>        if not $ checkAPatch combo1
> -      then failed $ text $ "oh my combo1 invalid:\n"++show p1++"and...\n"++show p2++show combo1
> +      then failed $ text $ "oh my combo1 invalid:\n"++show2 p1++"and...\n"++show2 p2++show combo1
>        else
>          if checkAPatch (invert combo1 :>: combo2 :>: NilFL)
>          then succeeded
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 149
> -        else failed $ text $ "merge both ways invalid:\n"++show p1++"and...\n"++show p2++
> +        else failed $ text $ "merge both ways invalid:\n"++show2 p1++"and...\n"++show2 p2++
>                show combo1++
>                show combo2
>  
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 153
> -tMergeSwapMerge :: (FL Patch :\/: FL Patch) C(x y) -> TestResult
> +tMergeSwapMerge :: forall p x y. (Patchy p, Show2 p, Merge p) => (p :\/: p) C(x y) -> TestResult
>  tMergeSwapMerge (p1 :\/: p2) =
>    if merge (p2 :\/: p1) `eqSwapped` merge (p1 :\/: p2)
>    then succeeded
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 157
> -  else failed $ text $ "Failed to swap merges:\n"++show p1++"and...\n"++show p2
> +  else failed $ text $ "Failed to swap merges:\n"++show2 p1++"and...\n"++show2 p2
>          ++"merged:\n"++show (merge (p1:\/:p2))++"\n"
>          ++"merged swapped:\n"++show (merge (p2:\/: p1))++"\n"
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 160
> -    where eqSwapped :: (FL Patch :/\: FL Patch) C(x y) -> (FL Patch :/\: FL Patch) C(y x) -> Bool
> -          eqSwapped (x1 :/\: y1) (y2 :/\: x2) | IsEq <- eqFL x1 x2, IsEq <- eqFL y1 y2 = True
> +    where eqSwapped :: (p :/\: p) C(x_ y_) -> (p :/\: p) C(y_ x_) -> Bool
> +          eqSwapped (x1 :/\: y1) (y2 :/\: x2) | unsafeCompare x1 x2, unsafeCompare y1 y2 = True
>            eqSwapped _ _ = False
>  
>  tCommuteRecommute :: FORALL(x y) (FL Patch :< FL Patch) C(x y) -> TestResult
> hunk ./src/Darcs/Test/Patch/WithState.hs 115
>                     Sealed (WithEndState p _) <- arbitraryState s
>                     return $ seal2 p
>  
> +makeSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed (p C(x)))
> +makeSGen stGen = do s <- stGen
> +                    Sealed (WithEndState p _) <- arbitraryState s
> +                    return $ seal p
> +
>  makeWSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2 (WithState s p))
>  makeWSGen stGen = do s <- stGen
>                       Sealed (WithEndState wsP _) <- arbitraryState s
> [Split Test.Patch.Test into Properties.Check and Arbitrary.PatchV1.
> Petr Rockai <me@mornfall.net>**20110620133651
>  Ignore-this: 16322561bc5c8dd5c356e632bb7d22ef
> ] move ./src/Darcs/Test/Patch/Test.hs ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs
> hunk ./darcs.cabal 613
>                        Darcs.Test.Patch.Properties.V1Set2
>                        Darcs.Test.Patch.Properties.Generic
>                        Darcs.Test.Patch.Properties.GenericUnwitnessed
> +                      Darcs.Test.Patch.Properties.Check
>                        Darcs.Test.Patch.Arbitrary.Generic
>                        Darcs.Test.Patch.Arbitrary.Real
>                        Darcs.Test.Patch.Arbitrary.PrimV1
> hunk ./darcs.cabal 617
> +                      Darcs.Test.Patch.Arbitrary.PatchV1
>                        Darcs.Test.Patch.RepoModel
> hunk ./darcs.cabal 619
> -                      Darcs.Test.Patch.Test
>                        Darcs.Test.Patch.Utils
>                        Darcs.Test.Patch.WithState
>                        Darcs.Test.Patch
> hunk ./src/Darcs/Test/Patch.hs 45
>  
>  import Darcs.Test.Patch.Arbitrary.Generic
>  import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> -import Darcs.Test.Patch.Test( Check(..) )
>  import Darcs.Test.Patch.Arbitrary.Real
> hunk ./src/Darcs/Test/Patch.hs 46
> +import Darcs.Test.Patch.Arbitrary.PatchV1 ()
>  import Darcs.Test.Patch.Arbitrary.PrimV1 ()
>  import Darcs.Test.Patch.RepoModel( RepoModel )
>  import Darcs.Test.Patch.WithState( WithState, wsPatch, WithStartState )
> hunk ./src/Darcs/Test/Patch.hs 56
>  import qualified Darcs.Test.Patch.Examples.Set1 as Ex
>  import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
>  
> +import Darcs.Test.Patch.Properties.Check( Check(..), checkAPatch )
>  import qualified Darcs.Test.Patch.Properties.V1Set1 as Prop
>  import qualified Darcs.Test.Patch.Properties.V1Set2 as Prop
>  import qualified Darcs.Test.Patch.Properties.Generic as Prop
> hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 23
>  
>  #include "gadts.h"
>  
> -module Darcs.Test.Patch.Test
> -             (
> -               Check, checkPatch, checkAPatch, verboseCheckAPatch
> -             ) where
> +module Darcs.Test.Patch.Arbitrary.PatchV1 () where
>  
>  import Prelude hiding ( pi )
>  import System.IO.Unsafe ( unsafePerformIO )
> hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 59
>  import Darcs.Witnesses.Sealed ( Sealed(Sealed), unseal, mapSeal, Sealed2(..) )
>  import Darcs.Witnesses.Unsafe
>  
> +-- This definitely feels a bit weird to be importing Properties here, and
> +-- probably means we want to move this elsewhere, but Darcs.Test.Patch.Check is
> +-- already taken with something apparently only semi-related
> +import Darcs.Test.Patch.Properties.Check( checkAPatch )
> +
>  #include "impossible.h"
>  
>  type Patch = V1.Patch Prim
> hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 291
>                         (1,map fromSafeChar `fmap` arbitrary),
>                         (1,liftM2 (\a b-> a++"/"++b) filepathgen filepathgen) ]
>  
> -class Check p where
> -   checkPatch :: p C(x y) -> PatchCheck Bool
> -
> -instance Check p => Check (FL p) where
> -   checkPatch NilFL = isValid
> -   checkPatch (p :>: ps) = checkPatch p >> checkPatch ps
> -
> -checkAPatch :: (Invert p, Check p) => p C(x y) -> Bool
> -checkAPatch p = doCheck $ do _ <- checkPatch p
> -                             checkPatch $ invert p
> -
> -verboseCheckAPatch :: (Invert p, Check p) => p C(x y) -> Bool
> -verboseCheckAPatch p = doVerboseCheck $ do checkPatch p
> -
> -instance Check Patch where
> -   checkPatch p | isMerger p = do
> -     checkPatch $ effect p
> -   checkPatch (V1.Merger _ _ _ _) = impossible
> -   checkPatch (V1.Regrem _ _ _ _) = impossible
> -   checkPatch (V1.PP p) = checkPatch p
> -
> -instance Check Prim where
> -
> -   checkPatch (FP f RmFile) = removeFile $ fn2fp f
> -   checkPatch (FP f AddFile) =  createFile $ fn2fp f
> -   checkPatch (FP f (Hunk line old new)) = do
> -       _ <- fileExists $ fn2fp f
> -       mapM_ (deleteLine (fn2fp f) line) old
> -       mapM_ (insertLine (fn2fp f) line) (reverse new)
> -       isValid
> -   checkPatch (FP f (TokReplace t old new)) =
> -       modifyFile (fn2fp f) (tryTokPossibly t old new)
> -   -- note that the above isn't really a sure check, as it leaves PSomethings
> -   -- and PNothings which may have contained new...
> -   checkPatch (FP f (Binary o n)) = do
> -       _ <- fileExists $ fn2fp f
> -       mapM_ (deleteLine (fn2fp f) 1) (linesPS o)
> -       _ <- fileEmpty $ fn2fp f
> -       mapM_ (insertLine (fn2fp f) 1) (reverse $ linesPS n)
> -       isValid
> -
> -   checkPatch (DP d AddDir) = createDir $ fn2fp d
> -   checkPatch (DP d RmDir) = removeDir $ fn2fp d
> -
> -   checkPatch (Move f f') = checkMove (fn2fp f) (fn2fp f')
> -   checkPatch (ChangePref _ _ _) = return True
> -
>  regularizePatches :: FL Patch C(x y) -> FL Patch C(x y)
>  regularizePatches patches = rpint (unsafeCoerceP NilFL) patches
>      where -- this reverses the list, which seems odd and causes
> hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 302
>              then rpint (unsafeCoerceP p:>:ok_ps) ps
>              else rpint ok_ps ps
>  
> -tryTokPossibly :: String -> String -> String
> -                -> (Maybe FileContents) -> (Maybe FileContents)
> -tryTokPossibly t o n = liftM $ \contents ->
> -        let lines' = M.mapMaybe (liftM B.concat
> -                                  . tryTokInternal t (BC.pack o) (BC.pack n))
> -                                (fcLines contents)
> -        in contents { fcLines = lines' }
> -
> -tryTokInternal :: String -> B.ByteString -> B.ByteString
> -                 -> B.ByteString -> Maybe [B.ByteString]
> -tryTokInternal _ _ _ s | B.null s = Just []
> -tryTokInternal t o n s =
> -    case BC.break (regChars t) s of
> -    (before,s') ->
> -        case BC.break (not . regChars t) s' of
> -        (tok,after) ->
> -            case tryTokInternal t o n after of
> -            Nothing -> Nothing
> -            Just rest ->
> -                if tok == o
> -                then Just $ before : n : rest
> -                else if tok == n
> -                     then Nothing
> -                     else Just $ before : tok : rest
> -
> hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 39
>  import Darcs.Patch.Prim ( PrimOf, FromPrim )
>  import Darcs.Patch.Prim.V1 ( Prim )
>  import qualified Darcs.Patch.V1 as V1 ( Patch )
> -import Darcs.Test.Patch.Test
> -    ( checkAPatch )
> +import Darcs.Test.Patch.Properties.Check( checkAPatch )
>  import Darcs.Witnesses.Ordered
>  import Darcs.Witnesses.Sealed ( unsafeUnseal )
>  import Darcs.Witnesses.Unsafe ( unsafeCoerceP, unsafeCoercePEnd )
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 16
>  import Darcs.Patch.Prim.V1 ( Prim )
>  import Darcs.Patch.Merge ( Merge )
>  import qualified Darcs.Patch.V1 as V1 ( Patch )
> -import Darcs.Test.Patch.Test
> -    ( checkAPatch, Check )
> +import Darcs.Test.Patch.Properties.Check ( checkAPatch, Check )
>  import Printer ( renderPS )
>  import Darcs.Witnesses.Eq
>  import Darcs.Witnesses.Ordered
> hunk ./src/Darcs/Test/Patch/Properties/V1Set2.hs 46
>  import Test.Framework ( Test )
>  import Data.Maybe ( isJust )
>  
> -import Darcs.Test.Patch.Test ( Check, checkAPatch )
> +import Darcs.Test.Patch.Properties.Check ( Check, checkAPatch )
>  
>  import Darcs.Patch ( invert, commute, merge,
>                       readPatch, resolveConflicts,
> [Print detailed diagnostic in patchAndInverseCommute.
> Petr Rockai <me@mornfall.net>**20110621141112
>  Ignore-this: f63f87d199f12fed09226bd43184f203
> ] hunk ./src/Darcs/Test/Patch/Properties/Generic.hs 150
>    Nothing -> rejected
>    Just (y' :> x') ->
>       case c (invert x :> y') of
> -       Nothing -> failed (redText "failure in patchAndInverseCommute")
> +       Nothing -> failed (redText ""
> +                          $$ redText "-------- original commute (x :> y):"
> +                          $$ showPatch x $$ redText ":>" $$ showPatch y
> +                          $$ redText "-------- result (y' :> x'):"
> +                          $$ showPatch y' $$ redText ":>" $$ showPatch x'
> +                          $$ redText "-------- bad commute (invert x :> y'):"
> +                          $$ showPatch (invert x) $$ redText ":>" $$ showPatch y')
>         Just (y'' :> ix') ->
>             case y'' =\/= y of
>             NotEq -> failed (redText "y'' /= y" $$
> [Slightly restructure and expand the Prim Arbitrary instances.
> Petr Rockai <me@mornfall.net>**20110621141234
>  Ignore-this: bf95d5786f1bc1a3ec2e3e3e361c2384
> ] hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 332
>  
>  
>  instance Arbitrary (Sealed2 Prim) where
> -  arbitrary = makeGen aSmallRepo
> +  arbitrary = makeS2Gen aSmallRepo
>  
>  instance Arbitrary (Sealed2 (Prim :> Prim)) where
>    arbitrary = do repo <- aSmallRepo
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 345
>                   return $ seal pp
>  
>  instance Arbitrary (Sealed2 (Prim :> Prim :> Prim)) where
> -  arbitrary = makeGen aSmallRepo
> +  arbitrary = makeS2Gen aSmallRepo
>  
>  instance Arbitrary (Sealed2 (FL Prim)) where
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 348
> -  arbitrary = makeGen aSmallRepo
> +  arbitrary = makeS2Gen aSmallRepo
> +
> +instance Arbitrary (Sealed ((FL Prim) C(a))) where
> +  arbitrary = makeSGen aSmallRepo
>  
>  instance Arbitrary (Sealed2 (FL Prim :> FL Prim)) where
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 354
> -  arbitrary = makeGen aSmallRepo
> +  arbitrary = makeS2Gen aSmallRepo
>  
>  instance Arbitrary (Sealed ((FL Prim :> FL Prim) C(a))) where
>    arbitrary = makeSGen aSmallRepo
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 360
>  
>  instance Arbitrary (Sealed2 (WithState RepoModel Prim)) where
> +  arbitrary = makeWS2Gen aSmallRepo
> +
> +instance Arbitrary (Sealed (WithState RepoModel Prim C(a))) where
> +  arbitrary = makeWSGen aSmallRepo
> +
> +instance Arbitrary (Sealed (WithState RepoModel (FL Prim) C(a))) where
>    arbitrary = makeWSGen aSmallRepo
>  
>  instance Arbitrary (Sealed2 (WithState RepoModel (Prim :> Prim))) where
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 375
>  
>  
>  instance Arbitrary (Sealed2 (WithState RepoModel (FL Prim))) where
> -  arbitrary = makeWSGen aSmallRepo
> +  arbitrary = makeWS2Gen aSmallRepo
>  
>  instance Arbitrary (Sealed2 (WithState RepoModel (FL Prim :> FL Prim))) where
> hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 378
> -  arbitrary = makeWSGen aSmallRepo
> +  arbitrary = makeWS2Gen aSmallRepo
> hunk ./src/Darcs/Test/Patch/WithState.hs 110
>                                        arbitraryFL k s
>  
>  
> -makeGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2 p)
> -makeGen stGen = do s <- stGen
> -                   Sealed (WithEndState p _) <- arbitraryState s
> -                   return $ seal2 p
> +makeS2Gen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2 p)
> +makeS2Gen stGen = do s <- stGen
> +                     Sealed (WithEndState p _) <- arbitraryState s
> +                     return $ seal2 p
>  
>  makeSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed (p C(x)))
>  makeSGen stGen = do s <- stGen
> hunk ./src/Darcs/Test/Patch/WithState.hs 120
>                      Sealed (WithEndState p _) <- arbitraryState s
>                      return $ seal p
>  
> -makeWSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2 (WithState s p))
> +makeWS2Gen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2 (WithState s p))
> +makeWS2Gen stGen = do s <- stGen
> +                      Sealed (WithEndState wsP _) <- arbitraryState s
> +                      return $ seal2 wsP
> +
> +makeWSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed (WithState s p C(x)))
>  makeWSGen stGen = do s <- stGen
>                       Sealed (WithEndState wsP _) <- arbitraryState s
> hunk ./src/Darcs/Test/Patch/WithState.hs 128
> -                     return $ seal2 wsP
> +                     return $ seal wsP
> +
> +instance (Show2 p, Show1 s) => Show1 ((WithState s p) C(a)) where
> +  showDict1 = ShowDictClass
> +
> [Further restructuring of QC properties of patches.
> Petr Rockai <me@mornfall.net>**20110621141311
>  Ignore-this: 9e3d414e742a6deb6609a2c8dd71faed
> ] hunk ./src/Darcs/Test/Patch.hs 2
>  {-# OPTIONS_GHC -fno-warn-orphans #-}
> +{-# LANGUAGE ImpredicativeTypes #-}
>  --  Copyright (C) 2002-2005,2007 David Roundy
>  --
>  --  This program is free software; you can redistribute it and/or modify
> hunk ./src/Darcs/Test/Patch.hs 43
>  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
>  import Darcs.Patch.RepoPatch( RepoPatch )
>  import Darcs.Patch.Patchy ( Commute(..), Patchy )
> +import Darcs.Patch.Merge( Merge )
>  
>  import Darcs.Test.Patch.Arbitrary.Generic
>  import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> hunk ./src/Darcs/Test/Patch.hs 129
>  commuteReals :: PrimPatch prim => (RealPatch prim :> RealPatch prim) C(x y) -> Maybe ((RealPatch prim :> RealPatch prim) C(x y))
>  commuteReals = commute
>  
> +-- arbitraryThing :: (FORALL(xx yy) thing C(xx yy) -> t) -> (thing C(a b) -> t)
> +arbitraryThing :: x -> TestGenerator thing (thing x)
> +arbitraryThing _ f p = f p
> +
>  qc_prim :: forall prim C(x y a).
>             (PrimPatch prim, ArbitraryPrim prim, Show2 prim
>             , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> hunk ./src/Darcs/Test/Patch.hs 138
>             , FromPrim prim
>             , Arbitrary (Sealed ((prim :> prim) C(a)))
> +           , Arbitrary (Sealed (prim C(a)))
> +           , Arbitrary (Sealed (FL prim C(a)))
>             , Arbitrary (Sealed ((FL prim :> FL prim) C(a)))
> hunk ./src/Darcs/Test/Patch.hs 141
> -           , Show1 ((PrimOf prim :> PrimOf prim) C(a))
> +           , Show1 (prim C(a))
> +           , Show1 (WithState RepoModel prim C(a))
> +           , Arbitrary (Sealed (WithState RepoModel prim C(a)))
> +           , Arbitrary (Sealed (WithState RepoModel (FL prim) C(a)))
> +           , Show1 ((prim :> prim) C(a))
>             , Arbitrary (Sealed2 prim)
>             , Arbitrary (Sealed2 (WithState RepoModel prim))
>             , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> hunk ./src/Darcs/Test/Patch.hs 157
>             , Arbitrary (Sealed2 (FL prim :> FL prim))
>             ) => prim C(x y) -> [Test]
>  qc_prim _ =
> -  [ testProperty "Checking Prim invert symmetry..."
> -    (unseal2 $ Prop.invertSymmetry :: Sealed2 prim -> TestResult)
> -  , testProperty "Checking FL Prim invert symmetry..."
> -    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL prim) -> TestResult)
> -  , testProperty "Checking Prim invert rollback..."
> +  [ testProperty "Checking Prim invert rollback..."
>      (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel prim) -> TestResult)
>    , testProperty "Checking FL Prim invert rollback..."
>      (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL prim)) -> TestResult)
> hunk ./src/Darcs/Test/Patch.hs 181
>      --    simpleCheck (recommute
>      --                 (commute :: Prim :> Prim
>      --                          -> Maybe (Prim :> Prim)))
> -  ] ++ commute_properties (undefined :: prim C(x y)) "arbitrary" arbitraryCommutePair
> -    ++ commute_properties (undefined :: FL prim C(x y)) "arbitrary FL" arbitraryFLCommutePair
> -    where arbitraryCommutePair
> -            :: (FORALL(xx yy) (prim :> prim) C(xx yy) -> t) ->
> -               ((prim :> prim) C(a bb) -> t)
> -          arbitraryCommutePair f p = f p
> -          arbitraryFLCommutePair :: (FORALL(xx yy) (FL prim :> FL prim) C(xx yy) -> t) ->
> -                                    ((FL prim :> FL prim) C(a bb) -> t)
> -          arbitraryFLCommutePair f p = f p
> +  ] ++ concat
> +  [ commute_properties    (undefined :: prim C(x y))    "arbitrary"    arbitraryThing'
> +  , commute_properties    (undefined :: FL prim C(x y)) "arbitrary FL" arbitraryThing'
> +  , patch_properties      (undefined :: prim C(x a))    "arbitrary"    arbitraryThing'
> +  , patch_properties      (undefined :: FL prim C(x a)) "arbitrary FL" arbitraryThing'
> +  , patch_repo_properties (undefined :: prim C(x a))    "arbitrary"    arbitraryThing'
> +  , patch_repo_properties (undefined :: FL prim C(x a)) "arbitrary FL" arbitraryThing'
> +  ]
> +      where arbitraryThing' = arbitraryThing (undefined :: a) -- bind the witness for generator
>  
>  qc_V2P1 :: [Test]
>  qc_V2P1 =
> hunk ./src/Darcs/Test/Patch.hs 219
>      (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t && notDuplicatestriple t))
>      (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity commuteReals))
>  
> -  ] ++ merge_properties (undefined :: RealPatch Prim C(x y)) "tree" mergePairFromTree
> -    ++ merge_properties (undefined :: RealPatch Prim C(x y)) "twfp" mergePairFromTWFP
> -    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "tree" commutePairFromTree
> -    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "twfp" commutePairFromTWFP
> +  ] ++ concat
> +  [ merge_properties   (undefined :: RealPatch Prim C(x y)) "tree" mergePairFromTree
> +  , merge_properties   (undefined :: RealPatch Prim C(x y)) "twfp" mergePairFromTWFP
> +  , commute_properties (undefined :: RealPatch Prim C(x y)) "tree" commutePairFromTree
> +  , commute_properties (undefined :: RealPatch Prim C(x y)) "twfp" commutePairFromTWFP
> +  , patch_properties   (undefined :: RealPatch Prim C(x y)) "tree" patchFromTree
> +  ]
> +
> +type TestGenerator thing gen = (FORALL(t ctx) ((FORALL(xx yy) thing xx yy -> t) -> (gen ctx -> t)))
> +type TestCondition thing = (FORALL (yy zz) thing C(yy zz) -> Bool)
> +type TestCheck thing t = (FORALL (yy zz) thing C(yy zz) -> t)
>  
> hunk ./src/Darcs/Test/Patch.hs 231
> -commute_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf p), FromPrim p
> -                                       , Show2 p, Show2 (PrimOf p), Patchy p
> -                                       , Show1 gen, Arbitrary (Sealed gen))
> -                 => p C(x y) -> String ->
> -                    (FORALL(ctx t) ((FORALL(xx yy) (p :> p) xx yy -> t) -> (gen ctx -> t))) ->
> -                    [Test]
> +properties :: forall thing gen. (Show1 gen, Arbitrary (Sealed gen)) =>
> +              TestGenerator thing gen
> +           -- -> forall xx yy. thing xx yy
> +           -> String -> String
> +           -> forall t. Testable t => [(String, TestCondition thing, TestCheck thing t)]
> +           -> [Test]
> +properties gen prefix genname tests =
> +  [ cond name condition check | (name, condition, check) <- tests ]
> +  where cond :: forall testable. Testable testable
> +             => String -> TestCondition thing -> TestCheck thing testable -> Test
> +        cond t c p =
> +          testConditional (prefix ++ " (" ++ genname ++ "): " ++ t) (unseal $ gen c) (unseal $ gen p)
> +
> +commute_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed gen), Patchy p)
> +                   => FORALL(xx yy) p C(xx yy)
> +                   -> String
> +                   -> TestGenerator (p :> p) gen
> +                   -> [Test]
>  commute_properties _ genname gen =
> hunk ./src/Darcs/Test/Patch.hs 250
> -  [ prop "recommute" $ Prop.recommute commute
> -  , cond "nontrivial recommute" nontrivialCommute $ Prop.recommute commute
> -  , prop "inverses commute" $ Prop.commuteInverses commute
> -  , cond "nontrivial inverses" nontrivialCommute $ Prop.commuteInverses commute
> +  properties gen "commute" genname
> +  [ ("recommute"              , const True       , Prop.recommute commute             )
> +  , ("nontrivial recommute"   , nontrivialCommute, Prop.recommute commute             )
> +  , ("inverses commute"       , const True       , Prop.commuteInverses commute       )
> +  , ("nontrivial inverses"    , nontrivialCommute, Prop.commuteInverses commute       )
> +  -- XXX the following tend to fail :(
> +  -- , ("patch & inverse commute", const True       , Prop.patchAndInverseCommute commute)
> +  -- , ("patch & inverse commute", nontrivialCommute, Prop.patchAndInverseCommute commute)
>    ]
> hunk ./src/Darcs/Test/Patch.hs 259
> -  where prop :: String -> (FORALL (yy zz) (p :> p) C(yy zz) -> TestResult) -> Test
> -        prop t p = cond t (const True) p
> -        cond :: String ->
> -                (FORALL (yy zz) (p :> p) C(yy zz) -> Bool) ->
> -                (FORALL (yy zz) (p :> p) C(yy zz) -> TestResult) -> Test
> -        cond t c p =
> -          testConditional ("commute (" ++ genname ++ "): " ++ t)
> -          (unseal $ gen c) (unseal $ gen p)
>  
> hunk ./src/Darcs/Test/Patch.hs 260
> -merge_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf p), FromPrim p
> -                                      , Show2 p, Show2 (PrimOf p), RepoPatch p
> -                                      , Show1 gen, Arbitrary (Sealed gen))
> -                 => p C(x y) -> String ->
> -                    (FORALL(ctx t) ((FORALL(xx yy) (p :\/: p) xx yy -> t) -> (gen ctx -> t))) ->
> -                    [Test]
> +patch_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed gen), Patchy p)
> +                 => FORALL(xx yy) p C(xx yy)
> +                 -> String
> +                 -> TestGenerator p gen
> +                 -> [Test]
> +patch_properties _ genname gen =
> +  properties gen "patch" genname
> +  [ ("inverse . inverse is id"  , const True       , Prop.invertSymmetry)
> +  ]
> +
> +patch_repo_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed gen), Patchy p)
> +                      => FORALL(xx yy) p C(xx yy)
> +                      -> String
> +                      -> TestGenerator (WithState RepoModel p) gen
> +                      -> [Test]
> +patch_repo_properties _ genname gen =
> +  properties gen "patch/repo" genname
> +  [ ("invert rollback"          , const True       , Prop.invertRollback)
> +  ]
> +
> +merge_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed gen)
> +                                  , Patchy p, Merge p, Show2 p, Check p)
> +                 => FORALL(xx yy) p C(xx yy)
> +                 -> String
> +                 -> TestGenerator (p :\/: p) gen
> +                 -> [Test]
>  merge_properties _ genname gen =
> hunk ./src/Darcs/Test/Patch.hs 287
> -    [ prop "merge swap" Prop.tMergeSwapMerge
> -    , prop "merge either way" Prop.mergeEitherWay
> -    , prop "merge either way valid" Prop.tMergeEitherWayValid
> -    , cond "nontrivial merge either way" nontrivialMerge Prop.mergeEitherWay
> -    ]
> -  where prop :: Testable t => String -> (FORALL (yy zz) (p :\/: p) C(yy zz) -> t) -> Test
> -        prop t p = cond t (const True) p
> -        cond :: (Testable t) => String ->
> -                (FORALL (yy zz) (p :\/: p) C(yy zz) -> Bool) ->
> -                (FORALL (yy zz) (p :\/: p) C(yy zz) -> t) -> Test
> -        cond t c p =
> -          testConditional ("merge (" ++ genname ++ "): " ++ t)
> -          (unseal $ gen c) (unseal $ gen p)
> +  properties gen "merge" genname
> +  [ ("merge swap"                 , const True     , Prop.tMergeSwapMerge     )
> +  , ("merge either way"           , const True     , Prop.mergeEitherWay      )
> +  , ("merge either way valid"     , const True     , Prop.tMergeEitherWayValid)
> +  , ("nontrivial merge either way", nontrivialMerge, Prop.mergeEitherWay      )
> +  , ("merge commute"              , const True     , Prop.mergeCommute        )
> +  ]
>  
>  qc_V1P1 :: [Test]
>  qc_V1P1 =
> [Replace tCommuteRecommute with recommute from Properties.Generic.
> Petr Rockai <me@mornfall.net>**20110621142250
>  Ignore-this: 51cf667adc21f849934930499ddf60d0
> ] hunk ./src/Darcs/Test/Patch.hs 88
>    , runPrimitiveTests "Checking known canons" Prop.checkCanon Ex.knownCanons
>    , runPrimitiveTests "Checking merge swaps" Prop.checkMergeSwap Ex.mergePairs2
>    , runPrimitiveTests "Checking that the patch validation works" Prop.tTestCheck Ex.validPatches
> -  , runPrimitiveTests "Checking commute/recommute" Prop.tCommuteRecommute Ex.commutePairs
> +  , runPrimitiveTests "Checking commute/recommute" (Prop.recommute commute) Ex.commutePairs
>    , runPrimitiveTests "Checking merge properties: merge either way valid" Prop.tMergeEitherWayValid Ex.mergePairs
>    , runPrimitiveTests "Checking merge properties: merge swap" Prop.tMergeSwapMerge Ex.mergePairs
>    , runPrimitiveTests "Checking primitive patch IO functions" (Prop.tShowRead eqFLUnsafe) Ex.primitiveTestPatches
> hunk ./src/Darcs/Test/Patch.hs 94
>    , runPrimitiveTests "Checking IO functions (test patches)" (Prop.tShowRead eqFLUnsafe) Ex.testPatches
>    , runPrimitiveTests "Checking IO functions (named test patches)" (Prop.tShowRead unsafeCompare) Ex.testPatchesNamed
> -  , runPrimitiveTests "Checking primitive commute/recommute" Prop.tCommuteRecommute Ex.primitiveCommutePairs
> +  , runPrimitiveTests "Checking primitive commute/recommute" (Prop.recommute commute) Ex.primitiveCommutePairs
>    ]
>  
>  unit_V2P1 :: [Test]
> hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 116
>  -- the result gives us patch A and patch B again.  The set of patches (A,B)
>  -- is chosen from the set of all pairs of test patches by selecting those which
>  -- commute with one another.
> -commutePairs :: [(FL Patch :< FL Patch) C(x y)]
> +commutePairs :: [(FL Patch :> FL Patch) C(x y)]
>  commutePairs =
> hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 118
> -  take 200 [(p2:<p1)|
> +  take 200 [(p1:>p2)|
>              p1<-testPatches,
>              p2<-filter (\p->checkAPatch (p1:>:p:>:NilFL)) testPatches,
>              commute (p1:>p2) /= Nothing]
> hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 123
>  
> -primitiveCommutePairs :: [(FL Patch :< FL Patch) C(x y)]
> +primitiveCommutePairs :: [(FL Patch :> FL Patch) C(x y)]
>  primitiveCommutePairs =
> hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 125
> -  [(p1:<p2)|
> +  [(p2:>p1)|
>     p1<-primitiveTestPatches,
>     p2<-primitiveTestPatches,
>     commute (p2:>p1) /= Nothing,
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 6
>  module Darcs.Test.Patch.Properties.V1Set1
>         ( checkMerge, checkMergeEquiv, checkMergeSwap, checkCanon
>         , checkCommute, checkCantCommute
> -       , tCommuteRecommute, tMergeSwapMerge, tShowRead
> +       , tMergeSwapMerge, tShowRead
>         , tMergeEitherWayValid, tTestCheck ) where
>  
>  import Darcs.Patch
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 163
>            eqSwapped (x1 :/\: y1) (y2 :/\: x2) | unsafeCompare x1 x2, unsafeCompare y1 y2 = True
>            eqSwapped _ _ = False
>  
> -tCommuteRecommute :: FORALL(x y) (FL Patch :< FL Patch) C(x y) -> TestResult
> -tCommuteRecommute (p1 :< p2) =
> -    if (commute (p2:>p1) >>= commute) == Just (p2:>p1)
> -       then succeeded
> -       else failed $ text $ "Failed to recommute:\n"++(show p2)++(show p1)++
> -            "we saw it as:\n"++show (commute (p2:>p1))++
> -             "\nAnd recommute was:\n"++show (commute (p2:>p1) >>= commute)
> -             ++ "\n"
> -
>  tTestCheck :: FORALL(x y) FL Patch C(x y) -> TestResult
>  tTestCheck p = if checkAPatch p
>                   then succeeded
> [Replace tMergeSwapMerge with Properties.Generic mergeEitherWay.
> Petr Rockai <me@mornfall.net>**20110621142303
>  Ignore-this: 6c9e1def0a1773fbf3785985b3a0355f
> ] hunk ./src/Darcs/Test/Patch.hs 90
>    , runPrimitiveTests "Checking that the patch validation works" Prop.tTestCheck Ex.validPatches
>    , runPrimitiveTests "Checking commute/recommute" (Prop.recommute commute) Ex.commutePairs
>    , runPrimitiveTests "Checking merge properties: merge either way valid" Prop.tMergeEitherWayValid Ex.mergePairs
> -  , runPrimitiveTests "Checking merge properties: merge swap" Prop.tMergeSwapMerge Ex.mergePairs
> +  , runPrimitiveTests "Checking merge properties: merge swap" Prop.mergeEitherWay Ex.mergePairs
>    , runPrimitiveTests "Checking primitive patch IO functions" (Prop.tShowRead eqFLUnsafe) Ex.primitiveTestPatches
>    , runPrimitiveTests "Checking IO functions (test patches)" (Prop.tShowRead eqFLUnsafe) Ex.testPatches
>    , runPrimitiveTests "Checking IO functions (named test patches)" (Prop.tShowRead unsafeCompare) Ex.testPatchesNamed
> hunk ./src/Darcs/Test/Patch.hs 288
>                   -> [Test]
>  merge_properties _ genname gen =
>    properties gen "merge" genname
> -  [ ("merge swap"                 , const True     , Prop.tMergeSwapMerge     )
> -  , ("merge either way"           , const True     , Prop.mergeEitherWay      )
> +  [ ("merge either way"           , const True     , Prop.mergeEitherWay      )
>    , ("merge either way valid"     , const True     , Prop.tMergeEitherWayValid)
>    , ("nontrivial merge either way", nontrivialMerge, Prop.mergeEitherWay      )
>    , ("merge commute"              , const True     , Prop.mergeCommute        )
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 6
>  module Darcs.Test.Patch.Properties.V1Set1
>         ( checkMerge, checkMergeEquiv, checkMergeSwap, checkCanon
>         , checkCommute, checkCantCommute
> -       , tMergeSwapMerge, tShowRead
> +       , tShowRead
>         , tMergeEitherWayValid, tTestCheck ) where
>  
>  import Darcs.Patch
> hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 152
>                show combo1++
>                show combo2
>  
> -tMergeSwapMerge :: forall p x y. (Patchy p, Show2 p, Merge p) => (p :\/: p) C(x y) -> TestResult
> -tMergeSwapMerge (p1 :\/: p2) =
> -  if merge (p2 :\/: p1) `eqSwapped` merge (p1 :\/: p2)
> -  then succeeded
> -  else failed $ text $ "Failed to swap merges:\n"++show2 p1++"and...\n"++show2 p2
> -        ++"merged:\n"++show (merge (p1:\/:p2))++"\n"
> -        ++"merged swapped:\n"++show (merge (p2:\/: p1))++"\n"
> -    where eqSwapped :: (p :/\: p) C(x_ y_) -> (p :/\: p) C(y_ x_) -> Bool
> -          eqSwapped (x1 :/\: y1) (y2 :/\: x2) | unsafeCompare x1 x2, unsafeCompare y1 y2 = True
> -          eqSwapped _ _ = False
> -
>  tTestCheck :: FORALL(x y) FL Patch C(x y) -> TestResult
>  tTestCheck p = if checkAPatch p
>                   then succeeded
> 



> _______________________________________________
> darcs-devel mailing list
> darcs-devel@darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-devel


-- 
Eric Kow <http://erickow.com>
msg14555 (view) Author: iago Date: 2011-06-26.11:49:55
On Sun, Jun 26, 2011 at 9:54 AM, Eric Kow <bugs@darcs.net> wrote:

>
> Eric Kow <kowey@darcs.net> added the comment:
>
> Hi Iago,
>
> As you may be aware, Petr is working on GSoC project towards V3 of Darcs
> primitive patches [1].  He wants to do it in a TDD way (!), but writing
>
That's great news :-)

> all the Arbitrary instances is quite boring and involves cleaning up a
> lot of the pre-existing QC infrastructure.  Do you think you might have
> time and/or be interested in commenting on his cleanup patch?
>
Yeah, I am very interested, but I can only *promise* I will do it after July
7 :/ I was living a period of *tons of work* but (fortunately) it is
finishing now, this week should be lighter and I may have time to take a
look to his code.

Btw, after July 7 I hope to continue contributing to Darcs as well (the
testing stuff mainly).

>
> Thanks!
>
> Eric
>
> [1]
> http://web.mornfall.net/blog/soc_reloaded:_darcs_primitive_patches_version_3.html
>
> On Tue, Jun 21, 2011 at 17:46:44 +0000, Petr Ročkai wrote:
> > More test suite reworking. It does use ImpredicativeTypes, but this
> should be
> > fairly harmless (I haven't tried with anything but GHC7 yet, though). I'd
> > expect more things could be conflated (some properties are still at least
> > duplicated, if not triplicated). There are quite a few properties that
> are
> > simply commented out and something should be done about those as well
> (probably
> > removing them or maybe fixing them).
> >
> > I'll keep conflating commonalities together, although I think that reuse
> is now
> > quite good. It also shows that our property coverage is rather weak: even
> > though the original test lists were pretty long, they were more or less
> just
> > repeating themselves.
> >
> > I'll still do some final cleanups, but other than that, I am done with
> the
> > test-suite for now, on the general level. I'll write arbitrary instances
> for V3
> > Prims next and then based on that, I'll start adding properties and fill
> in the
> > V3 implementation. I expect that the properties will be reusable in other
> > contexts, with the current testsuite structure.
> >
> > Yours,
> >    Petr
> >
> > 13 patches for repository http://darcs.net:
> >
> > Sun Jun  5 23:55:12 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Merge Set2, Set2Unwitnessed and Set3Unwitnessed in
> Test.Patch.Examples.
> >
> >   Set2 have been only used to implement Set3, and not directly by any
> >   tests. Everything is internal to Set2Unwitnessed now.
> >
> > Mon Jun 20 11:06:41 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Add a Show1 instance for (:>).
> >
> > Mon Jun 20 11:06:58 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Make (V1) Prim an instance of PrimPatchBase/FromPrim.
> >
> > Mon Jun 20 11:07:18 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Remove redundant imports in Darcs.Repository.Internal.
> >
> > Mon Jun 20 11:18:10 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Reorganise the Patch tests further.
> >
> > Mon Jun 20 14:30:27 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Generalise the V1.Prim Arbitrary instance based on Tree to any
> PrimPatch.
> >
> > Mon Jun 20 14:33:54 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Generalise a bunch of merge/commute properties over the patch type &
> generator.
> >
> > Mon Jun 20 15:36:51 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Split Test.Patch.Test into Properties.Check and Arbitrary.PatchV1.
> >
> > Tue Jun 21 16:11:12 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Print detailed diagnostic in patchAndInverseCommute.
> >
> > Tue Jun 21 16:12:34 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Slightly restructure and expand the Prim Arbitrary instances.
> >
> > Tue Jun 21 16:13:11 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Further restructuring of QC properties of patches.
> >
> > Tue Jun 21 16:22:50 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Replace tCommuteRecommute with recommute from Properties.Generic.
> >
> > Tue Jun 21 16:23:03 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Replace tMergeSwapMerge with Properties.Generic mergeEitherWay.
> >
> > ----------
> > files:
> merge-set2_-set2unwitnessed-and-set3unwitnessed-in-test_patch_examples_.dpatch,
> unnamed, unnamed
> > messages: 14546
> > nosy: mornfall
> > status: needs-screening
> > title: Merge Set2, Set2Unwitnessed and Set3Unwi... (and 12 more)
> >
> > __________________________________
> > Darcs bug tracker <bugs@darcs.net>
> > <http://bugs.darcs.net/patch631>
> > __________________________________
>
> >
> > [Merge Set2, Set2Unwitnessed and Set3Unwitnessed in Test.Patch.Examples.
> > Petr Rockai <me@mornfall.net>**20110605215512
> >  Ignore-this: 8c718a43d7e780f582b91900dd7464c5
> >
> >  Set2 have been only used to implement Set3, and not directly by any
> >  tests. Everything is internal to Set2Unwitnessed now.
> > ] hunk ./src/Darcs/Test/Patch/Examples/Set2.hs 1
> > -{-# LANGUAGE CPP #-}
> > -
> > -#include "gadts.h"
> > -
> > -module Darcs.Test.Patch.Examples.Set2
> > -    ( mergeExamples, commuteExamples, tripleExamples
> > -    , realPatchLoopExamples
> > -    )
> > -    where
> > -
> > -import Darcs.Patch.Invert ( Invert )
> > -import Darcs.Patch.Merge ( Merge )
> > -import Darcs.Patch.Prim ( PrimPatchBase(..), FromPrim )
> > -import Darcs.Patch.Prim.V1.Core ( Prim(FP), FilePatchType(Hunk) )
> > -import Darcs.Patch.FileName ( FileName, fp2fn )
> > -
> > -import Darcs.Witnesses.Ordered ( (:>), (:\/:) )
> > -import Darcs.Witnesses.Sealed ( Sealed(..), Sealed2, seal2, unseal2 )
> > -
> > -import qualified Data.ByteString as B ( ByteString )
> > -import qualified Data.ByteString.Char8 as BC ( pack )
> > -
> > -import Darcs.Test.Patch.RepoModel ( RepoModel, Content
> > -                                   , makeRepo, makeName, makeFile)
> > -import Darcs.Test.Patch.WithState ( WithStartState(..) )
> > -
> > -import Darcs.Test.Patch.Arbitrary.Generic
> > -    ( Tree(..)
> > -    , TreeWithFlattenPos(..)
> > -    , commutePairFromTree, commuteTripleFromTree
> > -    , mergePairFromCommutePair, commutePairFromTWFP
> > -    , canonizeTree
> > -    )
> > -import Darcs.Test.Patch.Arbitrary.PrimV1 () -- instances
> > -
> > -
> > -
> > -makeSimpleRepo :: String -> Content -> RepoModel C(x)
> > -makeSimpleRepo filename content = makeRepo [(makeName filename, makeFile
> content)]
> > -
> > -
> > -tripleExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p,
> PrimOf p ~ Prim) => [Sealed2 (p :> p :> p)]
> > -tripleExamples = [commuteTripleFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "g"]))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "j"]))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"])) NilTree)))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "e"])) NilTree))
> > -                  ,commuteTripleFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack "j"])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"]))
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > -                  ]
> > -
> > -
> > -mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf
> p ~ Prim) => [Sealed2 (p :\/: p)]
> > -mergeExamples = map (unseal2 (mergePairFromCommutePair seal2))
> commuteExamples
> > -
> > -commuteExamples :: (FromPrim p, Merge p, PrimPatchBase p, PrimOf p ~
> Prim) => [Sealed2 (p :> p)]
> > -commuteExamples = [
> > -                   commutePairFromTWFP seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [])
> > -                   (TWFP 3
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "b"]))
> > -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"]))
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"]))
> > -                           (SeqTree (FP (fp2fn "./file") (Hunk 2
> [BC.pack "f"] [])) NilTree)))))),
> > -                   commutePairFromTWFP seal2 $
> > -                   WithStartState
> > -                   (makeSimpleRepo "file" [BC.pack "f",BC.pack
> "s",BC.pack "d"])
> > -                   (TWFP 3
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "d"]
> [])) NilTree)
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] [])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "s",BC.pack "d"] []))
> > -                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"])) NilTree)))))),
> > -{-                   commutePairFromTWFP seal2 $
> > -                   WithStartState
> > -                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "u",
> > -                                            BC.pack "s",BC.pack "d"])
> > -                   (TWFP 5
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 5 [] [BC.pack
> "x"]))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack
> "d"] [])) NilTree))
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "u"] [])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > -                       (SeqTree (FP(fp2fn "./file") (Hunk 1 [BC.pack
> "u",BC.pack "s",BC.pack "d"] []))
> > -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "a"]))
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "a"] [])) NilTree))))))),-}
> > -                   commutePairFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack
> "n",BC.pack "t",BC.pack "h"])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "n",BC.pack "t",BC.pack "h"] []))
> > -                     NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "h"]
> []))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n"]
> []))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t"] [])) NilTree)))),
> > -                  commutePairFromTree seal2 $
> > -                  WithStartState (makeSimpleRepo "file" [])
> > -                  (ParTree
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "n"])) NilTree)
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "i"]))
> > -                                (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "i"])) NilTree))),
> > -                  commutePairFromTree seal2 $
> > -                  WithStartState (makeSimpleRepo "file" [])
> > -                  (ParTree
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"]))
> > -                     (ParTree
> > -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "c"] [BC.pack "r"])) NilTree)
> > -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "d"])) NilTree))))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)),
> > -                  commutePairFromTWFP seal2 $
> > -                  WithStartState (makeSimpleRepo "file" [])
> > -                  (TWFP 1
> > -                  (ParTree
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree))),
> > -                   commutePairFromTWFP seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack
> "f",BC.pack " r",
> > -                                                            BC.pack
> "c",BC.pack "v"])
> > -                   (TWFP 4
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack
> "c",BC.pack "v"] []))
> > -                        (ParTree
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "r"] []))
> > -                          (SeqTree (FP (fp2fn "fi le") (Hunk 1 [BC.pack
> "f"] [])) NilTree))
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "r"] []))
> > -                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "y"])) NilTree))))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "v"]
> [])) NilTree))),
> > -                   commutePairFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree)
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "r"])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "d"])) NilTree))))
> > -                 , commutePairFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack
> "t",BC.pack "r",BC.pack "h"])
> > -                   (ParTree
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t",BC.pack "r",BC.pack "h"] []))
> > -                              NilTree)
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "o"])) NilTree))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"]
> []))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "h"]
> [])) NilTree)))
> > -                 , commutePairFromTWFP seal2 $
> > -                   WithStartState (makeSimpleRepo "file" []) $
> > -                   TWFP 2
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "y"]))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "m"]))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "p"]))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "p"]
> []))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"])) NilTree)))
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree)
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree)))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [BC.pack
> "x",BC.pack "c"])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c"]
> [])) NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "x"]
> []))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "j"])) NilTree))))
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "l"])) NilTree))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "s"))) NilTree)
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "k")))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "k") []))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "m")))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "m") [])) NilTree)))))
> > -                 ]
> > -
> > -packStringLetters :: String -> [B.ByteString]
> > -packStringLetters = map (BC.pack . (:[]))
> > -
> > -realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> > -realPatchLoopExamples =
> > -    [Sealed (WithStartState (makeSimpleRepo fx_name [])
> > -     $ canonizeTree
> > -     (ParTree
> > -      (SeqTree (FP fx (Hunk 1 [] (packStringLetters
> "pkotufogbvdabnmbzajvolwviqebieonxvcvuvigkfgybmqhzuaaurjspd")))
> > -       (ParTree
> > -        (SeqTree (FP fx (Hunk 47 (packStringLetters "qhzu")
> (packStringLetters "zafybdcokyjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmh")))
> > -         (ParTree
> > -          (ParTree
> > -           NilTree
> > -           (ParTree
> > -            (ParTree
> > -             (ParTree
> > -              (SeqTree (FP fx (Hunk 15 (packStringLetters
> "mbzajvolwviqebieonxvcvuvigkfgyb") (packStringLetters
> "vujnxnhvybvpouyciaabszfmgssezlwwjgnethvrpnfrkubphzvdgymjjoacppqps")))
> > -               (ParTree
> > -                NilTree
> > -                (ParTree
> > -                 (SeqTree (FP fx (Hunk 40 (packStringLetters
> "ssezlwwjgnethvrpnfrkubphzvdgymjjoacppqpsmzafybdcokyjskcgnvhkbz")
> (packStringLetters "wnesidpccwoiqiichxaaejdsyrhrusqljlcoro")))
> > -                  (ParTree
> > -                   (ParTree
> > -                    (SeqTree (FP fx (Hunk 12 (packStringLetters
> "abnvujnxnhvybvpouyciaabszfmgwnesidpccwoiqii") (packStringLetters
> "czfdhqkipdstfjycqaxwnbxrihrufdeyneqiiiafwzlmg"))) NilTree)
> > -                    NilTree)
> > -                   NilTree))
> > -                 (SeqTree (FP fx (Hunk 25 [] (packStringLetters
> "dihgmsotezucqdgxczvcivijootyvhlwymbiueufnvpwpeukmskqllalfe"))) NilTree))))
> > -              (SeqTree (FP fx (Hunk 56 (packStringLetters
> "yjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmhaaurjsp") (packStringLetters
> "xldhrutyhcyaqeezwujiguawfyawjjqlirxshjddvq"))) NilTree))
> > -             (SeqTree (FP fx (Hunk 20 [] (packStringLetters
> "ooygwiyogqrqnytixqtmvdxx")))
> > -              (SeqTree (FP fx (Hunk 26 (packStringLetters
> "yogqrqnytixqtmvdxxvolwviqebieonxvcvuvigkfgybmzafybdcokyjskcgnvhkbz")
> (packStringLetters "akhsmlbkdxnvfoikmiatfbpzdrsyykkpoxvvddeaspzxe")))
> > -               (SeqTree (FP fx (Hunk 39 [] (packStringLetters "ji")))
> > -                (ParTree
> > -                 NilTree
> > -                 (ParTree
> > -                  NilTree
> > -                  (ParTree
> > -                   (ParTree
> > -                    NilTree
> > -                    (SeqTree (FP fx (Hunk 26 (packStringLetters
> "akhsmlbkdxnvfjioikmiatfbpzdrsyykkpoxvvddeaspzxepysaafnjjhcstgrczplxs")
> (packStringLetters "onjbhddskcj")))
> > -                     (SeqTree (FP fx (Hunk 39 [] (packStringLetters
> "fyscunxxxjjtyqpfxeznhtwvlphmp"))) NilTree)))
> > -                   (ParTree
> > -                    NilTree
> > -                    (SeqTree (FP fx (Hunk 44 [] (packStringLetters
> "xcchzwmzoezxkmkhcmesplnjpqriypshgiqklgdnbmmkldnydiy")))
> > -                     (ParTree
> > -                      NilTree
> > -                      (SeqTree (FP fx (Hunk 64 (packStringLetters
> "plnjpqriypshgiqklgdnbmmkldnydiymiatfbpzdrsyykkpoxvvddeaspzxepysaafn")
> (packStringLetters "anjlzfdqbjqbcplvqvkhwjtkigp"))) NilTree)))))))))))
> > -            (ParTree
> > -             NilTree
> > -             NilTree)))
> > -          NilTree))
> > -        NilTree))
> > -      (ParTree
> > -       NilTree
> > -       (SeqTree (FP fx (Hunk 1 [] (packStringLetters "ti")))
> > -        (SeqTree (FP fx (Hunk 1 (packStringLetters "t")
> (packStringLetters "ybcop")))
> > -         (SeqTree (FP fx (Hunk 2 [] (packStringLetters
> "dvlhgwqlpaeweerqrhnjtfolczbqbzoccnvdsyqiefqitrqneralf")))
> > -          (SeqTree (FP fx (Hunk 15 [] (packStringLetters
> "yairbjphwtnaerccdlfewujvjvmjakbc")))
> > -           (SeqTree (FP fx (Hunk 51 [] (packStringLetters
> "xayvfuwaiiogginufnhsrmktpmlbvxiakjwllddkiyofyfw")))
> > -            (ParTree
> > -             NilTree
> > -             NilTree)))))))))]
> > -  where
> > -      fx_name :: String
> > -      fx_name = "F"
> > -
> > -      fx :: FileName
> > -      fx = fp2fn "./F"
> > -
> > rmfile ./src/Darcs/Test/Patch/Examples/Set2.hs
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 1
> > -module Darcs.Test.Patch.Examples.Set2Unwitnessed where
> > -
> > -import qualified Darcs.Test.Patch.Examples.Set2 as W
> > -     ( mergeExamples, commuteExamples, tripleExamples
> > -     , realPatchLoopExamples
> > -     )
> > -import Darcs.Test.Patch.RepoModel ( RepoModel )
> > -import Darcs.Test.Patch.WithState ( WithStartState )
> > -import Darcs.Test.Patch.WSub
> > -import Darcs.Test.Patch.Arbitrary.Generic ( Tree )
> > -
> > -import Darcs.Witnesses.Sealed
> > -
> > -import Darcs.Patch.Prim.V1 ( Prim )
> > -import Darcs.Patch.V2 ( RealPatch )
> > -
> > -mergeExamples :: [Sealed2 (RealPatch Prim :\/: RealPatch Prim)]
> > -mergeExamples = map (mapSeal2 fromW) W.mergeExamples
> > -
> > -realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> > -realPatchLoopExamples = W.realPatchLoopExamples
> > -
> > -commuteExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim)]
> > -commuteExamples = map (mapSeal2 fromW) W.commuteExamples
> > -
> > -tripleExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim :>
> RealPatch Prim)]
> > -tripleExamples = map (mapSeal2 fromW) W.tripleExamples
> > -
> > rmfile ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs
> > move ./src/Darcs/Test/Patch/Examples/Set3Unwitnessed.hs
> ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs
> > hunk ./darcs.cabal 606
> >      other-modules:    Darcs.Test.Email
> >                        Darcs.Test.Patch.Check
> >                        Darcs.Test.Patch.Examples.Set1
> > -                      Darcs.Test.Patch.Examples.Set2
> >                        Darcs.Test.Patch.Examples.Set2Unwitnessed
> > hunk ./darcs.cabal 607
> > -                      Darcs.Test.Patch.Examples.Set3Unwitnessed
> >                        Darcs.Test.Patch.WSub
> >                        Darcs.Test.Patch.Info
> >                        Darcs.Test.Patch.Properties.V1Set1
> > hunk ./src/Darcs/Test/Patch.hs 46
> >  import qualified Darcs.Test.Patch.Info
> >
> >  import qualified Darcs.Test.Patch.Examples.Set1 as Ex
> > +import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
> > +
> >  import qualified Darcs.Test.Patch.Properties.V1Set1 as Prop
> >  import qualified Darcs.Test.Patch.Properties.V1Set2 as Prop
> >  import qualified Darcs.Test.Patch.Properties.Generic as Prop
> > hunk ./src/Darcs/Test/Patch.hs 52
> >  import qualified Darcs.Test.Patch.Properties.Real as Prop
> > -
> > -import qualified Darcs.Test.Patch.WSub as WSub
> > -import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
> > -import qualified Darcs.Test.Patch.Examples.Set3Unwitnessed as ExU
> >  import qualified Darcs.Test.Patch.Properties.GenericUnwitnessed as PropU
> >
> > hunk ./src/Darcs/Test/Patch.hs 54
> > +import qualified Darcs.Test.Patch.WSub as WSub
> >  import Darcs.Test.Patch.Arbitrary.PrimV1
> >
> >  #include "gadts.h"
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 23
> >
> >  #include "gadts.h"
> >
> > -module Darcs.Test.Patch.Examples.Set3Unwitnessed
> > +module Darcs.Test.Patch.Examples.Set2Unwitnessed
> >         ( primPermutables, primPatches
> >         , commutables, commutablesFL
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 26
> > -       , realCommutables , realMergeables, realTriples,
> realNonduplicateTriples, realPatches
> > +       , realCommutables , realMergeables, realTriples
> > +       , realNonduplicateTriples, realPatches, realPatchLoopExamples
> >         ) where
> >
> >  import Data.Maybe ( catMaybes )
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 40
> >  import Darcs.Patch.V2 ( RealPatch )
> >  import Darcs.Patch.V2.Real ( prim2real )
> >  -- import Darcs.Test.Patch.Test () -- for instance Eq Patch
> > -import Darcs.Test.Patch.Examples.Set2Unwitnessed
> > +-- import Darcs.Test.Patch.Examples.Set2Unwitnessed
> >  import Darcs.Witnesses.Unsafe ( unsafeCoerceP )
> >  import qualified Darcs.Test.Patch.Arbitrary.Real as W (
> notDuplicatestriple )
> >  --import Printer ( greenText )
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 49
> >  import Darcs.ColorPrinter () -- for instance Show Doc
> >  import Darcs.Test.Patch.WSub
> >
> > +import qualified Darcs.Witnesses.Ordered as W ( (:>), (:\/:) )
> > +import qualified Data.ByteString as B ( ByteString )
> > +import Darcs.Test.Patch.RepoModel ( RepoModel, Content
> > +                                   , makeRepo, makeName, makeFile)
> > +import Darcs.Test.Patch.WithState ( WithStartState(..) )
> > +import Darcs.Patch.Prim.V1.Core ( Prim(FP), FilePatchType(Hunk) )
> > +import Darcs.Patch.FileName ( FileName, fp2fn )
> > +import Darcs.Patch.Prim ( PrimPatchBase(..), FromPrim )
> > +import Darcs.Patch.Merge ( Merge )
> > +import Darcs.Test.Patch.Arbitrary.Generic
> > +    ( Tree(..)
> > +    , TreeWithFlattenPos(..)
> > +    , commutePairFromTree, commuteTripleFromTree
> > +    , mergePairFromCommutePair, commutePairFromTWFP
> > +    , canonizeTree
> > +    )
> > +
> >  -- import Debug.Trace
> >  -- #include "impossible.h"
> >
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 69
> > +makeSimpleRepo :: String -> Content -> RepoModel C(x)
> > +makeSimpleRepo filename content = makeRepo [(makeName filename, makeFile
> content)]
> > +
> > +
> > +w_tripleExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p,
> PrimOf p ~ Prim) => [Sealed2 (p W.:> p W.:> p)]
> > +w_tripleExamples = [commuteTripleFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "g"]))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "j"]))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"])) NilTree)))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "e"])) NilTree))
> > +                  ,commuteTripleFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack "j"])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"]))
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > +                  ]
> > +
> > +
> > +w_mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p,
> PrimOf p ~ Prim) => [Sealed2 (p W.:\/: p)]
> > +w_mergeExamples = map (unseal2 (mergePairFromCommutePair seal2))
> w_commuteExamples
> > +
> > +w_commuteExamples :: (FromPrim p, Merge p, PrimPatchBase p, PrimOf p ~
> Prim) => [Sealed2 (p W.:> p)]
> > +w_commuteExamples = [
> > +                   commutePairFromTWFP seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [])
> > +                   (TWFP 3
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "b"]))
> > +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"]))
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"]))
> > +                           (SeqTree (FP (fp2fn "./file") (Hunk 2
> [BC.pack "f"] [])) NilTree)))))),
> > +                   commutePairFromTWFP seal2 $
> > +                   WithStartState
> > +                   (makeSimpleRepo "file" [BC.pack "f",BC.pack
> "s",BC.pack "d"])
> > +                   (TWFP 3
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "d"]
> [])) NilTree)
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] [])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "s",BC.pack "d"] []))
> > +                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"])) NilTree)))))),
> > +{-                   commutePairFromTWFP seal2 $
> > +                   WithStartState
> > +                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "u",
> > +                                            BC.pack "s",BC.pack "d"])
> > +                   (TWFP 5
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 5 [] [BC.pack
> "x"]))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack
> "d"] [])) NilTree))
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "u"] [])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > +                       (SeqTree (FP(fp2fn "./file") (Hunk 1 [BC.pack
> "u",BC.pack "s",BC.pack "d"] []))
> > +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "a"]))
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "a"] [])) NilTree))))))),-}
> > +                   commutePairFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack
> "n",BC.pack "t",BC.pack "h"])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "n",BC.pack "t",BC.pack "h"] []))
> > +                     NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "h"]
> []))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n"]
> []))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t"] [])) NilTree)))),
> > +                  commutePairFromTree seal2 $
> > +                  WithStartState (makeSimpleRepo "file" [])
> > +                  (ParTree
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "n"])) NilTree)
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "i"]))
> > +                                (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "i"])) NilTree))),
> > +                  commutePairFromTree seal2 $
> > +                  WithStartState (makeSimpleRepo "file" [])
> > +                  (ParTree
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"]))
> > +                     (ParTree
> > +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "c"] [BC.pack "r"])) NilTree)
> > +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "d"])) NilTree))))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)),
> > +                  commutePairFromTWFP seal2 $
> > +                  WithStartState (makeSimpleRepo "file" [])
> > +                  (TWFP 1
> > +                  (ParTree
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree))),
> > +                   commutePairFromTWFP seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack
> "f",BC.pack " r",
> > +                                                            BC.pack
> "c",BC.pack "v"])
> > +                   (TWFP 4
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack
> "c",BC.pack "v"] []))
> > +                        (ParTree
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "r"] []))
> > +                          (SeqTree (FP (fp2fn "fi le") (Hunk 1 [BC.pack
> "f"] [])) NilTree))
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "r"] []))
> > +                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "y"])) NilTree))))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "v"]
> [])) NilTree))),
> > +                   commutePairFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree)
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "r"])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "d"])) NilTree))))
> > +                 , commutePairFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack
> "t",BC.pack "r",BC.pack "h"])
> > +                   (ParTree
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t",BC.pack "r",BC.pack "h"] []))
> > +                              NilTree)
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "o"])) NilTree))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"]
> []))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "h"]
> [])) NilTree)))
> > +                 , commutePairFromTWFP seal2 $
> > +                   WithStartState (makeSimpleRepo "file" []) $
> > +                   TWFP 2
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "y"]))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "m"]))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "p"]))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "p"]
> []))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"])) NilTree)))
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree)
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree)))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [BC.pack
> "x",BC.pack "c"])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c"]
> [])) NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "x"]
> []))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "j"])) NilTree))))
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "l"])) NilTree))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "s"))) NilTree)
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "k")))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "k") []))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "m")))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "m") [])) NilTree)))))
> > +                 ]
> > +
> > +packStringLetters :: String -> [B.ByteString]
> > +packStringLetters = map (BC.pack . (:[]))
> > +
> > +w_realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree
> Prim))]
> > +w_realPatchLoopExamples =
> > +    [Sealed (WithStartState (makeSimpleRepo fx_name [])
> > +     $ canonizeTree
> > +     (ParTree
> > +      (SeqTree (FP fx (Hunk 1 [] (packStringLetters
> "pkotufogbvdabnmbzajvolwviqebieonxvcvuvigkfgybmqhzuaaurjspd")))
> > +       (ParTree
> > +        (SeqTree (FP fx (Hunk 47 (packStringLetters "qhzu")
> (packStringLetters "zafybdcokyjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmh")))
> > +         (ParTree
> > +          (ParTree
> > +           NilTree
> > +           (ParTree
> > +            (ParTree
> > +             (ParTree
> > +              (SeqTree (FP fx (Hunk 15 (packStringLetters
> "mbzajvolwviqebieonxvcvuvigkfgyb") (packStringLetters
> "vujnxnhvybvpouyciaabszfmgssezlwwjgnethvrpnfrkubphzvdgymjjoacppqps")))
> > +               (ParTree
> > +                NilTree
> > +                (ParTree
> > +                 (SeqTree (FP fx (Hunk 40 (packStringLetters
> "ssezlwwjgnethvrpnfrkubphzvdgymjjoacppqpsmzafybdcokyjskcgnvhkbz")
> (packStringLetters "wnesidpccwoiqiichxaaejdsyrhrusqljlcoro")))
> > +                  (ParTree
> > +                   (ParTree
> > +                    (SeqTree (FP fx (Hunk 12 (packStringLetters
> "abnvujnxnhvybvpouyciaabszfmgwnesidpccwoiqii") (packStringLetters
> "czfdhqkipdstfjycqaxwnbxrihrufdeyneqiiiafwzlmg"))) NilTree)
> > +                    NilTree)
> > +                   NilTree))
> > +                 (SeqTree (FP fx (Hunk 25 [] (packStringLetters
> "dihgmsotezucqdgxczvcivijootyvhlwymbiueufnvpwpeukmskqllalfe"))) NilTree))))
> > +              (SeqTree (FP fx (Hunk 56 (packStringLetters
> "yjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmhaaurjsp") (packStringLetters
> "xldhrutyhcyaqeezwujiguawfyawjjqlirxshjddvq"))) NilTree))
> > +             (SeqTree (FP fx (Hunk 20 [] (packStringLetters
> "ooygwiyogqrqnytixqtmvdxx")))
> > +              (SeqTree (FP fx (Hunk 26 (packStringLetters
> "yogqrqnytixqtmvdxxvolwviqebieonxvcvuvigkfgybmzafybdcokyjskcgnvhkbz")
> (packStringLetters "akhsmlbkdxnvfoikmiatfbpzdrsyykkpoxvvddeaspzxe")))
> > +               (SeqTree (FP fx (Hunk 39 [] (packStringLetters "ji")))
> > +                (ParTree
> > +                 NilTree
> > +                 (ParTree
> > +                  NilTree
> > +                  (ParTree
> > +                   (ParTree
> > +                    NilTree
> > +                    (SeqTree (FP fx (Hunk 26 (packStringLetters
> "akhsmlbkdxnvfjioikmiatfbpzdrsyykkpoxvvddeaspzxepysaafnjjhcstgrczplxs")
> (packStringLetters "onjbhddskcj")))
> > +                     (SeqTree (FP fx (Hunk 39 [] (packStringLetters
> "fyscunxxxjjtyqpfxeznhtwvlphmp"))) NilTree)))
> > +                   (ParTree
> > +                    NilTree
> > +                    (SeqTree (FP fx (Hunk 44 [] (packStringLetters
> "xcchzwmzoezxkmkhcmesplnjpqriypshgiqklgdnbmmkldnydiy")))
> > +                     (ParTree
> > +                      NilTree
> > +                      (SeqTree (FP fx (Hunk 64 (packStringLetters
> "plnjpqriypshgiqklgdnbmmkldnydiymiatfbpzdrsyykkpoxvvddeaspzxepysaafn")
> (packStringLetters "anjlzfdqbjqbcplvqvkhwjtkigp"))) NilTree)))))))))))
> > +            (ParTree
> > +             NilTree
> > +             NilTree)))
> > +          NilTree))
> > +        NilTree))
> > +      (ParTree
> > +       NilTree
> > +       (SeqTree (FP fx (Hunk 1 [] (packStringLetters "ti")))
> > +        (SeqTree (FP fx (Hunk 1 (packStringLetters "t")
> (packStringLetters "ybcop")))
> > +         (SeqTree (FP fx (Hunk 2 [] (packStringLetters
> "dvlhgwqlpaeweerqrhnjtfolczbqbzoccnvdsyqiefqitrqneralf")))
> > +          (SeqTree (FP fx (Hunk 15 [] (packStringLetters
> "yairbjphwtnaerccdlfewujvjvmjakbc")))
> > +           (SeqTree (FP fx (Hunk 51 [] (packStringLetters
> "xayvfuwaiiogginufnhsrmktpmlbvxiakjwllddkiyofyfw")))
> > +            (ParTree
> > +             NilTree
> > +             NilTree)))))))))]
> > +  where
> > +      fx_name :: String
> > +      fx_name = "F"
> > +
> > +      fx :: FileName
> > +      fx = fp2fn "./F"
> > +
> > +
> > +mergeExamples :: [Sealed2 (RealPatch Prim :\/: RealPatch Prim)]
> > +mergeExamples = map (mapSeal2 fromW) w_mergeExamples
> > +
> > +realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> > +realPatchLoopExamples = w_realPatchLoopExamples
> > +
> > +commuteExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim)]
> > +commuteExamples = map (mapSeal2 fromW) w_commuteExamples
> > +
> > +tripleExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim :>
> RealPatch Prim)]
> > +tripleExamples = map (mapSeal2 fromW) w_tripleExamples
> > +
> >  notDuplicatestriple :: (RealPatch Prim :> RealPatch Prim :> RealPatch
> Prim) C(x y) -> Bool
> >  notDuplicatestriple = W.notDuplicatestriple . toW
> >
> > hunk ./src/Darcs/Test/Patch/WSub.hs 5
> >  module Darcs.Test.Patch.WSub where
> >
> >  {-
> > -The Examples.Set3 module builds a lot of test cases by pattern matching
> > +The Examples.Set2Unwitnessed module builds a lot of test cases by
> pattern matching
> >  on the results of merge/commute in where clauses. This would
> >  be very painful to switch to using witnesses properly, because
> >  we'd have to make them use case in series.
> > [Add a Show1 instance for (:>).
> > Petr Rockai <me@mornfall.net>**20110620090641
> >  Ignore-this: f601c659c5a078eb1a337ff74e47d0dd
> > ] hunk ./src/Darcs/Witnesses/Ordered.hs 110
> >  instance Show2 a => Show2 (RL a) where
> >     showDict2 = ShowDictClass
> >
> > +instance (Show2 a, Show2 b) => Show1 ((a :> b) C(x)) where
> > +   showDict1 = ShowDictClass
> > +
> >  -- reverse list
> >  data RL a C(x z) where
> >      (:<:) :: a C(y z) -> RL a C(x y) -> RL a C(x z)
> > [Make (V1) Prim an instance of PrimPatchBase/FromPrim.
> > Petr Rockai <me@mornfall.net>**20110620090658
> >  Ignore-this: 2534da30774aac84a09342c3fbcda80e
> > ] hunk ./src/Darcs/Patch/Prim/V1.hs 12
> >  import Darcs.Patch.Prim.V1.Read ()
> >  import Darcs.Patch.Prim.V1.Show ()
> >
> > -import Darcs.Patch.Prim.Class ( PrimPatch )
> > +import Darcs.Patch.Prim.Class ( PrimPatch, PrimPatchBase(..),
> FromPrim(..) )
> >  import Darcs.Patch.Patchy ( Patchy )
> >
> >  instance PrimPatch Prim
> > hunk ./src/Darcs/Patch/Prim/V1.hs 17
> >  instance Patchy Prim
> > +instance PrimPatchBase Prim where
> > +  type PrimOf Prim = Prim
> > +
> > +instance FromPrim Prim where
> > +  fromPrim = id
> > [Remove redundant imports in Darcs.Repository.Internal.
> > Petr Rockai <me@mornfall.net>**20110620090718
> >  Ignore-this: 85333a422e8c83d6b8080dfde97aee1
> > ] hunk ./src/Darcs/Patch/Prim/V1/Details.hs 11
> >  import Darcs.Patch.Prim.V1.Core
> >      ( Prim(..), FilePatchType(..), DirPatchType(..) )
> >  import Darcs.Patch.SummaryData ( SummDetail(..), SummOp(..) )
> > -import Darcs.Patch.TokenReplace ( tryTokInternal )
> > -import Darcs.Patch.FileName ( fn2fp, fp2fn, movedirfilename, fn2ps )
> > -
> > -import qualified Data.ByteString as B ( ByteString, concat )
> > -import qualified Data.ByteString.Char8 as BC ( pack, split )
> > -import Data.Maybe ( catMaybes )
> >
> >  #include "gadts.h"
> >
> > hunk ./src/Darcs/Repository/Internal.hs 71
> >                                   writeProblem, readProblem,
> readfromAndWritetoProblem )
> >  import System.Directory ( doesDirectoryExist, setCurrentDirectory,
> >                            createDirectoryIfMissing, doesFileExist )
> > -import Control.Monad ( liftM, when, unless, filterM )
> > +import Control.Monad ( when, unless, filterM )
> >  import Control.Applicative ( (<$>) )
> >  import Workaround ( getCurrentDirectory, renameFile, setExecutable )
> >
> > hunk ./src/Darcs/Repository/Internal.hs 90
> >  import Darcs.Patch.Inspect ( PatchInspect )
> >  import Darcs.Patch.Prim ( PrimPatchBase, PrimOf, tryShrinkingInverse,
> PrimPatch )
> >  import Darcs.Patch.Bundle ( scanBundle, makeBundleN )
> > -import Darcs.Patch.PatchInfoAnd ( PatchInfoAnd, info,
> > -                         hopefully, hopefullyM )
> > +import Darcs.Patch.PatchInfoAnd ( PatchInfoAnd, hopefully )
> >  import qualified Darcs.Repository.HashedRepo as HashedRepo
> >                              ( revertTentativeChanges,
> finalizeTentativeChanges,
> >                                removeFromTentativeInventory,
> > hunk ./src/Darcs/Repository/Internal.hs 110
> >  import Darcs.Witnesses.Unsafe ( unsafeCoerceP, unsafeCoercePStart )
> >  import Darcs.Witnesses.Ordered ( FL(..), RL(..),
> >                               (:\/:)(..), (:/\:)(..), (:>)(..),
> > -                             (+>+), lengthFL, dropWhileFL,
> > +                             (+>+), lengthFL,
> >                               allFL, filterFLFL,
> >                               reverseFL, mapFL_FL, concatFL )
> >  import Darcs.Patch ( RepoPatch, Patchy, merge,
> > hunk ./src/Darcs/Repository/Internal.hs 115
> >                       listConflictedFiles, listTouchedFiles,
> > -                     Named, patchcontents,
> > +                     Named,
> >                       commuteRL, fromPrims,
> >                       readPatch,
> >                       effect, invert,
> > hunk ./src/Darcs/Repository/Internal.hs 124
> >                       apply, applyToTree,
> >                     )
> >  import Darcs.Patch.Permutations ( commuteWhatWeCanFL, removeFL )
> > -import Darcs.Patch.Info ( PatchInfo )
> >  import Darcs.Patch.Set ( PatchSet(..), SealedPatchSet, newset2FL )
> >  #ifdef GADT_WITNESSES
> >  import Darcs.Patch.Set ( Origin )
> > [Reorganise the Patch tests further.
> > Petr Rockai <me@mornfall.net>**20110620091810
> >  Ignore-this: b9bc5870d025d29d9d3d2dbd0fe950ad
> > ] hunk ./src/Darcs/Test/Patch.hs 24
> >  import Test.Framework ( Test, testGroup )
> >  import Test.Framework.Providers.HUnit ( testCase )
> >  import Test.Framework.Providers.QuickCheck2 ( testProperty )
> > +import Test.QuickCheck.Arbitrary( Arbitrary )
> >  import Test.HUnit ( assertBool )
> >
> >  import Darcs.Test.Util.TestResult ( TestResult, isOk, fromMaybe )
> > hunk ./src/Darcs/Test/Patch.hs 33
> >  import Darcs.Witnesses.Ordered
> >  import Darcs.Witnesses.Sealed
> >  import Darcs.Witnesses.Eq ( unsafeCompare )
> > -import Darcs.Patch.Prim( PrimPatch, join )
> > +import Darcs.Witnesses.Show
> > +import Darcs.Patch.Prim( PrimPatch, join, FromPrim, PrimOf,
> PrimPatchBase )
> >  import Darcs.Patch.Prim.V1 ( Prim )
> >  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
> >  import Darcs.Patch.Patchy ( Commute(..) )
> > hunk ./src/Darcs/Test/Patch.hs 39
> >
> > -import Darcs.Test.Patch.Arbitrary.Generic( Tree )
> > +import Darcs.Test.Patch.Arbitrary.Generic
> > +import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> > +import Darcs.Test.Patch.Test( Check(..) )
> >  import Darcs.Test.Patch.Arbitrary.Real
> >  import Darcs.Test.Patch.Arbitrary.PrimV1 ()
> >  import Darcs.Test.Patch.RepoModel( RepoModel )
> > hunk ./src/Darcs/Test/Patch.hs 59
> >  import qualified Darcs.Test.Patch.Properties.GenericUnwitnessed as PropU
> >
> >  import qualified Darcs.Test.Patch.WSub as WSub
> > -import Darcs.Test.Patch.Arbitrary.PrimV1
> >
> >  #include "gadts.h"
> >
> > hunk ./src/Darcs/Test/Patch.hs 72
> >      where assertName = "Boolean assertion for \"" ++ name ++ "\""
> >            res        = and $ map (isOk . test) datas
> >
> > -patchExampleTests :: [Test]
> > -patchExampleTests =
> > +unit_V1P1:: [Test]
> > +unit_V1P1 =
> >    [ runPrimitiveTests "Checking known commutes" Prop.checkCommute
> Ex.knownCommutes
> >    , runPrimitiveTests "Checking known non-commutes"
> Prop.checkCantCommute Ex.knownCantCommutes
> >    , runPrimitiveTests "Checking known merges" Prop.checkMerge
> Ex.knownMerges
> > hunk ./src/Darcs/Test/Patch.hs 90
> >    , runPrimitiveTests "Checking primitive commute/recommute"
> Prop.tCommuteRecommute Ex.primitiveCommutePairs
> >    ]
> >
> > --- | The unit tests defined about patches
> > -patchUnitTests :: [Test]
> > -patchUnitTests =
> > +unit_V2P1 :: [Test]
> > +unit_V2P1 =
> >    [ runPrimitiveTests "join commute" (PropU.joinCommute WSub.join)
> ExU.primPermutables
> >    , runPrimitiveTests "prim recommute" (PropU.recommute WSub.commute)
> ExU.commutables
> >    , runPrimitiveTests "prim patch and inverse commute"
> (PropU.patchAndInverseCommute WSub.commute) ExU.commutables
> > hunk ./src/Darcs/Test/Patch.hs 122
> >  mergeEitherWayReals :: PrimPatch prim => (RealPatch prim :\/: RealPatch
> prim) C(x y) -> TestResult
> >  mergeEitherWayReals = Prop.mergeEitherWay
> >
> > -patchUnitTests2 :: [Test]
> > -patchUnitTests2 =
> > +qc_prim :: forall prim C(x y a).
> > +           (PrimPatch prim, ArbitraryPrim prim, Show2 prim
> > +           , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> > +           , FromPrim prim
> > +           , Arbitrary (Sealed2 prim)
> > +           , Arbitrary (Sealed2 (WithState RepoModel prim))
> > +           , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> > +           , Arbitrary (Sealed2 (WithState RepoModel (FL prim :> FL
> prim)))
> > +           , Arbitrary (Sealed2 (WithState RepoModel (FL prim)))
> > +           , Arbitrary (Sealed2 (FL prim))
> > +           , Arbitrary (Sealed2 (prim :> prim))
> > +           , Arbitrary (Sealed2 (prim :> prim :> prim))
> > +           , Arbitrary (Sealed2 (FL prim :> FL prim))
> > +           ) => prim C(x y) -> [Test]
> > +qc_prim _ =
> >    [ testProperty "Checking Prim invert symmetry..."
> > hunk ./src/Darcs/Test/Patch.hs 138
> > -    (unseal2 $ Prop.invertSymmetry :: Sealed2 Prim -> TestResult)
> > +    (unseal2 $ Prop.invertSymmetry :: Sealed2 prim -> TestResult)
> >    , testProperty "Checking FL Prim invert symmetry..."
> > hunk ./src/Darcs/Test/Patch.hs 140
> > -    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL Prim) -> TestResult)
> > +    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL prim) -> TestResult)
> >    , testProperty "Checking Prim invert rollback..."
> > hunk ./src/Darcs/Test/Patch.hs 142
> > -    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel Prim)
> -> TestResult)
> > +    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel prim)
> -> TestResult)
> >    , testProperty "Checking FL Prim invert rollback..."
> > hunk ./src/Darcs/Test/Patch.hs 144
> > -    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL
> Prim)) -> TestResult)
> > +    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL
> prim)) -> TestResult)
> >    , testConditional "Checking Prim effect preserving..."
> > hunk ./src/Darcs/Test/Patch.hs 146
> > -    (unseal2 $ nonEmptyHunksPair . wsPatch)
> > -    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (Prim :> Prim)) -> TestResult)
> > +    (unseal2 $ P1.nonEmptyHunksPair . wsPatch)
> > +    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (prim :> prim)) -> TestResult)
> >    , testConditional "Checking FL Prim effect preserving..."
> > hunk ./src/Darcs/Test/Patch.hs 149
> > -    (unseal2 $ nonEmptyHunksFLPair . wsPatch)
> > -    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (FL Prim :> FL Prim)) -> TestResult)
> > +    (unseal2 $ P1.nonEmptyHunksFLPair . wsPatch)
> > +    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (FL prim :> FL prim)) -> TestResult)
> >    , testProperty "Checking Prim recommute..."
> > hunk ./src/Darcs/Test/Patch.hs 152
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (Prim :> Prim) ->
> TestResult)
> > +    (unseal2 $ Prop.recommute commute :: Sealed2 (prim :> prim) ->
> TestResult)
> >    , testProperty "Checking FL Prim recommute..."
> > hunk ./src/Darcs/Test/Patch.hs 154
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (FL Prim :> FL Prim) ->
> TestResult)
> > +    (unseal2 $ Prop.recommute commute :: Sealed2 (FL prim :> FL prim) ->
> TestResult)
> >    , testProperty "Checking Prim inverses commute..."
> > hunk ./src/Darcs/Test/Patch.hs 156
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (Prim :> Prim) ->
> TestResult)
> > +    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (prim :> prim) ->
> TestResult)
> >    , testProperty "Checking FL Prim inverses commute..."
> > hunk ./src/Darcs/Test/Patch.hs 158
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL Prim :> FL
> Prim) -> TestResult)
> > +    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL prim :> FL
> prim) -> TestResult)
> >      --do putStr "Checking with quickcheck that real patches have
> consistent flattenings... "
> >      --   quickCheck (not . isBottomTimeOut (Just 10) .
> propConsistentTreeFlattenings) >> return 0
> >      -- The following fails because of setpref patches...
> > hunk ./src/Darcs/Test/Patch.hs 165
> >      --,do putStr "Checking prim inverse doesn't commute using
> QuickCheck... "
> >      --    simpleCheck (inverseDoesntCommute :: Prim -> Maybe Doc)
> >    , testProperty "Checking prim join effect preserving... "
> > -    (unseal2 (Prop.joinEffectPreserving join :: WithState RepoModel
> (Prim :> Prim) C(x y) -> TestResult))
> > +    (unseal2 $ Prop.joinEffectPreserving join :: Sealed2 (WithState
> RepoModel (prim :> prim)) -> TestResult)
> >    , testConditional "Checking prim join commute using QuickCheck... "
> > hunk ./src/Darcs/Test/Patch.hs 167
> > -    (unseal2 nonEmptyHunksTriple)
> > -    (unseal2 (Prop.joinCommute join :: (Prim :> Prim :> Prim) C(x y) ->
> TestResult))
> > +    (unseal2 P1.nonEmptyHunksTriple)
> > +    (unseal2 $ Prop.joinCommute join :: Sealed2 (prim :> prim :> prim)
> -> TestResult)
> >      --,do putStr "Checking prim recommute using QuickCheck... "
> >      --    simpleCheck (recommute
> >      --                 (commute :: Prim :> Prim
> > hunk ./src/Darcs/Test/Patch.hs 173
> >      --                          -> Maybe (Prim :> Prim)))
> > -  , testProperty "Checking that readPatch and showPatch work on
> RealPatch... "
> > +  ]
> > +
> > +qc_V2P1 :: [Test]
> > +qc_V2P1 =
> > +  [ testProperty "Checking that readPatch and showPatch work on
> RealPatch... "
> >      (unseal $ patchFromTree $ (Prop.show_read :: RealPatch Prim C(x y)
> -> TestResult))
> >    , testProperty "Checking that readPatch and showPatch work on FL
> RealPatch... "
> >      (unseal2 $ (Prop.show_read :: FL (RealPatch Prim) C(x y) ->
> TestResult))
> > hunk ./src/Darcs/Test/Patch.hs 184
> >    , testProperty "Checking that tree flattenings are consistent... "
> >      Prop.propConsistentTreeFlattenings
> >    , testProperty "Checking with quickcheck that real patches are
> consistent... "
> > -    (unseal $ patchFromTree $ fromMaybe . isConsistent)
> > +    (unseal $ P1.patchFromTree $ fromMaybe . isConsistent)
> >
> >    , testProperty "Checking we can do merges using QuickCheck"
> >      (isNothing . (Prop.propIsMergeable ::
> > hunk ./src/Darcs/Test/Patch.hs 191
> >                       Sealed (WithStartState RepoModel (Tree Prim))
> >                       -> Maybe (Tree (RealPatch Prim) C(x))))
> >    , testProperty "Checking recommute using QuickCheck Tree generator"
> > -    (unseal $ commutePairFromTree $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> >    , testProperty "Checking recommute using QuickCheck TWFP generator"
> > hunk ./src/Darcs/Test/Patch.hs 193
> > -    (unseal $ commutePairFromTWFP $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> >    , testConditional "Checking nontrivial recommute"
> > hunk ./src/Darcs/Test/Patch.hs 195
> > -    (unseal $ commutePairFromTree $ nontrivialReals)
> > -    (unseal $ commutePairFromTree $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> >    , testConditional "Checking nontrivial recommute using TWFP"
> > hunk ./src/Darcs/Test/Patch.hs 198
> > -    (unseal $ commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ commutePairFromTWFP $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> >
> >    , testProperty "Checking inverses commute using QuickCheck Tree
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 202
> > -    (unseal $ commutePairFromTree $
> > +    (unseal $ P1.commutePairFromTree $
> >       (Prop.commuteInverses commuteReals))
> >    , testProperty "Checking inverses commute using QuickCheck TWFP
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 205
> > -    (unseal $ commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> >    , testConditional "Checking nontrivial inverses commute"
> > hunk ./src/Darcs/Test/Patch.hs 207
> > -    (unseal $ commutePairFromTree $ nontrivialReals)
> > -    (unseal $ commutePairFromTree $ Prop.commuteInverses commuteReals)
> > +    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTree $ Prop.commuteInverses
> commuteReals)
> >    , testConditional "Checking nontrivial inverses commute using TWFP"
> > hunk ./src/Darcs/Test/Patch.hs 210
> > -    (unseal $ commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> >
> >    , testProperty "Checking merge either way using QuickCheck TWFP
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 214
> > -    (unseal $ mergePairFromTWFP $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> >    , testProperty "Checking merge either way using QuickCheck Tree
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 216
> > -    (unseal $ mergePairFromTree $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> >    , testConditional "Checking nontrivial merge either way"
> > hunk ./src/Darcs/Test/Patch.hs 218
> > -    (unseal $ mergePairFromTree $ nontrivialMergeReals)
> > -    (unseal $ mergePairFromTree $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTree $ nontrivialMergeReals)
> > +    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> >    , testConditional "Checking nontrivial merge either way using TWFP"
> > hunk ./src/Darcs/Test/Patch.hs 221
> > -    (unseal $ mergePairFromTWFP $ nontrivialMergeReals)
> > -    (unseal $ mergePairFromTWFP $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTWFP $ nontrivialMergeReals)
> > +    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> >
> >    , testConditional "Checking permutivity"
> > hunk ./src/Darcs/Test/Patch.hs 225
> > -    (unseal $ commuteTripleFromTree notDuplicatestriple)
> > -    (unseal $ commuteTripleFromTree $ Prop.permutivity commuteReals)
> > +    (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> > +    (unseal $ P1.commuteTripleFromTree $ Prop.permutivity commuteReals)
> >    , testConditional "Checking partial permutivity"
> > hunk ./src/Darcs/Test/Patch.hs 228
> > -    (unseal $ commuteTripleFromTree notDuplicatestriple)
> > -    (unseal $ commuteTripleFromTree $ Prop.partialPermutivity
> commuteReals)
> > +    (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> > +    (unseal $ P1.commuteTripleFromTree $ Prop.partialPermutivity
> commuteReals)
> >    , testConditional "Checking nontrivial permutivity"
> > hunk ./src/Darcs/Test/Patch.hs 231
> > -    (unseal $ commuteTripleFromTree (\t -> nontrivialTriple t &&
> notDuplicatestriple t))
> > -    (unseal $ commuteTripleFromTree $ (Prop.permutivity commuteReals))
> > +    (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t &&
> notDuplicatestriple t))
> > +    (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity
> commuteReals))
> >    ]
> >
> > hunk ./src/Darcs/Test/Patch.hs 235
> > -patchPropertyTests :: [Test]
> > -patchPropertyTests =
> > +qc_V1P1 :: [Test]
> > +qc_V1P1 =
> >    [
> >      testProperty "Checking that show and read work right" (unseal
> Prop.propReadShow)
> >    ]
> > hunk ./src/Darcs/Test/Patch.hs 272
> >
> >  -- | This is the big list of tests that will be run using testrunner.
> >  testSuite :: [Test]
> > -testSuite = [ testGroup "Darcs.Patch (Properties.GenericUnwitnessed +
> Examples.Set3Unwitnessed)" patchUnitTests
> > -            , testGroup "Darcs.Patch (Properties.Generic + Arbitrary)"
> patchUnitTests2
> > -            , testGroup "Darcs.Patch (Properties.V1Set2 + Arbitrary)"
> patchPropertyTests
> > -            , testGroup "Darcs.Patch (Properties.V1Set1 +
> Examples.Set1)" patchExampleTests
> > +testSuite = [ testGroup "Darcs.Patch.Prim.V1" $ qc_prim (undefined ::
> Prim C(x y))
> > +            , testGroup "Darcs.Patch.V1 (using Prim.V1)" $ unit_V1P1 ++
> qc_V1P1
> > +            , testGroup "Darcs.Patch.V2 (using Prim.V1)" $ unit_V2P1 ++
> qc_V2P1
> >              , Darcs.Test.Patch.Info.testSuite
> >              ]
> > [Generalise the V1.Prim Arbitrary instance based on Tree to any
> PrimPatch.
> > Petr Rockai <me@mornfall.net>**20110620123027
> >  Ignore-this: 289e1227afffcec6484ce10a477f977a
> > ] hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 31
> >  import Darcs.Patch.Patchy ( Invert(..), Commute(..) )
> >  import Darcs.Patch.Prim ( PrimOf, PrimPatch, PrimPatchBase,
> FromPrim(..), move )
> >  import Darcs.Patch.Prim.V1 ()
> > +import Darcs.Patch.V2 ( RealPatch ) -- XXX this is more or less a hack
> >  --import Darcs.ColorPrinter ( errorDoc )
> >  --import Darcs.ColorPrinter ( traceDoc )
> >  import Darcs.Witnesses.Show
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 222
> >  getTriples (_:>:NilFL) = []
> >  getTriples (_:>:_:>:NilFL) = []
> >  getTriples (a:>:b:>:c:>:d) = seal2 (a:>b:>c) : getTriples (b:>:c:>:d)
> > +
> > +instance ArbitraryPrim prim => Arbitrary (Sealed (WithStartState
> RepoModel (TreeWithFlattenPos prim))) where
> > +   arbitrary = do Sealed (WithStartState rm t) <- arbitrary
> > +                  let num = unseal (length . getPairs) (flattenOneRP t)
> > +                  if num == 0 then return $ Sealed $ WithStartState rm $
> TWFP 0 NilTree
> > +                    else do n <- choose (0, num - 1)
> > +                            return $ Sealed $ WithStartState rm $ TWFP n
> t
> > +                    where -- just used to get the length. In principle
> this should be independent of the patch type.
> > +                          flattenOneRP :: Tree prim C(x) -> Sealed (FL
> (RealPatch prim) C(x))
> > +                          flattenOneRP = flattenOne
> > +
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Real.hs 19
> >  import Darcs.Witnesses.Sealed
> >  import Darcs.Witnesses.Eq
> >  import Darcs.Patch.Prim ( FromPrim(..) )
> > -import Darcs.Patch.Prim.V1 ( Prim )
> >
> >  #include "gadts.h"
> >
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Real.hs 65
> >          Just (c' :> b'') -> (not (a `unsafeCompare` a') || not (b
> `unsafeCompare` b')) &&
> >                              (not (c' `unsafeCompare` c) || not (b''
> `unsafeCompare` b)) &&
> >                              (not (c'' `unsafeCompare` c) || not (a''
> `unsafeCompare` a'))
> > -
> > -instance Arbitrary (Sealed (WithStartState RepoModel (TreeWithFlattenPos
> Prim))) where
> > -   arbitrary = do Sealed (WithStartState rm t) <- arbitrary
> > -                  let num = unseal (length . getPairs) (flattenOneRP t)
> > -                  if num == 0 then return $ Sealed $ WithStartState rm $
> TWFP 0 NilTree
> > -                    else do n <- choose (0, num - 1)
> > -                            return $ Sealed $ WithStartState rm $ TWFP n
> t
> > -                    where -- just used to get the length. In principle
> this should be independent of the patch type.
> > -                          flattenOneRP :: Tree Prim C(x) -> Sealed (FL
> (RealPatch Prim) C(x))
> > -                          flattenOneRP = flattenOne
> > -
> > [Generalise a bunch of merge/commute properties over the patch type &
> generator.
> > Petr Rockai <me@mornfall.net>**20110620123354
> >  Ignore-this: fd5b45e576226d719531182bedd5ac9d
> > ] hunk ./src/Darcs/Test/Patch.hs 1
> > +{-# OPTIONS_GHC -fno-warn-orphans #-}
> >  --  Copyright (C) 2002-2005,2007 David Roundy
> >  --
> >  --  This program is free software; you can redistribute it and/or modify
> > hunk ./src/Darcs/Test/Patch.hs 26
> >  import Test.Framework.Providers.HUnit ( testCase )
> >  import Test.Framework.Providers.QuickCheck2 ( testProperty )
> >  import Test.QuickCheck.Arbitrary( Arbitrary )
> > +import Test.QuickCheck( Testable )
> >  import Test.HUnit ( assertBool )
> >
> >  import Darcs.Test.Util.TestResult ( TestResult, isOk, fromMaybe )
> > hunk ./src/Darcs/Test/Patch.hs 38
> >  import Darcs.Witnesses.Show
> >  import Darcs.Patch.Prim( PrimPatch, join, FromPrim, PrimOf,
> PrimPatchBase )
> >  import Darcs.Patch.Prim.V1 ( Prim )
> > +import qualified Darcs.Patch.V1 as V1
> >  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
> > hunk ./src/Darcs/Test/Patch.hs 40
> > -import Darcs.Patch.Patchy ( Commute(..) )
> > +import Darcs.Patch.RepoPatch( RepoPatch )
> > +import Darcs.Patch.Patchy ( Commute(..), Patchy )
> >
> >  import Darcs.Test.Patch.Arbitrary.Generic
> >  import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> > hunk ./src/Darcs/Test/Patch.hs 120
> >    , runPrimitiveTests "real partial permutivity"
> (PropU.partialPermutivity WSub.commute) ExU.realNonduplicateTriples
> >    ]
> >
> > +instance Check (RealPatch Prim) where
> > +  checkPatch p = return $ isNothing $ isConsistent p
> > +
> >  commuteReals :: PrimPatch prim => (RealPatch prim :> RealPatch prim) C(x
> y) -> Maybe ((RealPatch prim :> RealPatch prim) C(x y))
> >  commuteReals = commute
> >
> > hunk ./src/Darcs/Test/Patch.hs 126
> > -mergeEitherWayReals :: PrimPatch prim => (RealPatch prim :\/: RealPatch
> prim) C(x y) -> TestResult
> > -mergeEitherWayReals = Prop.mergeEitherWay
> > -
> >  qc_prim :: forall prim C(x y a).
> >             (PrimPatch prim, ArbitraryPrim prim, Show2 prim
> >             , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> > hunk ./src/Darcs/Test/Patch.hs 130
> >             , FromPrim prim
> > +           , Arbitrary (Sealed ((prim :> prim) C(a)))
> > +           , Arbitrary (Sealed ((FL prim :> FL prim) C(a)))
> > +           , Show1 ((PrimOf prim :> PrimOf prim) C(a))
> >             , Arbitrary (Sealed2 prim)
> >             , Arbitrary (Sealed2 (WithState RepoModel prim))
> >             , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> > hunk ./src/Darcs/Test/Patch.hs 158
> >    , testConditional "Checking FL Prim effect preserving..."
> >      (unseal2 $ P1.nonEmptyHunksFLPair . wsPatch)
> >      (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (FL prim :> FL prim)) -> TestResult)
> > -  , testProperty "Checking Prim recommute..."
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (prim :> prim) ->
> TestResult)
> > -  , testProperty "Checking FL Prim recommute..."
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (FL prim :> FL prim) ->
> TestResult)
> > -  , testProperty "Checking Prim inverses commute..."
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (prim :> prim) ->
> TestResult)
> > -  , testProperty "Checking FL Prim inverses commute..."
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL prim :> FL
> prim) -> TestResult)
> >      --do putStr "Checking with quickcheck that real patches have
> consistent flattenings... "
> >      --   quickCheck (not . isBottomTimeOut (Just 10) .
> propConsistentTreeFlattenings) >> return 0
> >      -- The following fails because of setpref patches...
> > hunk ./src/Darcs/Test/Patch.hs 172
> >      --    simpleCheck (recommute
> >      --                 (commute :: Prim :> Prim
> >      --                          -> Maybe (Prim :> Prim)))
> > -  ]
> > +  ] ++ commute_properties (undefined :: prim C(x y)) "arbitrary"
> arbitraryCommutePair
> > +    ++ commute_properties (undefined :: FL prim C(x y)) "arbitrary FL"
> arbitraryFLCommutePair
> > +    where arbitraryCommutePair
> > +            :: (FORALL(xx yy) (prim :> prim) C(xx yy) -> t) ->
> > +               ((prim :> prim) C(a bb) -> t)
> > +          arbitraryCommutePair f p = f p
> > +          arbitraryFLCommutePair :: (FORALL(xx yy) (FL prim :> FL prim)
> C(xx yy) -> t) ->
> > +                                    ((FL prim :> FL prim) C(a bb) -> t)
> > +          arbitraryFLCommutePair f p = f p
> >
> >  qc_V2P1 :: [Test]
> >  qc_V2P1 =
> > hunk ./src/Darcs/Test/Patch.hs 184
> > +  -- utilities
> ------------------------------------------------------------------------------
> >    [ testProperty "Checking that readPatch and showPatch work on
> RealPatch... "
> >      (unseal $ patchFromTree $ (Prop.show_read :: RealPatch Prim C(x y)
> -> TestResult))
> >    , testProperty "Checking that readPatch and showPatch work on FL
> RealPatch... "
> > hunk ./src/Darcs/Test/Patch.hs 198
> >      (isNothing . (Prop.propIsMergeable ::
> >                       Sealed (WithStartState RepoModel (Tree Prim))
> >                       -> Maybe (Tree (RealPatch Prim) C(x))))
> > -  , testProperty "Checking recommute using QuickCheck Tree generator"
> > -    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> > -  , testProperty "Checking recommute using QuickCheck TWFP generator"
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> > -  , testConditional "Checking nontrivial recommute"
> > -    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> > -  , testConditional "Checking nontrivial recommute using TWFP"
> > -    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> > -
> > -  , testProperty "Checking inverses commute using QuickCheck Tree
> generator"
> > -    (unseal $ P1.commutePairFromTree $
> > -     (Prop.commuteInverses commuteReals))
> > -  , testProperty "Checking inverses commute using QuickCheck TWFP
> generator"
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> > -  , testConditional "Checking nontrivial inverses commute"
> > -    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTree $ Prop.commuteInverses
> commuteReals)
> > -  , testConditional "Checking nontrivial inverses commute using TWFP"
> > -    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> > -
> > -  , testProperty "Checking merge either way using QuickCheck TWFP
> generator"
> > -    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> > -  , testProperty "Checking merge either way using QuickCheck Tree
> generator"
> > -    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> > -  , testConditional "Checking nontrivial merge either way"
> > -    (unseal $ P1.mergePairFromTree $ nontrivialMergeReals)
> > -    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> > -  , testConditional "Checking nontrivial merge either way using TWFP"
> > -    (unseal $ P1.mergePairFromTWFP $ nontrivialMergeReals)
> > -    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> >
> > hunk ./src/Darcs/Test/Patch.hs 199
> > +  -- permutivity
> ----------------------------------------------------------------------------
> >    , testConditional "Checking permutivity"
> >      (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> >      (unseal $ P1.commuteTripleFromTree $ Prop.permutivity commuteReals)
> > hunk ./src/Darcs/Test/Patch.hs 209
> >    , testConditional "Checking nontrivial permutivity"
> >      (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t &&
> notDuplicatestriple t))
> >      (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity
> commuteReals))
> > +
> > +  ] ++ merge_properties (undefined :: RealPatch Prim C(x y)) "tree"
> mergePairFromTree
> > +    ++ merge_properties (undefined :: RealPatch Prim C(x y)) "twfp"
> mergePairFromTWFP
> > +    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "tree"
> commutePairFromTree
> > +    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "twfp"
> commutePairFromTWFP
> > +
> > +commute_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf
> p), FromPrim p
> > +                                       , Show2 p, Show2 (PrimOf p),
> Patchy p
> > +                                       , Show1 gen, Arbitrary (Sealed
> gen))
> > +                 => p C(x y) -> String ->
> > +                    (FORALL(ctx t) ((FORALL(xx yy) (p :> p) xx yy -> t)
> -> (gen ctx -> t))) ->
> > +                    [Test]
> > +commute_properties _ genname gen =
> > +  [ prop "recommute" $ Prop.recommute commute
> > +  , cond "nontrivial recommute" nontrivialCommute $ Prop.recommute
> commute
> > +  , prop "inverses commute" $ Prop.commuteInverses commute
> > +  , cond "nontrivial inverses" nontrivialCommute $ Prop.commuteInverses
> commute
> >    ]
> > hunk ./src/Darcs/Test/Patch.hs 227
> > +  where prop :: String -> (FORALL (yy zz) (p :> p) C(yy zz) ->
> TestResult) -> Test
> > +        prop t p = cond t (const True) p
> > +        cond :: String ->
> > +                (FORALL (yy zz) (p :> p) C(yy zz) -> Bool) ->
> > +                (FORALL (yy zz) (p :> p) C(yy zz) -> TestResult) -> Test
> > +        cond t c p =
> > +          testConditional ("commute (" ++ genname ++ "): " ++ t)
> > +          (unseal $ gen c) (unseal $ gen p)
> > +
> > +merge_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf
> p), FromPrim p
> > +                                      , Show2 p, Show2 (PrimOf p),
> RepoPatch p
> > +                                      , Show1 gen, Arbitrary (Sealed
> gen))
> > +                 => p C(x y) -> String ->
> > +                    (FORALL(ctx t) ((FORALL(xx yy) (p :\/: p) xx yy ->
> t) -> (gen ctx -> t))) ->
> > +                    [Test]
> > +merge_properties _ genname gen =
> > +    [ prop "merge swap" Prop.tMergeSwapMerge
> > +    , prop "merge either way" Prop.mergeEitherWay
> > +    , prop "merge either way valid" Prop.tMergeEitherWayValid
> > +    , cond "nontrivial merge either way" nontrivialMerge
> Prop.mergeEitherWay
> > +    ]
> > +  where prop :: Testable t => String -> (FORALL (yy zz) (p :\/: p) C(yy
> zz) -> t) -> Test
> > +        prop t p = cond t (const True) p
> > +        cond :: (Testable t) => String ->
> > +                (FORALL (yy zz) (p :\/: p) C(yy zz) -> Bool) ->
> > +                (FORALL (yy zz) (p :\/: p) C(yy zz) -> t) -> Test
> > +        cond t c p =
> > +          testConditional ("merge (" ++ genname ++ "): " ++ t)
> > +          (unseal $ gen c) (unseal $ gen p)
> >
> >  qc_V1P1 :: [Test]
> >  qc_V1P1 =
> > hunk ./src/Darcs/Test/Patch.hs 269
> >    [ testProperty "Checking that commuting by patch and its inverse is
> ok" Prop.propCommuteInverse
> >     --putStr "Checking that conflict resolution is valid... "
> >     --runQuickCheckTest returnval propResolveConflictsValid
> > -  , testProperty "Checking that a patch followed by its inverse is
> identity" Prop.propPatchAndInverseIsIdentity
> > +  , testProperty "Checking that a patch followed by its inverse is
> identity"
> > +    Prop.propPatchAndInverseIsIdentity
> >    , testProperty "Checking 'simple smart merge'"
> Prop.propSimpleSmartMergeGoodEnough
> >    , testProperty "Checking that commutes are equivalent"
> Prop.propCommuteEquivalency
> >    , testProperty "Checking that merges are valid" Prop.propMergeValid
> > hunk ./src/Darcs/Test/Patch.hs 291
> >    , testProperty "Checking that merges commute and are well behaved"
> Prop.propMergeIsCommutableAndCorrect
> >    , testProperty "Checking that merges can be swapped"
> Prop.propMergeIsSwapable
> >    , testProperty "Checking again that merges can be swapped (I'm
> paranoid) " Prop.propMergeIsSwapable
> > -  ]
> > +
> > +  ] -- the following properties are disabled, because they routinely
> lead to
> > +    -- exponential cases, making the tests run for ever and ever;
> nevertheless,
> > +    -- we would expect them to hold
> > + {- ++ merge_properties (undefined :: V1.Patch Prim C(x y)) "tree"
> mergePairFromTree
> > +    ++ merge_properties (undefined :: V1.Patch Prim C(x y)) "twfp"
> mergePairFromTWFP
> > +    ++ commute_properties (undefined :: V1.Patch Prim C(x y)) "tree"
> commutePairFromTree
> > +    ++ commute_properties (undefined :: V1.Patch Prim C(x y)) "twfp"
> commutePairFromTWFP -}
> >
> >  -- | This is the big list of tests that will be run using testrunner.
> >  testSuite :: [Test]
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 63
> >  instance Show2 p => Show1 (Tree p) where
> >      showDict1 = ShowDictClass
> >
> > +instance Show2 p => Show1 (TreeWithFlattenPos p) where
> > +    showDict1 = ShowDictClass
> > +
> >  sizeTree :: Tree p C(x) -> Int
> >  sizeTree NilTree = 0
> >  sizeTree (SeqTree _ t) = 1 + sizeTree t
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 18
> >  import Darcs.Witnesses.Eq
> >  import Darcs.Witnesses.Unsafe
> >  import Darcs.Witnesses.Ordered
> > -import Darcs.Witnesses.Show
> > +-- import Darcs.Witnesses.Show
> >  import Darcs.Patch.Prim.V1 ()
> >  import Darcs.Patch.Prim.V1.Core ( FilePatchType( Hunk, TokReplace ),
> Prim( FP ), isIdentity )
> >  import Darcs.Patch.RepoPatch ( RepoPatch )
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 84
> >    arbitrary = do repo <- aSmallRepo
> >                   liftM (unseal (seal2 . wesPatch)) $ arbitraryState repo
> >
> > -instance Show1 (TreeWithFlattenPos Prim) where
> > -   showDict1 = ShowDictClass
> > +-- instance Show1 (TreeWithFlattenPos Prim) where
> > +--   showDict1 = ShowDictClass
> >
> >  -- WithState and propFail are handy for debugging arbitrary code
> >  propFail :: Int -> Tree Prim C(x) -> Bool
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 339
> >                   WithEndState pp _ <- aPrimPair repo
> >                   return $ seal2 pp
> >
> > +instance Arbitrary (Sealed ((Prim :> Prim) C(a))) where
> > +  arbitrary = do repo <- aSmallRepo
> > +                 WithEndState pp _ <- aPrimPair repo
> > +                 return $ seal pp
> > +
> >  instance Arbitrary (Sealed2 (Prim :> Prim :> Prim)) where
> >    arbitrary = makeGen aSmallRepo
> >
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 353
> >  instance Arbitrary (Sealed2 (FL Prim :> FL Prim)) where
> >    arbitrary = makeGen aSmallRepo
> >
> > +instance Arbitrary (Sealed ((FL Prim :> FL Prim) C(a))) where
> > +  arbitrary = makeSGen aSmallRepo
> >
> >  instance Arbitrary (Sealed2 (WithState RepoModel Prim)) where
> >    arbitrary = makeWSGen aSmallRepo
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 14
> >       , readPatch, showPatch
> >       , fromPrim, canonize, sortCoalesceFL )
> >  import Darcs.Patch.Prim.V1 ( Prim )
> > +import Darcs.Patch.Merge ( Merge )
> >  import qualified Darcs.Patch.V1 as V1 ( Patch )
> >  import Darcs.Test.Patch.Test
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 17
> > -    ( checkAPatch )
> > +    ( checkAPatch, Check )
> >  import Printer ( renderPS )
> >  import Darcs.Witnesses.Eq
> >  import Darcs.Witnesses.Ordered
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 32
> >  type Patch = V1.Patch Prim
> >
> >
> > -quickmerge :: (FL Patch :\/: FL Patch) C(x y) -> FL Patch C(y z)
> > +quickmerge :: (Patchy p, Merge p) => (p :\/: p ) C(x y) -> p C(y z)
> >  quickmerge (p1:\/:p2) = case merge (p1:\/:p2) of
> >                          _ :/\: p1' -> unsafeCoercePEnd p1'
> >
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 138
> >                          else failed $ text $ "Failed to read shown:
>  "++(show2 p)++"\n"
> >      Nothing -> failed $ text $ "Failed to read at all:  "++(show2
> p)++"\n"
> >
> > -tMergeEitherWayValid :: FORALL(x y) (FL Patch :\/: FL Patch) C(x y) ->
> TestResult
> > +tMergeEitherWayValid :: FORALL(x y p) (Check p, Show2 p, Merge p, Patchy
> p) => (p :\/: p) C(x y) -> TestResult
> >  tMergeEitherWayValid (p1 :\/: p2) =
> >    case p2 :>: quickmerge (p1:\/: p2) :>: NilFL of
> >    combo2 ->
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 145
> >      case p1 :>: quickmerge (p2:\/: p1) :>: NilFL of
> >      combo1 ->
> >        if not $ checkAPatch combo1
> > -      then failed $ text $ "oh my combo1 invalid:\n"++show
> p1++"and...\n"++show p2++show combo1
> > +      then failed $ text $ "oh my combo1 invalid:\n"++show2
> p1++"and...\n"++show2 p2++show combo1
> >        else
> >          if checkAPatch (invert combo1 :>: combo2 :>: NilFL)
> >          then succeeded
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 149
> > -        else failed $ text $ "merge both ways invalid:\n"++show
> p1++"and...\n"++show p2++
> > +        else failed $ text $ "merge both ways invalid:\n"++show2
> p1++"and...\n"++show2 p2++
> >                show combo1++
> >                show combo2
> >
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 153
> > -tMergeSwapMerge :: (FL Patch :\/: FL Patch) C(x y) -> TestResult
> > +tMergeSwapMerge :: forall p x y. (Patchy p, Show2 p, Merge p) => (p :\/:
> p) C(x y) -> TestResult
> >  tMergeSwapMerge (p1 :\/: p2) =
> >    if merge (p2 :\/: p1) `eqSwapped` merge (p1 :\/: p2)
> >    then succeeded
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 157
> > -  else failed $ text $ "Failed to swap merges:\n"++show
> p1++"and...\n"++show p2
> > +  else failed $ text $ "Failed to swap merges:\n"++show2
> p1++"and...\n"++show2 p2
> >          ++"merged:\n"++show (merge (p1:\/:p2))++"\n"
> >          ++"merged swapped:\n"++show (merge (p2:\/: p1))++"\n"
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 160
> > -    where eqSwapped :: (FL Patch :/\: FL Patch) C(x y) -> (FL Patch :/\:
> FL Patch) C(y x) -> Bool
> > -          eqSwapped (x1 :/\: y1) (y2 :/\: x2) | IsEq <- eqFL x1 x2, IsEq
> <- eqFL y1 y2 = True
> > +    where eqSwapped :: (p :/\: p) C(x_ y_) -> (p :/\: p) C(y_ x_) ->
> Bool
> > +          eqSwapped (x1 :/\: y1) (y2 :/\: x2) | unsafeCompare x1 x2,
> unsafeCompare y1 y2 = True
> >            eqSwapped _ _ = False
> >
> >  tCommuteRecommute :: FORALL(x y) (FL Patch :< FL Patch) C(x y) ->
> TestResult
> > hunk ./src/Darcs/Test/Patch/WithState.hs 115
> >                     Sealed (WithEndState p _) <- arbitraryState s
> >                     return $ seal2 p
> >
> > +makeSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed (p C(x)))
> > +makeSGen stGen = do s <- stGen
> > +                    Sealed (WithEndState p _) <- arbitraryState s
> > +                    return $ seal p
> > +
> >  makeWSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2
> (WithState s p))
> >  makeWSGen stGen = do s <- stGen
> >                       Sealed (WithEndState wsP _) <- arbitraryState s
> > [Split Test.Patch.Test into Properties.Check and Arbitrary.PatchV1.
> > Petr Rockai <me@mornfall.net>**20110620133651
> >  Ignore-this: 16322561bc5c8dd5c356e632bb7d22ef
> > ] move ./src/Darcs/Test/Patch/Test.hs
> ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs
> > hunk ./darcs.cabal 613
> >                        Darcs.Test.Patch.Properties.V1Set2
> >                        Darcs.Test.Patch.Properties.Generic
> >                        Darcs.Test.Patch.Properties.GenericUnwitnessed
> > +                      Darcs.Test.Patch.Properties.Check
> >                        Darcs.Test.Patch.Arbitrary.Generic
> >                        Darcs.Test.Patch.Arbitrary.Real
> >                        Darcs.Test.Patch.Arbitrary.PrimV1
> > hunk ./darcs.cabal 617
> > +                      Darcs.Test.Patch.Arbitrary.PatchV1
> >                        Darcs.Test.Patch.RepoModel
> > hunk ./darcs.cabal 619
> > -                      Darcs.Test.Patch.Test
> >                        Darcs.Test.Patch.Utils
> >                        Darcs.Test.Patch.WithState
> >                        Darcs.Test.Patch
> > hunk ./src/Darcs/Test/Patch.hs 45
> >
> >  import Darcs.Test.Patch.Arbitrary.Generic
> >  import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> > -import Darcs.Test.Patch.Test( Check(..) )
> >  import Darcs.Test.Patch.Arbitrary.Real
> > hunk ./src/Darcs/Test/Patch.hs 46
> > +import Darcs.Test.Patch.Arbitrary.PatchV1 ()
> >  import Darcs.Test.Patch.Arbitrary.PrimV1 ()
> >  import Darcs.Test.Patch.RepoModel( RepoModel )
> >  import Darcs.Test.Patch.WithState( WithState, wsPatch, WithStartState )
> > hunk ./src/Darcs/Test/Patch.hs 56
> >  import qualified Darcs.Test.Patch.Examples.Set1 as Ex
> >  import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
> >
> > +import Darcs.Test.Patch.Properties.Check( Check(..), checkAPatch )
> >  import qualified Darcs.Test.Patch.Properties.V1Set1 as Prop
> >  import qualified Darcs.Test.Patch.Properties.V1Set2 as Prop
> >  import qualified Darcs.Test.Patch.Properties.Generic as Prop
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 23
> >
> >  #include "gadts.h"
> >
> > -module Darcs.Test.Patch.Test
> > -             (
> > -               Check, checkPatch, checkAPatch, verboseCheckAPatch
> > -             ) where
> > +module Darcs.Test.Patch.Arbitrary.PatchV1 () where
> >
> >  import Prelude hiding ( pi )
> >  import System.IO.Unsafe ( unsafePerformIO )
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 59
> >  import Darcs.Witnesses.Sealed ( Sealed(Sealed), unseal, mapSeal,
> Sealed2(..) )
> >  import Darcs.Witnesses.Unsafe
> >
> > +-- This definitely feels a bit weird to be importing Properties here,
> and
> > +-- probably means we want to move this elsewhere, but
> Darcs.Test.Patch.Check is
> > +-- already taken with something apparently only semi-related
> > +import Darcs.Test.Patch.Properties.Check( checkAPatch )
> > +
> >  #include "impossible.h"
> >
> >  type Patch = V1.Patch Prim
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 291
> >                         (1,map fromSafeChar `fmap` arbitrary),
> >                         (1,liftM2 (\a b-> a++"/"++b) filepathgen
> filepathgen) ]
> >
> > -class Check p where
> > -   checkPatch :: p C(x y) -> PatchCheck Bool
> > -
> > -instance Check p => Check (FL p) where
> > -   checkPatch NilFL = isValid
> > -   checkPatch (p :>: ps) = checkPatch p >> checkPatch ps
> > -
> > -checkAPatch :: (Invert p, Check p) => p C(x y) -> Bool
> > -checkAPatch p = doCheck $ do _ <- checkPatch p
> > -                             checkPatch $ invert p
> > -
> > -verboseCheckAPatch :: (Invert p, Check p) => p C(x y) -> Bool
> > -verboseCheckAPatch p = doVerboseCheck $ do checkPatch p
> > -
> > -instance Check Patch where
> > -   checkPatch p | isMerger p = do
> > -     checkPatch $ effect p
> > -   checkPatch (V1.Merger _ _ _ _) = impossible
> > -   checkPatch (V1.Regrem _ _ _ _) = impossible
> > -   checkPatch (V1.PP p) = checkPatch p
> > -
> > -instance Check Prim where
> > -
> > -   checkPatch (FP f RmFile) = removeFile $ fn2fp f
> > -   checkPatch (FP f AddFile) =  createFile $ fn2fp f
> > -   checkPatch (FP f (Hunk line old new)) = do
> > -       _ <- fileExists $ fn2fp f
> > -       mapM_ (deleteLine (fn2fp f) line) old
> > -       mapM_ (insertLine (fn2fp f) line) (reverse new)
> > -       isValid
> > -   checkPatch (FP f (TokReplace t old new)) =
> > -       modifyFile (fn2fp f) (tryTokPossibly t old new)
> > -   -- note that the above isn't really a sure check, as it leaves
> PSomethings
> > -   -- and PNothings which may have contained new...
> > -   checkPatch (FP f (Binary o n)) = do
> > -       _ <- fileExists $ fn2fp f
> > -       mapM_ (deleteLine (fn2fp f) 1) (linesPS o)
> > -       _ <- fileEmpty $ fn2fp f
> > -       mapM_ (insertLine (fn2fp f) 1) (reverse $ linesPS n)
> > -       isValid
> > -
> > -   checkPatch (DP d AddDir) = createDir $ fn2fp d
> > -   checkPatch (DP d RmDir) = removeDir $ fn2fp d
> > -
> > -   checkPatch (Move f f') = checkMove (fn2fp f) (fn2fp f')
> > -   checkPatch (ChangePref _ _ _) = return True
> > -
> >  regularizePatches :: FL Patch C(x y) -> FL Patch C(x y)
> >  regularizePatches patches = rpint (unsafeCoerceP NilFL) patches
> >      where -- this reverses the list, which seems odd and causes
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PatchV1.hs 302
> >              then rpint (unsafeCoerceP p:>:ok_ps) ps
> >              else rpint ok_ps ps
> >
> > -tryTokPossibly :: String -> String -> String
> > -                -> (Maybe FileContents) -> (Maybe FileContents)
> > -tryTokPossibly t o n = liftM $ \contents ->
> > -        let lines' = M.mapMaybe (liftM B.concat
> > -                                  . tryTokInternal t (BC.pack o)
> (BC.pack n))
> > -                                (fcLines contents)
> > -        in contents { fcLines = lines' }
> > -
> > -tryTokInternal :: String -> B.ByteString -> B.ByteString
> > -                 -> B.ByteString -> Maybe [B.ByteString]
> > -tryTokInternal _ _ _ s | B.null s = Just []
> > -tryTokInternal t o n s =
> > -    case BC.break (regChars t) s of
> > -    (before,s') ->
> > -        case BC.break (not . regChars t) s' of
> > -        (tok,after) ->
> > -            case tryTokInternal t o n after of
> > -            Nothing -> Nothing
> > -            Just rest ->
> > -                if tok == o
> > -                then Just $ before : n : rest
> > -                else if tok == n
> > -                     then Nothing
> > -                     else Just $ before : tok : rest
> > -
> > hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 39
> >  import Darcs.Patch.Prim ( PrimOf, FromPrim )
> >  import Darcs.Patch.Prim.V1 ( Prim )
> >  import qualified Darcs.Patch.V1 as V1 ( Patch )
> > -import Darcs.Test.Patch.Test
> > -    ( checkAPatch )
> > +import Darcs.Test.Patch.Properties.Check( checkAPatch )
> >  import Darcs.Witnesses.Ordered
> >  import Darcs.Witnesses.Sealed ( unsafeUnseal )
> >  import Darcs.Witnesses.Unsafe ( unsafeCoerceP, unsafeCoercePEnd )
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 16
> >  import Darcs.Patch.Prim.V1 ( Prim )
> >  import Darcs.Patch.Merge ( Merge )
> >  import qualified Darcs.Patch.V1 as V1 ( Patch )
> > -import Darcs.Test.Patch.Test
> > -    ( checkAPatch, Check )
> > +import Darcs.Test.Patch.Properties.Check ( checkAPatch, Check )
> >  import Printer ( renderPS )
> >  import Darcs.Witnesses.Eq
> >  import Darcs.Witnesses.Ordered
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set2.hs 46
> >  import Test.Framework ( Test )
> >  import Data.Maybe ( isJust )
> >
> > -import Darcs.Test.Patch.Test ( Check, checkAPatch )
> > +import Darcs.Test.Patch.Properties.Check ( Check, checkAPatch )
> >
> >  import Darcs.Patch ( invert, commute, merge,
> >                       readPatch, resolveConflicts,
> > [Print detailed diagnostic in patchAndInverseCommute.
> > Petr Rockai <me@mornfall.net>**20110621141112
> >  Ignore-this: f63f87d199f12fed09226bd43184f203
> > ] hunk ./src/Darcs/Test/Patch/Properties/Generic.hs 150
> >    Nothing -> rejected
> >    Just (y' :> x') ->
> >       case c (invert x :> y') of
> > -       Nothing -> failed (redText "failure in patchAndInverseCommute")
> > +       Nothing -> failed (redText ""
> > +                          $$ redText "-------- original commute (x :>
> y):"
> > +                          $$ showPatch x $$ redText ":>" $$ showPatch y
> > +                          $$ redText "-------- result (y' :> x'):"
> > +                          $$ showPatch y' $$ redText ":>" $$ showPatch
> x'
> > +                          $$ redText "-------- bad commute (invert x :>
> y'):"
> > +                          $$ showPatch (invert x) $$ redText ":>" $$
> showPatch y')
> >         Just (y'' :> ix') ->
> >             case y'' =\/= y of
> >             NotEq -> failed (redText "y'' /= y" $$
> > [Slightly restructure and expand the Prim Arbitrary instances.
> > Petr Rockai <me@mornfall.net>**20110621141234
> >  Ignore-this: bf95d5786f1bc1a3ec2e3e3e361c2384
> > ] hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 332
> >
> >
> >  instance Arbitrary (Sealed2 Prim) where
> > -  arbitrary = makeGen aSmallRepo
> > +  arbitrary = makeS2Gen aSmallRepo
> >
> >  instance Arbitrary (Sealed2 (Prim :> Prim)) where
> >    arbitrary = do repo <- aSmallRepo
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 345
> >                   return $ seal pp
> >
> >  instance Arbitrary (Sealed2 (Prim :> Prim :> Prim)) where
> > -  arbitrary = makeGen aSmallRepo
> > +  arbitrary = makeS2Gen aSmallRepo
> >
> >  instance Arbitrary (Sealed2 (FL Prim)) where
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 348
> > -  arbitrary = makeGen aSmallRepo
> > +  arbitrary = makeS2Gen aSmallRepo
> > +
> > +instance Arbitrary (Sealed ((FL Prim) C(a))) where
> > +  arbitrary = makeSGen aSmallRepo
> >
> >  instance Arbitrary (Sealed2 (FL Prim :> FL Prim)) where
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 354
> > -  arbitrary = makeGen aSmallRepo
> > +  arbitrary = makeS2Gen aSmallRepo
> >
> >  instance Arbitrary (Sealed ((FL Prim :> FL Prim) C(a))) where
> >    arbitrary = makeSGen aSmallRepo
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 360
> >
> >  instance Arbitrary (Sealed2 (WithState RepoModel Prim)) where
> > +  arbitrary = makeWS2Gen aSmallRepo
> > +
> > +instance Arbitrary (Sealed (WithState RepoModel Prim C(a))) where
> > +  arbitrary = makeWSGen aSmallRepo
> > +
> > +instance Arbitrary (Sealed (WithState RepoModel (FL Prim) C(a))) where
> >    arbitrary = makeWSGen aSmallRepo
> >
> >  instance Arbitrary (Sealed2 (WithState RepoModel (Prim :> Prim))) where
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 375
> >
> >
> >  instance Arbitrary (Sealed2 (WithState RepoModel (FL Prim))) where
> > -  arbitrary = makeWSGen aSmallRepo
> > +  arbitrary = makeWS2Gen aSmallRepo
> >
> >  instance Arbitrary (Sealed2 (WithState RepoModel (FL Prim :> FL Prim)))
> where
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 378
> > -  arbitrary = makeWSGen aSmallRepo
> > +  arbitrary = makeWS2Gen aSmallRepo
> > hunk ./src/Darcs/Test/Patch/WithState.hs 110
> >                                        arbitraryFL k s
> >
> >
> > -makeGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2 p)
> > -makeGen stGen = do s <- stGen
> > -                   Sealed (WithEndState p _) <- arbitraryState s
> > -                   return $ seal2 p
> > +makeS2Gen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2 p)
> > +makeS2Gen stGen = do s <- stGen
> > +                     Sealed (WithEndState p _) <- arbitraryState s
> > +                     return $ seal2 p
> >
> >  makeSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed (p C(x)))
> >  makeSGen stGen = do s <- stGen
> > hunk ./src/Darcs/Test/Patch/WithState.hs 120
> >                      Sealed (WithEndState p _) <- arbitraryState s
> >                      return $ seal p
> >
> > -makeWSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2
> (WithState s p))
> > +makeWS2Gen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed2
> (WithState s p))
> > +makeWS2Gen stGen = do s <- stGen
> > +                      Sealed (WithEndState wsP _) <- arbitraryState s
> > +                      return $ seal2 wsP
> > +
> > +makeWSGen :: ArbitraryState s p => Gen (s C(x)) -> Gen (Sealed
> (WithState s p C(x)))
> >  makeWSGen stGen = do s <- stGen
> >                       Sealed (WithEndState wsP _) <- arbitraryState s
> > hunk ./src/Darcs/Test/Patch/WithState.hs 128
> > -                     return $ seal2 wsP
> > +                     return $ seal wsP
> > +
> > +instance (Show2 p, Show1 s) => Show1 ((WithState s p) C(a)) where
> > +  showDict1 = ShowDictClass
> > +
> > [Further restructuring of QC properties of patches.
> > Petr Rockai <me@mornfall.net>**20110621141311
> >  Ignore-this: 9e3d414e742a6deb6609a2c8dd71faed
> > ] hunk ./src/Darcs/Test/Patch.hs 2
> >  {-# OPTIONS_GHC -fno-warn-orphans #-}
> > +{-# LANGUAGE ImpredicativeTypes #-}
> >  --  Copyright (C) 2002-2005,2007 David Roundy
> >  --
> >  --  This program is free software; you can redistribute it and/or modify
> > hunk ./src/Darcs/Test/Patch.hs 43
> >  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
> >  import Darcs.Patch.RepoPatch( RepoPatch )
> >  import Darcs.Patch.Patchy ( Commute(..), Patchy )
> > +import Darcs.Patch.Merge( Merge )
> >
> >  import Darcs.Test.Patch.Arbitrary.Generic
> >  import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> > hunk ./src/Darcs/Test/Patch.hs 129
> >  commuteReals :: PrimPatch prim => (RealPatch prim :> RealPatch prim) C(x
> y) -> Maybe ((RealPatch prim :> RealPatch prim) C(x y))
> >  commuteReals = commute
> >
> > +-- arbitraryThing :: (FORALL(xx yy) thing C(xx yy) -> t) -> (thing C(a
> b) -> t)
> > +arbitraryThing :: x -> TestGenerator thing (thing x)
> > +arbitraryThing _ f p = f p
> > +
> >  qc_prim :: forall prim C(x y a).
> >             (PrimPatch prim, ArbitraryPrim prim, Show2 prim
> >             , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> > hunk ./src/Darcs/Test/Patch.hs 138
> >             , FromPrim prim
> >             , Arbitrary (Sealed ((prim :> prim) C(a)))
> > +           , Arbitrary (Sealed (prim C(a)))
> > +           , Arbitrary (Sealed (FL prim C(a)))
> >             , Arbitrary (Sealed ((FL prim :> FL prim) C(a)))
> > hunk ./src/Darcs/Test/Patch.hs 141
> > -           , Show1 ((PrimOf prim :> PrimOf prim) C(a))
> > +           , Show1 (prim C(a))
> > +           , Show1 (WithState RepoModel prim C(a))
> > +           , Arbitrary (Sealed (WithState RepoModel prim C(a)))
> > +           , Arbitrary (Sealed (WithState RepoModel (FL prim) C(a)))
> > +           , Show1 ((prim :> prim) C(a))
> >             , Arbitrary (Sealed2 prim)
> >             , Arbitrary (Sealed2 (WithState RepoModel prim))
> >             , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> > hunk ./src/Darcs/Test/Patch.hs 157
> >             , Arbitrary (Sealed2 (FL prim :> FL prim))
> >             ) => prim C(x y) -> [Test]
> >  qc_prim _ =
> > -  [ testProperty "Checking Prim invert symmetry..."
> > -    (unseal2 $ Prop.invertSymmetry :: Sealed2 prim -> TestResult)
> > -  , testProperty "Checking FL Prim invert symmetry..."
> > -    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL prim) -> TestResult)
> > -  , testProperty "Checking Prim invert rollback..."
> > +  [ testProperty "Checking Prim invert rollback..."
> >      (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel prim)
> -> TestResult)
> >    , testProperty "Checking FL Prim invert rollback..."
> >      (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL
> prim)) -> TestResult)
> > hunk ./src/Darcs/Test/Patch.hs 181
> >      --    simpleCheck (recommute
> >      --                 (commute :: Prim :> Prim
> >      --                          -> Maybe (Prim :> Prim)))
> > -  ] ++ commute_properties (undefined :: prim C(x y)) "arbitrary"
> arbitraryCommutePair
> > -    ++ commute_properties (undefined :: FL prim C(x y)) "arbitrary FL"
> arbitraryFLCommutePair
> > -    where arbitraryCommutePair
> > -            :: (FORALL(xx yy) (prim :> prim) C(xx yy) -> t) ->
> > -               ((prim :> prim) C(a bb) -> t)
> > -          arbitraryCommutePair f p = f p
> > -          arbitraryFLCommutePair :: (FORALL(xx yy) (FL prim :> FL prim)
> C(xx yy) -> t) ->
> > -                                    ((FL prim :> FL prim) C(a bb) -> t)
> > -          arbitraryFLCommutePair f p = f p
> > +  ] ++ concat
> > +  [ commute_properties    (undefined :: prim C(x y))    "arbitrary"
>  arbitraryThing'
> > +  , commute_properties    (undefined :: FL prim C(x y)) "arbitrary FL"
> arbitraryThing'
> > +  , patch_properties      (undefined :: prim C(x a))    "arbitrary"
>  arbitraryThing'
> > +  , patch_properties      (undefined :: FL prim C(x a)) "arbitrary FL"
> arbitraryThing'
> > +  , patch_repo_properties (undefined :: prim C(x a))    "arbitrary"
>  arbitraryThing'
> > +  , patch_repo_properties (undefined :: FL prim C(x a)) "arbitrary FL"
> arbitraryThing'
> > +  ]
> > +      where arbitraryThing' = arbitraryThing (undefined :: a) -- bind
> the witness for generator
> >
> >  qc_V2P1 :: [Test]
> >  qc_V2P1 =
> > hunk ./src/Darcs/Test/Patch.hs 219
> >      (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t &&
> notDuplicatestriple t))
> >      (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity
> commuteReals))
> >
> > -  ] ++ merge_properties (undefined :: RealPatch Prim C(x y)) "tree"
> mergePairFromTree
> > -    ++ merge_properties (undefined :: RealPatch Prim C(x y)) "twfp"
> mergePairFromTWFP
> > -    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "tree"
> commutePairFromTree
> > -    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "twfp"
> commutePairFromTWFP
> > +  ] ++ concat
> > +  [ merge_properties   (undefined :: RealPatch Prim C(x y)) "tree"
> mergePairFromTree
> > +  , merge_properties   (undefined :: RealPatch Prim C(x y)) "twfp"
> mergePairFromTWFP
> > +  , commute_properties (undefined :: RealPatch Prim C(x y)) "tree"
> commutePairFromTree
> > +  , commute_properties (undefined :: RealPatch Prim C(x y)) "twfp"
> commutePairFromTWFP
> > +  , patch_properties   (undefined :: RealPatch Prim C(x y)) "tree"
> patchFromTree
> > +  ]
> > +
> > +type TestGenerator thing gen = (FORALL(t ctx) ((FORALL(xx yy) thing xx
> yy -> t) -> (gen ctx -> t)))
> > +type TestCondition thing = (FORALL (yy zz) thing C(yy zz) -> Bool)
> > +type TestCheck thing t = (FORALL (yy zz) thing C(yy zz) -> t)
> >
> > hunk ./src/Darcs/Test/Patch.hs 231
> > -commute_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf
> p), FromPrim p
> > -                                       , Show2 p, Show2 (PrimOf p),
> Patchy p
> > -                                       , Show1 gen, Arbitrary (Sealed
> gen))
> > -                 => p C(x y) -> String ->
> > -                    (FORALL(ctx t) ((FORALL(xx yy) (p :> p) xx yy -> t)
> -> (gen ctx -> t))) ->
> > -                    [Test]
> > +properties :: forall thing gen. (Show1 gen, Arbitrary (Sealed gen)) =>
> > +              TestGenerator thing gen
> > +           -- -> forall xx yy. thing xx yy
> > +           -> String -> String
> > +           -> forall t. Testable t => [(String, TestCondition thing,
> TestCheck thing t)]
> > +           -> [Test]
> > +properties gen prefix genname tests =
> > +  [ cond name condition check | (name, condition, check) <- tests ]
> > +  where cond :: forall testable. Testable testable
> > +             => String -> TestCondition thing -> TestCheck thing
> testable -> Test
> > +        cond t c p =
> > +          testConditional (prefix ++ " (" ++ genname ++ "): " ++ t)
> (unseal $ gen c) (unseal $ gen p)
> > +
> > +commute_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed gen),
> Patchy p)
> > +                   => FORALL(xx yy) p C(xx yy)
> > +                   -> String
> > +                   -> TestGenerator (p :> p) gen
> > +                   -> [Test]
> >  commute_properties _ genname gen =
> > hunk ./src/Darcs/Test/Patch.hs 250
> > -  [ prop "recommute" $ Prop.recommute commute
> > -  , cond "nontrivial recommute" nontrivialCommute $ Prop.recommute
> commute
> > -  , prop "inverses commute" $ Prop.commuteInverses commute
> > -  , cond "nontrivial inverses" nontrivialCommute $ Prop.commuteInverses
> commute
> > +  properties gen "commute" genname
> > +  [ ("recommute"              , const True       , Prop.recommute
> commute             )
> > +  , ("nontrivial recommute"   , nontrivialCommute, Prop.recommute
> commute             )
> > +  , ("inverses commute"       , const True       , Prop.commuteInverses
> commute       )
> > +  , ("nontrivial inverses"    , nontrivialCommute, Prop.commuteInverses
> commute       )
> > +  -- XXX the following tend to fail :(
> > +  -- , ("patch & inverse commute", const True       ,
> Prop.patchAndInverseCommute commute)
> > +  -- , ("patch & inverse commute", nontrivialCommute,
> Prop.patchAndInverseCommute commute)
> >    ]
> > hunk ./src/Darcs/Test/Patch.hs 259
> > -  where prop :: String -> (FORALL (yy zz) (p :> p) C(yy zz) ->
> TestResult) -> Test
> > -        prop t p = cond t (const True) p
> > -        cond :: String ->
> > -                (FORALL (yy zz) (p :> p) C(yy zz) -> Bool) ->
> > -                (FORALL (yy zz) (p :> p) C(yy zz) -> TestResult) -> Test
> > -        cond t c p =
> > -          testConditional ("commute (" ++ genname ++ "): " ++ t)
> > -          (unseal $ gen c) (unseal $ gen p)
> >
> > hunk ./src/Darcs/Test/Patch.hs 260
> > -merge_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf
> p), FromPrim p
> > -                                      , Show2 p, Show2 (PrimOf p),
> RepoPatch p
> > -                                      , Show1 gen, Arbitrary (Sealed
> gen))
> > -                 => p C(x y) -> String ->
> > -                    (FORALL(ctx t) ((FORALL(xx yy) (p :\/: p) xx yy ->
> t) -> (gen ctx -> t))) ->
> > -                    [Test]
> > +patch_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed gen),
> Patchy p)
> > +                 => FORALL(xx yy) p C(xx yy)
> > +                 -> String
> > +                 -> TestGenerator p gen
> > +                 -> [Test]
> > +patch_properties _ genname gen =
> > +  properties gen "patch" genname
> > +  [ ("inverse . inverse is id"  , const True       ,
> Prop.invertSymmetry)
> > +  ]
> > +
> > +patch_repo_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed
> gen), Patchy p)
> > +                      => FORALL(xx yy) p C(xx yy)
> > +                      -> String
> > +                      -> TestGenerator (WithState RepoModel p) gen
> > +                      -> [Test]
> > +patch_repo_properties _ genname gen =
> > +  properties gen "patch/repo" genname
> > +  [ ("invert rollback"          , const True       ,
> Prop.invertRollback)
> > +  ]
> > +
> > +merge_properties :: forall p gen. (Show1 gen, Arbitrary (Sealed gen)
> > +                                  , Patchy p, Merge p, Show2 p, Check p)
> > +                 => FORALL(xx yy) p C(xx yy)
> > +                 -> String
> > +                 -> TestGenerator (p :\/: p) gen
> > +                 -> [Test]
> >  merge_properties _ genname gen =
> > hunk ./src/Darcs/Test/Patch.hs 287
> > -    [ prop "merge swap" Prop.tMergeSwapMerge
> > -    , prop "merge either way" Prop.mergeEitherWay
> > -    , prop "merge either way valid" Prop.tMergeEitherWayValid
> > -    , cond "nontrivial merge either way" nontrivialMerge
> Prop.mergeEitherWay
> > -    ]
> > -  where prop :: Testable t => String -> (FORALL (yy zz) (p :\/: p) C(yy
> zz) -> t) -> Test
> > -        prop t p = cond t (const True) p
> > -        cond :: (Testable t) => String ->
> > -                (FORALL (yy zz) (p :\/: p) C(yy zz) -> Bool) ->
> > -                (FORALL (yy zz) (p :\/: p) C(yy zz) -> t) -> Test
> > -        cond t c p =
> > -          testConditional ("merge (" ++ genname ++ "): " ++ t)
> > -          (unseal $ gen c) (unseal $ gen p)
> > +  properties gen "merge" genname
> > +  [ ("merge swap"                 , const True     ,
> Prop.tMergeSwapMerge     )
> > +  , ("merge either way"           , const True     , Prop.mergeEitherWay
>      )
> > +  , ("merge either way valid"     , const True     ,
> Prop.tMergeEitherWayValid)
> > +  , ("nontrivial merge either way", nontrivialMerge, Prop.mergeEitherWay
>      )
> > +  , ("merge commute"              , const True     , Prop.mergeCommute
>      )
> > +  ]
> >
> >  qc_V1P1 :: [Test]
> >  qc_V1P1 =
> > [Replace tCommuteRecommute with recommute from Properties.Generic.
> > Petr Rockai <me@mornfall.net>**20110621142250
> >  Ignore-this: 51cf667adc21f849934930499ddf60d0
> > ] hunk ./src/Darcs/Test/Patch.hs 88
> >    , runPrimitiveTests "Checking known canons" Prop.checkCanon
> Ex.knownCanons
> >    , runPrimitiveTests "Checking merge swaps" Prop.checkMergeSwap
> Ex.mergePairs2
> >    , runPrimitiveTests "Checking that the patch validation works"
> Prop.tTestCheck Ex.validPatches
> > -  , runPrimitiveTests "Checking commute/recommute"
> Prop.tCommuteRecommute Ex.commutePairs
> > +  , runPrimitiveTests "Checking commute/recommute" (Prop.recommute
> commute) Ex.commutePairs
> >    , runPrimitiveTests "Checking merge properties: merge either way
> valid" Prop.tMergeEitherWayValid Ex.mergePairs
> >    , runPrimitiveTests "Checking merge properties: merge swap"
> Prop.tMergeSwapMerge Ex.mergePairs
> >    , runPrimitiveTests "Checking primitive patch IO functions"
> (Prop.tShowRead eqFLUnsafe) Ex.primitiveTestPatches
> > hunk ./src/Darcs/Test/Patch.hs 94
> >    , runPrimitiveTests "Checking IO functions (test patches)"
> (Prop.tShowRead eqFLUnsafe) Ex.testPatches
> >    , runPrimitiveTests "Checking IO functions (named test patches)"
> (Prop.tShowRead unsafeCompare) Ex.testPatchesNamed
> > -  , runPrimitiveTests "Checking primitive commute/recommute"
> Prop.tCommuteRecommute Ex.primitiveCommutePairs
> > +  , runPrimitiveTests "Checking primitive commute/recommute"
> (Prop.recommute commute) Ex.primitiveCommutePairs
> >    ]
> >
> >  unit_V2P1 :: [Test]
> > hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 116
> >  -- the result gives us patch A and patch B again.  The set of patches
> (A,B)
> >  -- is chosen from the set of all pairs of test patches by selecting
> those which
> >  -- commute with one another.
> > -commutePairs :: [(FL Patch :< FL Patch) C(x y)]
> > +commutePairs :: [(FL Patch :> FL Patch) C(x y)]
> >  commutePairs =
> > hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 118
> > -  take 200 [(p2:<p1)|
> > +  take 200 [(p1:>p2)|
> >              p1<-testPatches,
> >              p2<-filter (\p->checkAPatch (p1:>:p:>:NilFL)) testPatches,
> >              commute (p1:>p2) /= Nothing]
> > hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 123
> >
> > -primitiveCommutePairs :: [(FL Patch :< FL Patch) C(x y)]
> > +primitiveCommutePairs :: [(FL Patch :> FL Patch) C(x y)]
> >  primitiveCommutePairs =
> > hunk ./src/Darcs/Test/Patch/Examples/Set1.hs 125
> > -  [(p1:<p2)|
> > +  [(p2:>p1)|
> >     p1<-primitiveTestPatches,
> >     p2<-primitiveTestPatches,
> >     commute (p2:>p1) /= Nothing,
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 6
> >  module Darcs.Test.Patch.Properties.V1Set1
> >         ( checkMerge, checkMergeEquiv, checkMergeSwap, checkCanon
> >         , checkCommute, checkCantCommute
> > -       , tCommuteRecommute, tMergeSwapMerge, tShowRead
> > +       , tMergeSwapMerge, tShowRead
> >         , tMergeEitherWayValid, tTestCheck ) where
> >
> >  import Darcs.Patch
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 163
> >            eqSwapped (x1 :/\: y1) (y2 :/\: x2) | unsafeCompare x1 x2,
> unsafeCompare y1 y2 = True
> >            eqSwapped _ _ = False
> >
> > -tCommuteRecommute :: FORALL(x y) (FL Patch :< FL Patch) C(x y) ->
> TestResult
> > -tCommuteRecommute (p1 :< p2) =
> > -    if (commute (p2:>p1) >>= commute) == Just (p2:>p1)
> > -       then succeeded
> > -       else failed $ text $ "Failed to recommute:\n"++(show p2)++(show
> p1)++
> > -            "we saw it as:\n"++show (commute (p2:>p1))++
> > -             "\nAnd recommute was:\n"++show (commute (p2:>p1) >>=
> commute)
> > -             ++ "\n"
> > -
> >  tTestCheck :: FORALL(x y) FL Patch C(x y) -> TestResult
> >  tTestCheck p = if checkAPatch p
> >                   then succeeded
> > [Replace tMergeSwapMerge with Properties.Generic mergeEitherWay.
> > Petr Rockai <me@mornfall.net>**20110621142303
> >  Ignore-this: 6c9e1def0a1773fbf3785985b3a0355f
> > ] hunk ./src/Darcs/Test/Patch.hs 90
> >    , runPrimitiveTests "Checking that the patch validation works"
> Prop.tTestCheck Ex.validPatches
> >    , runPrimitiveTests "Checking commute/recommute" (Prop.recommute
> commute) Ex.commutePairs
> >    , runPrimitiveTests "Checking merge properties: merge either way
> valid" Prop.tMergeEitherWayValid Ex.mergePairs
> > -  , runPrimitiveTests "Checking merge properties: merge swap"
> Prop.tMergeSwapMerge Ex.mergePairs
> > +  , runPrimitiveTests "Checking merge properties: merge swap"
> Prop.mergeEitherWay Ex.mergePairs
> >    , runPrimitiveTests "Checking primitive patch IO functions"
> (Prop.tShowRead eqFLUnsafe) Ex.primitiveTestPatches
> >    , runPrimitiveTests "Checking IO functions (test patches)"
> (Prop.tShowRead eqFLUnsafe) Ex.testPatches
> >    , runPrimitiveTests "Checking IO functions (named test patches)"
> (Prop.tShowRead unsafeCompare) Ex.testPatchesNamed
> > hunk ./src/Darcs/Test/Patch.hs 288
> >                   -> [Test]
> >  merge_properties _ genname gen =
> >    properties gen "merge" genname
> > -  [ ("merge swap"                 , const True     ,
> Prop.tMergeSwapMerge     )
> > -  , ("merge either way"           , const True     , Prop.mergeEitherWay
>      )
> > +  [ ("merge either way"           , const True     , Prop.mergeEitherWay
>      )
> >    , ("merge either way valid"     , const True     ,
> Prop.tMergeEitherWayValid)
> >    , ("nontrivial merge either way", nontrivialMerge, Prop.mergeEitherWay
>      )
> >    , ("merge commute"              , const True     , Prop.mergeCommute
>      )
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 6
> >  module Darcs.Test.Patch.Properties.V1Set1
> >         ( checkMerge, checkMergeEquiv, checkMergeSwap, checkCanon
> >         , checkCommute, checkCantCommute
> > -       , tMergeSwapMerge, tShowRead
> > +       , tShowRead
> >         , tMergeEitherWayValid, tTestCheck ) where
> >
> >  import Darcs.Patch
> > hunk ./src/Darcs/Test/Patch/Properties/V1Set1.hs 152
> >                show combo1++
> >                show combo2
> >
> > -tMergeSwapMerge :: forall p x y. (Patchy p, Show2 p, Merge p) => (p :\/:
> p) C(x y) -> TestResult
> > -tMergeSwapMerge (p1 :\/: p2) =
> > -  if merge (p2 :\/: p1) `eqSwapped` merge (p1 :\/: p2)
> > -  then succeeded
> > -  else failed $ text $ "Failed to swap merges:\n"++show2
> p1++"and...\n"++show2 p2
> > -        ++"merged:\n"++show (merge (p1:\/:p2))++"\n"
> > -        ++"merged swapped:\n"++show (merge (p2:\/: p1))++"\n"
> > -    where eqSwapped :: (p :/\: p) C(x_ y_) -> (p :/\: p) C(y_ x_) ->
> Bool
> > -          eqSwapped (x1 :/\: y1) (y2 :/\: x2) | unsafeCompare x1 x2,
> unsafeCompare y1 y2 = True
> > -          eqSwapped _ _ = False
> > -
> >  tTestCheck :: FORALL(x y) FL Patch C(x y) -> TestResult
> >  tTestCheck p = if checkAPatch p
> >                   then succeeded
> >
>
>
>
> > _______________________________________________
> > darcs-devel mailing list
> > darcs-devel@darcs.net
> > http://lists.osuosl.org/mailman/listinfo/darcs-devel
>
>
> --
> Eric Kow <http://erickow.com>
>
> __________________________________
> Darcs bug tracker <bugs@darcs.net>
> <http://bugs.darcs.net/patch631>
> __________________________________
> _______________________________________________
> darcs-devel mailing list
> darcs-devel@darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-devel
>



-- 
Iago Abal Rivas
Attachments
msg14557 (view) Author: mornfall Date: 2011-06-27.19:59:27
Hi!

Some improvements over the last set, plus skeleton of V3 Prims and a simple
Arbitrary instance. Of course, all the tests fail for now.

Next TODO: generalise the Apply class to be able to express patch application
to different state representations (since V3 Prims will require a different
state representation, including a UUID -> Object map, while V1 Prims operate on
a filesystem tree). On top of that, it should be possible to build an Apply
implementation for V3 Prims.

Yours,
   Petr

22 patches for repository http://darcs.net:

Wed Apr 27 03:12:50 CEST 2011  Petr Rockai <me@mornfall.net>
  * Fix a couple of GHC 7 deprecation warnings.

Sun May 22 13:38:37 CEST 2011  Petr Rockai <me@mornfall.net>
  * Bootstrap the V3 Prim patches as a clone of V1.

Wed Jun  1 10:17:41 CEST 2011  Petr Rockai <me@mornfall.net>
  * Cut down the initial Prim V3 code to +/- compilable minimum.

Sun Jun  5 23:55:12 CEST 2011  Petr Rockai <me@mornfall.net>
  * Merge Set2, Set2Unwitnessed and Set3Unwitnessed in Test.Patch.Examples.
  
  Set2 have been only used to implement Set3, and not directly by any
  tests. Everything is internal to Set2Unwitnessed now.

Mon Jun 20 11:06:41 CEST 2011  Petr Rockai <me@mornfall.net>
  * Add a Show1 instance for (:>).

Mon Jun 20 11:06:58 CEST 2011  Petr Rockai <me@mornfall.net>
  * Make (V1) Prim an instance of PrimPatchBase/FromPrim.

Mon Jun 20 11:07:18 CEST 2011  Petr Rockai <me@mornfall.net>
  * Remove redundant imports in Darcs.Repository.Internal.

Mon Jun 20 11:18:10 CEST 2011  Petr Rockai <me@mornfall.net>
  * Reorganise the Patch tests further.

Mon Jun 20 14:30:27 CEST 2011  Petr Rockai <me@mornfall.net>
  * Generalise the V1.Prim Arbitrary instance based on Tree to any PrimPatch.

Mon Jun 20 14:33:54 CEST 2011  Petr Rockai <me@mornfall.net>
  * Generalise a bunch of merge/commute properties over the patch type & generator.

Mon Jun 20 15:36:51 CEST 2011  Petr Rockai <me@mornfall.net>
  * Split Test.Patch.Test into Properties.Check and Arbitrary.PatchV1.

Tue Jun 21 16:11:12 CEST 2011  Petr Rockai <me@mornfall.net>
  * Print detailed diagnostic in patchAndInverseCommute.

Tue Jun 21 16:12:34 CEST 2011  Petr Rockai <me@mornfall.net>
  * Slightly restructure and expand the Prim Arbitrary instances.

Tue Jun 21 16:13:11 CEST 2011  Petr Rockai <me@mornfall.net>
  * Further restructuring of QC properties of patches.

Tue Jun 21 16:22:50 CEST 2011  Petr Rockai <me@mornfall.net>
  * Replace tCommuteRecommute with recommute from Properties.Generic.

Tue Jun 21 16:23:03 CEST 2011  Petr Rockai <me@mornfall.net>
  * Replace tMergeSwapMerge with Properties.Generic mergeEitherWay.

Sun Jun 26 23:57:54 CEST 2011  Petr Rockai <me@mornfall.net>
  * Add a forgotten Properties.Check module to Test.Patch.

Mon Jun 27 00:52:50 CEST 2011  Petr Rockai <me@mornfall.net>
  * Wibble the V3 Prim skeleton a bit.

Mon Jun 27 00:53:32 CEST 2011  Petr Rockai <me@mornfall.net>
  * Lift RepoModel into a class and rename the implementation to V1Model.

Mon Jun 27 00:53:47 CEST 2011  Petr Rockai <me@mornfall.net>
  * Implement V3Model and rudimentary V3.Prim Arbitrary instances.

Mon Jun 27 01:28:21 CEST 2011  Petr Rockai <me@mornfall.net>
  * Replace FunctionalDependencies with TypeFamilies in new test code.

Mon Jun 27 01:29:15 CEST 2011  Petr Rockai <me@mornfall.net>
  * Remove unneeded LANGUAGE pragmas from Examples.Set2Unwitnessed.
Attachments
msg14583 (view) Author: iago Date: 2011-07-11.10:25:38
It looks fine for me.

I took a look to the Prim.V3 code, it is mostly incomplete so I cannot do
lot of comments for now. But as I said to Petr in the IRC I think we should
avoid the use of "Int" type to represent offset because now it is likely to
produce overflow in some (perhaps not so rare) situations.

For now I think the reorganization of the testing code is good, at least
with respect to the QC code I was working on. I will take another look
during this week to see some stuff with more detail. Just some remark, I
think we should adopt some convention to name TestSuite modules, because now
under Darcs.Test you can find many kind of modules, and it continues to grow
it will become hard to distinguish one from others. Darcs.Test.Patch.Info is
a test-suite whilst Darcs.Test.Patch.V1Model is another stuff. Maybe we
could end test-suites wih *Test or *Suite, so that would make clear that
Darcs.Test.Patch.InfoSuite is a module which contains the test-suite for
Darcs.Patch.Info.

On Sun, Jun 26, 2011 at 9:54 AM, Eric Kow <bugs@darcs.net> wrote:

>
> Eric Kow <kowey@darcs.net> added the comment:
>
> Hi Iago,
>
> As you may be aware, Petr is working on GSoC project towards V3 of Darcs
> primitive patches [1].  He wants to do it in a TDD way (!), but writing
> all the Arbitrary instances is quite boring and involves cleaning up a
> lot of the pre-existing QC infrastructure.  Do you think you might have
> time and/or be interested in commenting on his cleanup patch?
>
> Thanks!
>
> Eric
>
> [1]
> http://web.mornfall.net/blog/soc_reloaded:_darcs_primitive_patches_version_3.html
>
> On Tue, Jun 21, 2011 at 17:46:44 +0000, Petr Ročkai wrote:
> > More test suite reworking. It does use ImpredicativeTypes, but this
> should be
> > fairly harmless (I haven't tried with anything but GHC7 yet, though). I'd
> > expect more things could be conflated (some properties are still at least
> > duplicated, if not triplicated). There are quite a few properties that
> are
> > simply commented out and something should be done about those as well
> (probably
> > removing them or maybe fixing them).
> >
> > I'll keep conflating commonalities together, although I think that reuse
> is now
> > quite good. It also shows that our property coverage is rather weak: even
> > though the original test lists were pretty long, they were more or less
> just
> > repeating themselves.
> >
> > I'll still do some final cleanups, but other than that, I am done with
> the
> > test-suite for now, on the general level. I'll write arbitrary instances
> for V3
> > Prims next and then based on that, I'll start adding properties and fill
> in the
> > V3 implementation. I expect that the properties will be reusable in other
> > contexts, with the current testsuite structure.
> >
> > Yours,
> >    Petr
> >
> > 13 patches for repository http://darcs.net:
> >
> > Sun Jun  5 23:55:12 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Merge Set2, Set2Unwitnessed and Set3Unwitnessed in
> Test.Patch.Examples.
> >
> >   Set2 have been only used to implement Set3, and not directly by any
> >   tests. Everything is internal to Set2Unwitnessed now.
> >
> > Mon Jun 20 11:06:41 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Add a Show1 instance for (:>).
> >
> > Mon Jun 20 11:06:58 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Make (V1) Prim an instance of PrimPatchBase/FromPrim.
> >
> > Mon Jun 20 11:07:18 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Remove redundant imports in Darcs.Repository.Internal.
> >
> > Mon Jun 20 11:18:10 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Reorganise the Patch tests further.
> >
> > Mon Jun 20 14:30:27 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Generalise the V1.Prim Arbitrary instance based on Tree to any
> PrimPatch.
> >
> > Mon Jun 20 14:33:54 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Generalise a bunch of merge/commute properties over the patch type &
> generator.
> >
> > Mon Jun 20 15:36:51 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Split Test.Patch.Test into Properties.Check and Arbitrary.PatchV1.
> >
> > Tue Jun 21 16:11:12 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Print detailed diagnostic in patchAndInverseCommute.
> >
> > Tue Jun 21 16:12:34 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Slightly restructure and expand the Prim Arbitrary instances.
> >
> > Tue Jun 21 16:13:11 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Further restructuring of QC properties of patches.
> >
> > Tue Jun 21 16:22:50 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Replace tCommuteRecommute with recommute from Properties.Generic.
> >
> > Tue Jun 21 16:23:03 CEST 2011  Petr Rockai <me@mornfall.net>
> >   * Replace tMergeSwapMerge with Properties.Generic mergeEitherWay.
> >
> > ----------
> > files:
> merge-set2_-set2unwitnessed-and-set3unwitnessed-in-test_patch_examples_.dpatch,
> unnamed, unnamed
> > messages: 14546
> > nosy: mornfall
> > status: needs-screening
> > title: Merge Set2, Set2Unwitnessed and Set3Unwi... (and 12 more)
> >
> > __________________________________
> > Darcs bug tracker <bugs@darcs.net>
> > <http://bugs.darcs.net/patch631>
> > __________________________________
>
> >
> > [Merge Set2, Set2Unwitnessed and Set3Unwitnessed in Test.Patch.Examples.
> > Petr Rockai <me@mornfall.net>**20110605215512
> >  Ignore-this: 8c718a43d7e780f582b91900dd7464c5
> >
> >  Set2 have been only used to implement Set3, and not directly by any
> >  tests. Everything is internal to Set2Unwitnessed now.
> > ] hunk ./src/Darcs/Test/Patch/Examples/Set2.hs 1
> > -{-# LANGUAGE CPP #-}
> > -
> > -#include "gadts.h"
> > -
> > -module Darcs.Test.Patch.Examples.Set2
> > -    ( mergeExamples, commuteExamples, tripleExamples
> > -    , realPatchLoopExamples
> > -    )
> > -    where
> > -
> > -import Darcs.Patch.Invert ( Invert )
> > -import Darcs.Patch.Merge ( Merge )
> > -import Darcs.Patch.Prim ( PrimPatchBase(..), FromPrim )
> > -import Darcs.Patch.Prim.V1.Core ( Prim(FP), FilePatchType(Hunk) )
> > -import Darcs.Patch.FileName ( FileName, fp2fn )
> > -
> > -import Darcs.Witnesses.Ordered ( (:>), (:\/:) )
> > -import Darcs.Witnesses.Sealed ( Sealed(..), Sealed2, seal2, unseal2 )
> > -
> > -import qualified Data.ByteString as B ( ByteString )
> > -import qualified Data.ByteString.Char8 as BC ( pack )
> > -
> > -import Darcs.Test.Patch.RepoModel ( RepoModel, Content
> > -                                   , makeRepo, makeName, makeFile)
> > -import Darcs.Test.Patch.WithState ( WithStartState(..) )
> > -
> > -import Darcs.Test.Patch.Arbitrary.Generic
> > -    ( Tree(..)
> > -    , TreeWithFlattenPos(..)
> > -    , commutePairFromTree, commuteTripleFromTree
> > -    , mergePairFromCommutePair, commutePairFromTWFP
> > -    , canonizeTree
> > -    )
> > -import Darcs.Test.Patch.Arbitrary.PrimV1 () -- instances
> > -
> > -
> > -
> > -makeSimpleRepo :: String -> Content -> RepoModel C(x)
> > -makeSimpleRepo filename content = makeRepo [(makeName filename, makeFile
> content)]
> > -
> > -
> > -tripleExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p,
> PrimOf p ~ Prim) => [Sealed2 (p :> p :> p)]
> > -tripleExamples = [commuteTripleFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "g"]))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "j"]))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"])) NilTree)))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "e"])) NilTree))
> > -                  ,commuteTripleFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack "j"])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"]))
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > -                  ]
> > -
> > -
> > -mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf
> p ~ Prim) => [Sealed2 (p :\/: p)]
> > -mergeExamples = map (unseal2 (mergePairFromCommutePair seal2))
> commuteExamples
> > -
> > -commuteExamples :: (FromPrim p, Merge p, PrimPatchBase p, PrimOf p ~
> Prim) => [Sealed2 (p :> p)]
> > -commuteExamples = [
> > -                   commutePairFromTWFP seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [])
> > -                   (TWFP 3
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "b"]))
> > -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"]))
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"]))
> > -                           (SeqTree (FP (fp2fn "./file") (Hunk 2
> [BC.pack "f"] [])) NilTree)))))),
> > -                   commutePairFromTWFP seal2 $
> > -                   WithStartState
> > -                   (makeSimpleRepo "file" [BC.pack "f",BC.pack
> "s",BC.pack "d"])
> > -                   (TWFP 3
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "d"]
> [])) NilTree)
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] [])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "s",BC.pack "d"] []))
> > -                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"])) NilTree)))))),
> > -{-                   commutePairFromTWFP seal2 $
> > -                   WithStartState
> > -                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "u",
> > -                                            BC.pack "s",BC.pack "d"])
> > -                   (TWFP 5
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 5 [] [BC.pack
> "x"]))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack
> "d"] [])) NilTree))
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "u"] [])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > -                       (SeqTree (FP(fp2fn "./file") (Hunk 1 [BC.pack
> "u",BC.pack "s",BC.pack "d"] []))
> > -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "a"]))
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "a"] [])) NilTree))))))),-}
> > -                   commutePairFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack
> "n",BC.pack "t",BC.pack "h"])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "n",BC.pack "t",BC.pack "h"] []))
> > -                     NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "h"]
> []))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n"]
> []))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t"] [])) NilTree)))),
> > -                  commutePairFromTree seal2 $
> > -                  WithStartState (makeSimpleRepo "file" [])
> > -                  (ParTree
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "n"])) NilTree)
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "i"]))
> > -                                (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "i"])) NilTree))),
> > -                  commutePairFromTree seal2 $
> > -                  WithStartState (makeSimpleRepo "file" [])
> > -                  (ParTree
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"]))
> > -                     (ParTree
> > -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "c"] [BC.pack "r"])) NilTree)
> > -                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > -                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "d"])) NilTree))))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)),
> > -                  commutePairFromTWFP seal2 $
> > -                  WithStartState (makeSimpleRepo "file" [])
> > -                  (TWFP 1
> > -                  (ParTree
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree))),
> > -                   commutePairFromTWFP seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack
> "f",BC.pack " r",
> > -                                                            BC.pack
> "c",BC.pack "v"])
> > -                   (TWFP 4
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack
> "c",BC.pack "v"] []))
> > -                        (ParTree
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "r"] []))
> > -                          (SeqTree (FP (fp2fn "fi le") (Hunk 1 [BC.pack
> "f"] [])) NilTree))
> > -                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "r"] []))
> > -                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "y"])) NilTree))))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "v"]
> [])) NilTree))),
> > -                   commutePairFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [])
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree)
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)
> > -                     (ParTree
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "r"])) NilTree)
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "d"])) NilTree))))
> > -                 , commutePairFromTree seal2 $
> > -                   WithStartState (makeSimpleRepo "file" [BC.pack
> "t",BC.pack "r",BC.pack "h"])
> > -                   (ParTree
> > -                    (ParTree
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t",BC.pack "r",BC.pack "h"] []))
> > -                              NilTree)
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "o"])) NilTree))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"]
> []))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "h"]
> [])) NilTree)))
> > -                 , commutePairFromTWFP seal2 $
> > -                   WithStartState (makeSimpleRepo "file" []) $
> > -                   TWFP 2
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "y"]))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "m"]))
> > -                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "p"]))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "p"]
> []))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"])) NilTree)))
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree)
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree)))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [BC.pack
> "x",BC.pack "c"])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > -                   (ParTree
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c"]
> [])) NilTree)
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "x"]
> []))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "j"])) NilTree))))
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "l"])) NilTree))
> > -                 , commutePairFromTree seal2 $
> > -                 WithStartState (makeSimpleRepo "file" [])
> > -                 (ParTree
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "s"))) NilTree)
> > -                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "k")))
> > -                   (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "k") []))
> > -                    (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "m")))
> > -                     (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "m") [])) NilTree)))))
> > -                 ]
> > -
> > -packStringLetters :: String -> [B.ByteString]
> > -packStringLetters = map (BC.pack . (:[]))
> > -
> > -realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> > -realPatchLoopExamples =
> > -    [Sealed (WithStartState (makeSimpleRepo fx_name [])
> > -     $ canonizeTree
> > -     (ParTree
> > -      (SeqTree (FP fx (Hunk 1 [] (packStringLetters
> "pkotufogbvdabnmbzajvolwviqebieonxvcvuvigkfgybmqhzuaaurjspd")))
> > -       (ParTree
> > -        (SeqTree (FP fx (Hunk 47 (packStringLetters "qhzu")
> (packStringLetters "zafybdcokyjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmh")))
> > -         (ParTree
> > -          (ParTree
> > -           NilTree
> > -           (ParTree
> > -            (ParTree
> > -             (ParTree
> > -              (SeqTree (FP fx (Hunk 15 (packStringLetters
> "mbzajvolwviqebieonxvcvuvigkfgyb") (packStringLetters
> "vujnxnhvybvpouyciaabszfmgssezlwwjgnethvrpnfrkubphzvdgymjjoacppqps")))
> > -               (ParTree
> > -                NilTree
> > -                (ParTree
> > -                 (SeqTree (FP fx (Hunk 40 (packStringLetters
> "ssezlwwjgnethvrpnfrkubphzvdgymjjoacppqpsmzafybdcokyjskcgnvhkbz")
> (packStringLetters "wnesidpccwoiqiichxaaejdsyrhrusqljlcoro")))
> > -                  (ParTree
> > -                   (ParTree
> > -                    (SeqTree (FP fx (Hunk 12 (packStringLetters
> "abnvujnxnhvybvpouyciaabszfmgwnesidpccwoiqii") (packStringLetters
> "czfdhqkipdstfjycqaxwnbxrihrufdeyneqiiiafwzlmg"))) NilTree)
> > -                    NilTree)
> > -                   NilTree))
> > -                 (SeqTree (FP fx (Hunk 25 [] (packStringLetters
> "dihgmsotezucqdgxczvcivijootyvhlwymbiueufnvpwpeukmskqllalfe"))) NilTree))))
> > -              (SeqTree (FP fx (Hunk 56 (packStringLetters
> "yjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmhaaurjsp") (packStringLetters
> "xldhrutyhcyaqeezwujiguawfyawjjqlirxshjddvq"))) NilTree))
> > -             (SeqTree (FP fx (Hunk 20 [] (packStringLetters
> "ooygwiyogqrqnytixqtmvdxx")))
> > -              (SeqTree (FP fx (Hunk 26 (packStringLetters
> "yogqrqnytixqtmvdxxvolwviqebieonxvcvuvigkfgybmzafybdcokyjskcgnvhkbz")
> (packStringLetters "akhsmlbkdxnvfoikmiatfbpzdrsyykkpoxvvddeaspzxe")))
> > -               (SeqTree (FP fx (Hunk 39 [] (packStringLetters "ji")))
> > -                (ParTree
> > -                 NilTree
> > -                 (ParTree
> > -                  NilTree
> > -                  (ParTree
> > -                   (ParTree
> > -                    NilTree
> > -                    (SeqTree (FP fx (Hunk 26 (packStringLetters
> "akhsmlbkdxnvfjioikmiatfbpzdrsyykkpoxvvddeaspzxepysaafnjjhcstgrczplxs")
> (packStringLetters "onjbhddskcj")))
> > -                     (SeqTree (FP fx (Hunk 39 [] (packStringLetters
> "fyscunxxxjjtyqpfxeznhtwvlphmp"))) NilTree)))
> > -                   (ParTree
> > -                    NilTree
> > -                    (SeqTree (FP fx (Hunk 44 [] (packStringLetters
> "xcchzwmzoezxkmkhcmesplnjpqriypshgiqklgdnbmmkldnydiy")))
> > -                     (ParTree
> > -                      NilTree
> > -                      (SeqTree (FP fx (Hunk 64 (packStringLetters
> "plnjpqriypshgiqklgdnbmmkldnydiymiatfbpzdrsyykkpoxvvddeaspzxepysaafn")
> (packStringLetters "anjlzfdqbjqbcplvqvkhwjtkigp"))) NilTree)))))))))))
> > -            (ParTree
> > -             NilTree
> > -             NilTree)))
> > -          NilTree))
> > -        NilTree))
> > -      (ParTree
> > -       NilTree
> > -       (SeqTree (FP fx (Hunk 1 [] (packStringLetters "ti")))
> > -        (SeqTree (FP fx (Hunk 1 (packStringLetters "t")
> (packStringLetters "ybcop")))
> > -         (SeqTree (FP fx (Hunk 2 [] (packStringLetters
> "dvlhgwqlpaeweerqrhnjtfolczbqbzoccnvdsyqiefqitrqneralf")))
> > -          (SeqTree (FP fx (Hunk 15 [] (packStringLetters
> "yairbjphwtnaerccdlfewujvjvmjakbc")))
> > -           (SeqTree (FP fx (Hunk 51 [] (packStringLetters
> "xayvfuwaiiogginufnhsrmktpmlbvxiakjwllddkiyofyfw")))
> > -            (ParTree
> > -             NilTree
> > -             NilTree)))))))))]
> > -  where
> > -      fx_name :: String
> > -      fx_name = "F"
> > -
> > -      fx :: FileName
> > -      fx = fp2fn "./F"
> > -
> > rmfile ./src/Darcs/Test/Patch/Examples/Set2.hs
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 1
> > -module Darcs.Test.Patch.Examples.Set2Unwitnessed where
> > -
> > -import qualified Darcs.Test.Patch.Examples.Set2 as W
> > -     ( mergeExamples, commuteExamples, tripleExamples
> > -     , realPatchLoopExamples
> > -     )
> > -import Darcs.Test.Patch.RepoModel ( RepoModel )
> > -import Darcs.Test.Patch.WithState ( WithStartState )
> > -import Darcs.Test.Patch.WSub
> > -import Darcs.Test.Patch.Arbitrary.Generic ( Tree )
> > -
> > -import Darcs.Witnesses.Sealed
> > -
> > -import Darcs.Patch.Prim.V1 ( Prim )
> > -import Darcs.Patch.V2 ( RealPatch )
> > -
> > -mergeExamples :: [Sealed2 (RealPatch Prim :\/: RealPatch Prim)]
> > -mergeExamples = map (mapSeal2 fromW) W.mergeExamples
> > -
> > -realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> > -realPatchLoopExamples = W.realPatchLoopExamples
> > -
> > -commuteExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim)]
> > -commuteExamples = map (mapSeal2 fromW) W.commuteExamples
> > -
> > -tripleExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim :>
> RealPatch Prim)]
> > -tripleExamples = map (mapSeal2 fromW) W.tripleExamples
> > -
> > rmfile ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs
> > move ./src/Darcs/Test/Patch/Examples/Set3Unwitnessed.hs
> ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs
> > hunk ./darcs.cabal 606
> >      other-modules:    Darcs.Test.Email
> >                        Darcs.Test.Patch.Check
> >                        Darcs.Test.Patch.Examples.Set1
> > -                      Darcs.Test.Patch.Examples.Set2
> >                        Darcs.Test.Patch.Examples.Set2Unwitnessed
> > hunk ./darcs.cabal 607
> > -                      Darcs.Test.Patch.Examples.Set3Unwitnessed
> >                        Darcs.Test.Patch.WSub
> >                        Darcs.Test.Patch.Info
> >                        Darcs.Test.Patch.Properties.V1Set1
> > hunk ./src/Darcs/Test/Patch.hs 46
> >  import qualified Darcs.Test.Patch.Info
> >
> >  import qualified Darcs.Test.Patch.Examples.Set1 as Ex
> > +import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
> > +
> >  import qualified Darcs.Test.Patch.Properties.V1Set1 as Prop
> >  import qualified Darcs.Test.Patch.Properties.V1Set2 as Prop
> >  import qualified Darcs.Test.Patch.Properties.Generic as Prop
> > hunk ./src/Darcs/Test/Patch.hs 52
> >  import qualified Darcs.Test.Patch.Properties.Real as Prop
> > -
> > -import qualified Darcs.Test.Patch.WSub as WSub
> > -import qualified Darcs.Test.Patch.Examples.Set2Unwitnessed as ExU
> > -import qualified Darcs.Test.Patch.Examples.Set3Unwitnessed as ExU
> >  import qualified Darcs.Test.Patch.Properties.GenericUnwitnessed as PropU
> >
> > hunk ./src/Darcs/Test/Patch.hs 54
> > +import qualified Darcs.Test.Patch.WSub as WSub
> >  import Darcs.Test.Patch.Arbitrary.PrimV1
> >
> >  #include "gadts.h"
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 23
> >
> >  #include "gadts.h"
> >
> > -module Darcs.Test.Patch.Examples.Set3Unwitnessed
> > +module Darcs.Test.Patch.Examples.Set2Unwitnessed
> >         ( primPermutables, primPatches
> >         , commutables, commutablesFL
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 26
> > -       , realCommutables , realMergeables, realTriples,
> realNonduplicateTriples, realPatches
> > +       , realCommutables , realMergeables, realTriples
> > +       , realNonduplicateTriples, realPatches, realPatchLoopExamples
> >         ) where
> >
> >  import Data.Maybe ( catMaybes )
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 40
> >  import Darcs.Patch.V2 ( RealPatch )
> >  import Darcs.Patch.V2.Real ( prim2real )
> >  -- import Darcs.Test.Patch.Test () -- for instance Eq Patch
> > -import Darcs.Test.Patch.Examples.Set2Unwitnessed
> > +-- import Darcs.Test.Patch.Examples.Set2Unwitnessed
> >  import Darcs.Witnesses.Unsafe ( unsafeCoerceP )
> >  import qualified Darcs.Test.Patch.Arbitrary.Real as W (
> notDuplicatestriple )
> >  --import Printer ( greenText )
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 49
> >  import Darcs.ColorPrinter () -- for instance Show Doc
> >  import Darcs.Test.Patch.WSub
> >
> > +import qualified Darcs.Witnesses.Ordered as W ( (:>), (:\/:) )
> > +import qualified Data.ByteString as B ( ByteString )
> > +import Darcs.Test.Patch.RepoModel ( RepoModel, Content
> > +                                   , makeRepo, makeName, makeFile)
> > +import Darcs.Test.Patch.WithState ( WithStartState(..) )
> > +import Darcs.Patch.Prim.V1.Core ( Prim(FP), FilePatchType(Hunk) )
> > +import Darcs.Patch.FileName ( FileName, fp2fn )
> > +import Darcs.Patch.Prim ( PrimPatchBase(..), FromPrim )
> > +import Darcs.Patch.Merge ( Merge )
> > +import Darcs.Test.Patch.Arbitrary.Generic
> > +    ( Tree(..)
> > +    , TreeWithFlattenPos(..)
> > +    , commutePairFromTree, commuteTripleFromTree
> > +    , mergePairFromCommutePair, commutePairFromTWFP
> > +    , canonizeTree
> > +    )
> > +
> >  -- import Debug.Trace
> >  -- #include "impossible.h"
> >
> > hunk ./src/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs 69
> > +makeSimpleRepo :: String -> Content -> RepoModel C(x)
> > +makeSimpleRepo filename content = makeRepo [(makeName filename, makeFile
> content)]
> > +
> > +
> > +w_tripleExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p,
> PrimOf p ~ Prim) => [Sealed2 (p W.:> p W.:> p)]
> > +w_tripleExamples = [commuteTripleFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "g"]))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "j"]))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"])) NilTree)))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "e"])) NilTree))
> > +                  ,commuteTripleFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack "j"])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "s"]))
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "j"] [])) NilTree)))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > +                  ]
> > +
> > +
> > +w_mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p,
> PrimOf p ~ Prim) => [Sealed2 (p W.:\/: p)]
> > +w_mergeExamples = map (unseal2 (mergePairFromCommutePair seal2))
> w_commuteExamples
> > +
> > +w_commuteExamples :: (FromPrim p, Merge p, PrimPatchBase p, PrimOf p ~
> Prim) => [Sealed2 (p W.:> p)]
> > +w_commuteExamples = [
> > +                   commutePairFromTWFP seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [])
> > +                   (TWFP 3
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "b"]))
> > +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"]))
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"]))
> > +                           (SeqTree (FP (fp2fn "./file") (Hunk 2
> [BC.pack "f"] [])) NilTree)))))),
> > +                   commutePairFromTWFP seal2 $
> > +                   WithStartState
> > +                   (makeSimpleRepo "file" [BC.pack "f",BC.pack
> "s",BC.pack "d"])
> > +                   (TWFP 3
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "d"]
> [])) NilTree)
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] [])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "s",BC.pack "d"] []))
> > +                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "v"])) NilTree)))))),
> > +{-                   commutePairFromTWFP seal2 $
> > +                   WithStartState
> > +                   (makeSimpleRepo "file" [BC.pack "f",BC.pack "u",
> > +                                            BC.pack "s",BC.pack "d"])
> > +                   (TWFP 5
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 5 [] [BC.pack
> "x"]))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack
> "d"] [])) NilTree))
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "u"] [])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f"] []))
> > +                       (SeqTree (FP(fp2fn "./file") (Hunk 1 [BC.pack
> "u",BC.pack "s",BC.pack "d"] []))
> > +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "a"]))
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "a"] [])) NilTree))))))),-}
> > +                   commutePairFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack
> "n",BC.pack "t",BC.pack "h"])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "n",BC.pack "t",BC.pack "h"] []))
> > +                     NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "h"]
> []))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "n"]
> []))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t"] [])) NilTree)))),
> > +                  commutePairFromTree seal2 $
> > +                  WithStartState (makeSimpleRepo "file" [])
> > +                  (ParTree
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "n"])) NilTree)
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "i"]))
> > +                                (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "i"])) NilTree))),
> > +                  commutePairFromTree seal2 $
> > +                  WithStartState (makeSimpleRepo "file" [])
> > +                  (ParTree
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"]))
> > +                     (ParTree
> > +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "c"] [BC.pack "r"])) NilTree)
> > +                       (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > +                        (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "d"])) NilTree))))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)),
> > +                  commutePairFromTWFP seal2 $
> > +                  WithStartState (makeSimpleRepo "file" [])
> > +                  (TWFP 1
> > +                  (ParTree
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "t"])) NilTree))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree))),
> > +                   commutePairFromTWFP seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack
> "f",BC.pack " r",
> > +                                                            BC.pack
> "c",BC.pack "v"])
> > +                   (TWFP 4
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack
> "c",BC.pack "v"] []))
> > +                        (ParTree
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack
> "r"] []))
> > +                          (SeqTree (FP (fp2fn "fi le") (Hunk 1 [BC.pack
> "f"] [])) NilTree))
> > +                         (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "f",BC.pack "r"] []))
> > +                          (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> [BC.pack "y"])) NilTree))))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 4 [BC.pack "v"]
> [])) NilTree))),
> > +                   commutePairFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [])
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree)
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "f"])) NilTree)
> > +                     (ParTree
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "r"])) NilTree)
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "d"])) NilTree))))
> > +                 , commutePairFromTree seal2 $
> > +                   WithStartState (makeSimpleRepo "file" [BC.pack
> "t",BC.pack "r",BC.pack "h"])
> > +                   (ParTree
> > +                    (ParTree
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack
> "t",BC.pack "r",BC.pack "h"] []))
> > +                              NilTree)
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "o"])) NilTree))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "t"]
> []))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "h"]
> [])) NilTree)))
> > +                 , commutePairFromTWFP seal2 $
> > +                   WithStartState (makeSimpleRepo "file" []) $
> > +                   TWFP 2
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"])) NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "y"]))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 2 [] [BC.pack
> "m"]))
> > +                      (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "p"]))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "p"]
> []))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "c"])) NilTree)))
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "z"])) NilTree))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree))
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "v"])) NilTree)
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack "j"
> ]))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1 [BC.pack "j"]
> [])) NilTree)))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [BC.pack
> "x",BC.pack "c"])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "h"]))
> > +                   (ParTree
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 3 [BC.pack "c"]
> [])) NilTree)
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 2 [BC.pack "x"]
> []))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "j"])) NilTree))))
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 [] [BC.pack
> "l"])) NilTree))
> > +                 , commutePairFromTree seal2 $
> > +                 WithStartState (makeSimpleRepo "file" [])
> > +                 (ParTree
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "s"))) NilTree)
> > +                  (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "k")))
> > +                   (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "k") []))
> > +                    (SeqTree (FP (fp2fn "./file") (Hunk 1 []
> (packStringLetters "m")))
> > +                     (SeqTree (FP (fp2fn "./file") (Hunk 1
> (packStringLetters "m") [])) NilTree)))))
> > +                 ]
> > +
> > +packStringLetters :: String -> [B.ByteString]
> > +packStringLetters = map (BC.pack . (:[]))
> > +
> > +w_realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree
> Prim))]
> > +w_realPatchLoopExamples =
> > +    [Sealed (WithStartState (makeSimpleRepo fx_name [])
> > +     $ canonizeTree
> > +     (ParTree
> > +      (SeqTree (FP fx (Hunk 1 [] (packStringLetters
> "pkotufogbvdabnmbzajvolwviqebieonxvcvuvigkfgybmqhzuaaurjspd")))
> > +       (ParTree
> > +        (SeqTree (FP fx (Hunk 47 (packStringLetters "qhzu")
> (packStringLetters "zafybdcokyjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmh")))
> > +         (ParTree
> > +          (ParTree
> > +           NilTree
> > +           (ParTree
> > +            (ParTree
> > +             (ParTree
> > +              (SeqTree (FP fx (Hunk 15 (packStringLetters
> "mbzajvolwviqebieonxvcvuvigkfgyb") (packStringLetters
> "vujnxnhvybvpouyciaabszfmgssezlwwjgnethvrpnfrkubphzvdgymjjoacppqps")))
> > +               (ParTree
> > +                NilTree
> > +                (ParTree
> > +                 (SeqTree (FP fx (Hunk 40 (packStringLetters
> "ssezlwwjgnethvrpnfrkubphzvdgymjjoacppqpsmzafybdcokyjskcgnvhkbz")
> (packStringLetters "wnesidpccwoiqiichxaaejdsyrhrusqljlcoro")))
> > +                  (ParTree
> > +                   (ParTree
> > +                    (SeqTree (FP fx (Hunk 12 (packStringLetters
> "abnvujnxnhvybvpouyciaabszfmgwnesidpccwoiqii") (packStringLetters
> "czfdhqkipdstfjycqaxwnbxrihrufdeyneqiiiafwzlmg"))) NilTree)
> > +                    NilTree)
> > +                   NilTree))
> > +                 (SeqTree (FP fx (Hunk 25 [] (packStringLetters
> "dihgmsotezucqdgxczvcivijootyvhlwymbiueufnvpwpeukmskqllalfe"))) NilTree))))
> > +              (SeqTree (FP fx (Hunk 56 (packStringLetters
> "yjskcgnvhkbzpysaafnjjhcstgrczplxsfwagmhaaurjsp") (packStringLetters
> "xldhrutyhcyaqeezwujiguawfyawjjqlirxshjddvq"))) NilTree))
> > +             (SeqTree (FP fx (Hunk 20 [] (packStringLetters
> "ooygwiyogqrqnytixqtmvdxx")))
> > +              (SeqTree (FP fx (Hunk 26 (packStringLetters
> "yogqrqnytixqtmvdxxvolwviqebieonxvcvuvigkfgybmzafybdcokyjskcgnvhkbz")
> (packStringLetters "akhsmlbkdxnvfoikmiatfbpzdrsyykkpoxvvddeaspzxe")))
> > +               (SeqTree (FP fx (Hunk 39 [] (packStringLetters "ji")))
> > +                (ParTree
> > +                 NilTree
> > +                 (ParTree
> > +                  NilTree
> > +                  (ParTree
> > +                   (ParTree
> > +                    NilTree
> > +                    (SeqTree (FP fx (Hunk 26 (packStringLetters
> "akhsmlbkdxnvfjioikmiatfbpzdrsyykkpoxvvddeaspzxepysaafnjjhcstgrczplxs")
> (packStringLetters "onjbhddskcj")))
> > +                     (SeqTree (FP fx (Hunk 39 [] (packStringLetters
> "fyscunxxxjjtyqpfxeznhtwvlphmp"))) NilTree)))
> > +                   (ParTree
> > +                    NilTree
> > +                    (SeqTree (FP fx (Hunk 44 [] (packStringLetters
> "xcchzwmzoezxkmkhcmesplnjpqriypshgiqklgdnbmmkldnydiy")))
> > +                     (ParTree
> > +                      NilTree
> > +                      (SeqTree (FP fx (Hunk 64 (packStringLetters
> "plnjpqriypshgiqklgdnbmmkldnydiymiatfbpzdrsyykkpoxvvddeaspzxepysaafn")
> (packStringLetters "anjlzfdqbjqbcplvqvkhwjtkigp"))) NilTree)))))))))))
> > +            (ParTree
> > +             NilTree
> > +             NilTree)))
> > +          NilTree))
> > +        NilTree))
> > +      (ParTree
> > +       NilTree
> > +       (SeqTree (FP fx (Hunk 1 [] (packStringLetters "ti")))
> > +        (SeqTree (FP fx (Hunk 1 (packStringLetters "t")
> (packStringLetters "ybcop")))
> > +         (SeqTree (FP fx (Hunk 2 [] (packStringLetters
> "dvlhgwqlpaeweerqrhnjtfolczbqbzoccnvdsyqiefqitrqneralf")))
> > +          (SeqTree (FP fx (Hunk 15 [] (packStringLetters
> "yairbjphwtnaerccdlfewujvjvmjakbc")))
> > +           (SeqTree (FP fx (Hunk 51 [] (packStringLetters
> "xayvfuwaiiogginufnhsrmktpmlbvxiakjwllddkiyofyfw")))
> > +            (ParTree
> > +             NilTree
> > +             NilTree)))))))))]
> > +  where
> > +      fx_name :: String
> > +      fx_name = "F"
> > +
> > +      fx :: FileName
> > +      fx = fp2fn "./F"
> > +
> > +
> > +mergeExamples :: [Sealed2 (RealPatch Prim :\/: RealPatch Prim)]
> > +mergeExamples = map (mapSeal2 fromW) w_mergeExamples
> > +
> > +realPatchLoopExamples :: [Sealed (WithStartState RepoModel (Tree Prim))]
> > +realPatchLoopExamples = w_realPatchLoopExamples
> > +
> > +commuteExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim)]
> > +commuteExamples = map (mapSeal2 fromW) w_commuteExamples
> > +
> > +tripleExamples :: [Sealed2 (RealPatch Prim :> RealPatch Prim :>
> RealPatch Prim)]
> > +tripleExamples = map (mapSeal2 fromW) w_tripleExamples
> > +
> >  notDuplicatestriple :: (RealPatch Prim :> RealPatch Prim :> RealPatch
> Prim) C(x y) -> Bool
> >  notDuplicatestriple = W.notDuplicatestriple . toW
> >
> > hunk ./src/Darcs/Test/Patch/WSub.hs 5
> >  module Darcs.Test.Patch.WSub where
> >
> >  {-
> > -The Examples.Set3 module builds a lot of test cases by pattern matching
> > +The Examples.Set2Unwitnessed module builds a lot of test cases by
> pattern matching
> >  on the results of merge/commute in where clauses. This would
> >  be very painful to switch to using witnesses properly, because
> >  we'd have to make them use case in series.
> > [Add a Show1 instance for (:>).
> > Petr Rockai <me@mornfall.net>**20110620090641
> >  Ignore-this: f601c659c5a078eb1a337ff74e47d0dd
> > ] hunk ./src/Darcs/Witnesses/Ordered.hs 110
> >  instance Show2 a => Show2 (RL a) where
> >     showDict2 = ShowDictClass
> >
> > +instance (Show2 a, Show2 b) => Show1 ((a :> b) C(x)) where
> > +   showDict1 = ShowDictClass
> > +
> >  -- reverse list
> >  data RL a C(x z) where
> >      (:<:) :: a C(y z) -> RL a C(x y) -> RL a C(x z)
> > [Make (V1) Prim an instance of PrimPatchBase/FromPrim.
> > Petr Rockai <me@mornfall.net>**20110620090658
> >  Ignore-this: 2534da30774aac84a09342c3fbcda80e
> > ] hunk ./src/Darcs/Patch/Prim/V1.hs 12
> >  import Darcs.Patch.Prim.V1.Read ()
> >  import Darcs.Patch.Prim.V1.Show ()
> >
> > -import Darcs.Patch.Prim.Class ( PrimPatch )
> > +import Darcs.Patch.Prim.Class ( PrimPatch, PrimPatchBase(..),
> FromPrim(..) )
> >  import Darcs.Patch.Patchy ( Patchy )
> >
> >  instance PrimPatch Prim
> > hunk ./src/Darcs/Patch/Prim/V1.hs 17
> >  instance Patchy Prim
> > +instance PrimPatchBase Prim where
> > +  type PrimOf Prim = Prim
> > +
> > +instance FromPrim Prim where
> > +  fromPrim = id
> > [Remove redundant imports in Darcs.Repository.Internal.
> > Petr Rockai <me@mornfall.net>**20110620090718
> >  Ignore-this: 85333a422e8c83d6b8080dfde97aee1
> > ] hunk ./src/Darcs/Patch/Prim/V1/Details.hs 11
> >  import Darcs.Patch.Prim.V1.Core
> >      ( Prim(..), FilePatchType(..), DirPatchType(..) )
> >  import Darcs.Patch.SummaryData ( SummDetail(..), SummOp(..) )
> > -import Darcs.Patch.TokenReplace ( tryTokInternal )
> > -import Darcs.Patch.FileName ( fn2fp, fp2fn, movedirfilename, fn2ps )
> > -
> > -import qualified Data.ByteString as B ( ByteString, concat )
> > -import qualified Data.ByteString.Char8 as BC ( pack, split )
> > -import Data.Maybe ( catMaybes )
> >
> >  #include "gadts.h"
> >
> > hunk ./src/Darcs/Repository/Internal.hs 71
> >                                   writeProblem, readProblem,
> readfromAndWritetoProblem )
> >  import System.Directory ( doesDirectoryExist, setCurrentDirectory,
> >                            createDirectoryIfMissing, doesFileExist )
> > -import Control.Monad ( liftM, when, unless, filterM )
> > +import Control.Monad ( when, unless, filterM )
> >  import Control.Applicative ( (<$>) )
> >  import Workaround ( getCurrentDirectory, renameFile, setExecutable )
> >
> > hunk ./src/Darcs/Repository/Internal.hs 90
> >  import Darcs.Patch.Inspect ( PatchInspect )
> >  import Darcs.Patch.Prim ( PrimPatchBase, PrimOf, tryShrinkingInverse,
> PrimPatch )
> >  import Darcs.Patch.Bundle ( scanBundle, makeBundleN )
> > -import Darcs.Patch.PatchInfoAnd ( PatchInfoAnd, info,
> > -                         hopefully, hopefullyM )
> > +import Darcs.Patch.PatchInfoAnd ( PatchInfoAnd, hopefully )
> >  import qualified Darcs.Repository.HashedRepo as HashedRepo
> >                              ( revertTentativeChanges,
> finalizeTentativeChanges,
> >                                removeFromTentativeInventory,
> > hunk ./src/Darcs/Repository/Internal.hs 110
> >  import Darcs.Witnesses.Unsafe ( unsafeCoerceP, unsafeCoercePStart )
> >  import Darcs.Witnesses.Ordered ( FL(..), RL(..),
> >                               (:\/:)(..), (:/\:)(..), (:>)(..),
> > -                             (+>+), lengthFL, dropWhileFL,
> > +                             (+>+), lengthFL,
> >                               allFL, filterFLFL,
> >                               reverseFL, mapFL_FL, concatFL )
> >  import Darcs.Patch ( RepoPatch, Patchy, merge,
> > hunk ./src/Darcs/Repository/Internal.hs 115
> >                       listConflictedFiles, listTouchedFiles,
> > -                     Named, patchcontents,
> > +                     Named,
> >                       commuteRL, fromPrims,
> >                       readPatch,
> >                       effect, invert,
> > hunk ./src/Darcs/Repository/Internal.hs 124
> >                       apply, applyToTree,
> >                     )
> >  import Darcs.Patch.Permutations ( commuteWhatWeCanFL, removeFL )
> > -import Darcs.Patch.Info ( PatchInfo )
> >  import Darcs.Patch.Set ( PatchSet(..), SealedPatchSet, newset2FL )
> >  #ifdef GADT_WITNESSES
> >  import Darcs.Patch.Set ( Origin )
> > [Reorganise the Patch tests further.
> > Petr Rockai <me@mornfall.net>**20110620091810
> >  Ignore-this: b9bc5870d025d29d9d3d2dbd0fe950ad
> > ] hunk ./src/Darcs/Test/Patch.hs 24
> >  import Test.Framework ( Test, testGroup )
> >  import Test.Framework.Providers.HUnit ( testCase )
> >  import Test.Framework.Providers.QuickCheck2 ( testProperty )
> > +import Test.QuickCheck.Arbitrary( Arbitrary )
> >  import Test.HUnit ( assertBool )
> >
> >  import Darcs.Test.Util.TestResult ( TestResult, isOk, fromMaybe )
> > hunk ./src/Darcs/Test/Patch.hs 33
> >  import Darcs.Witnesses.Ordered
> >  import Darcs.Witnesses.Sealed
> >  import Darcs.Witnesses.Eq ( unsafeCompare )
> > -import Darcs.Patch.Prim( PrimPatch, join )
> > +import Darcs.Witnesses.Show
> > +import Darcs.Patch.Prim( PrimPatch, join, FromPrim, PrimOf,
> PrimPatchBase )
> >  import Darcs.Patch.Prim.V1 ( Prim )
> >  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
> >  import Darcs.Patch.Patchy ( Commute(..) )
> > hunk ./src/Darcs/Test/Patch.hs 39
> >
> > -import Darcs.Test.Patch.Arbitrary.Generic( Tree )
> > +import Darcs.Test.Patch.Arbitrary.Generic
> > +import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> > +import Darcs.Test.Patch.Test( Check(..) )
> >  import Darcs.Test.Patch.Arbitrary.Real
> >  import Darcs.Test.Patch.Arbitrary.PrimV1 ()
> >  import Darcs.Test.Patch.RepoModel( RepoModel )
> > hunk ./src/Darcs/Test/Patch.hs 59
> >  import qualified Darcs.Test.Patch.Properties.GenericUnwitnessed as PropU
> >
> >  import qualified Darcs.Test.Patch.WSub as WSub
> > -import Darcs.Test.Patch.Arbitrary.PrimV1
> >
> >  #include "gadts.h"
> >
> > hunk ./src/Darcs/Test/Patch.hs 72
> >      where assertName = "Boolean assertion for \"" ++ name ++ "\""
> >            res        = and $ map (isOk . test) datas
> >
> > -patchExampleTests :: [Test]
> > -patchExampleTests =
> > +unit_V1P1:: [Test]
> > +unit_V1P1 =
> >    [ runPrimitiveTests "Checking known commutes" Prop.checkCommute
> Ex.knownCommutes
> >    , runPrimitiveTests "Checking known non-commutes"
> Prop.checkCantCommute Ex.knownCantCommutes
> >    , runPrimitiveTests "Checking known merges" Prop.checkMerge
> Ex.knownMerges
> > hunk ./src/Darcs/Test/Patch.hs 90
> >    , runPrimitiveTests "Checking primitive commute/recommute"
> Prop.tCommuteRecommute Ex.primitiveCommutePairs
> >    ]
> >
> > --- | The unit tests defined about patches
> > -patchUnitTests :: [Test]
> > -patchUnitTests =
> > +unit_V2P1 :: [Test]
> > +unit_V2P1 =
> >    [ runPrimitiveTests "join commute" (PropU.joinCommute WSub.join)
> ExU.primPermutables
> >    , runPrimitiveTests "prim recommute" (PropU.recommute WSub.commute)
> ExU.commutables
> >    , runPrimitiveTests "prim patch and inverse commute"
> (PropU.patchAndInverseCommute WSub.commute) ExU.commutables
> > hunk ./src/Darcs/Test/Patch.hs 122
> >  mergeEitherWayReals :: PrimPatch prim => (RealPatch prim :\/: RealPatch
> prim) C(x y) -> TestResult
> >  mergeEitherWayReals = Prop.mergeEitherWay
> >
> > -patchUnitTests2 :: [Test]
> > -patchUnitTests2 =
> > +qc_prim :: forall prim C(x y a).
> > +           (PrimPatch prim, ArbitraryPrim prim, Show2 prim
> > +           , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> > +           , FromPrim prim
> > +           , Arbitrary (Sealed2 prim)
> > +           , Arbitrary (Sealed2 (WithState RepoModel prim))
> > +           , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> > +           , Arbitrary (Sealed2 (WithState RepoModel (FL prim :> FL
> prim)))
> > +           , Arbitrary (Sealed2 (WithState RepoModel (FL prim)))
> > +           , Arbitrary (Sealed2 (FL prim))
> > +           , Arbitrary (Sealed2 (prim :> prim))
> > +           , Arbitrary (Sealed2 (prim :> prim :> prim))
> > +           , Arbitrary (Sealed2 (FL prim :> FL prim))
> > +           ) => prim C(x y) -> [Test]
> > +qc_prim _ =
> >    [ testProperty "Checking Prim invert symmetry..."
> > hunk ./src/Darcs/Test/Patch.hs 138
> > -    (unseal2 $ Prop.invertSymmetry :: Sealed2 Prim -> TestResult)
> > +    (unseal2 $ Prop.invertSymmetry :: Sealed2 prim -> TestResult)
> >    , testProperty "Checking FL Prim invert symmetry..."
> > hunk ./src/Darcs/Test/Patch.hs 140
> > -    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL Prim) -> TestResult)
> > +    (unseal2 $ Prop.invertSymmetry :: Sealed2 (FL prim) -> TestResult)
> >    , testProperty "Checking Prim invert rollback..."
> > hunk ./src/Darcs/Test/Patch.hs 142
> > -    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel Prim)
> -> TestResult)
> > +    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel prim)
> -> TestResult)
> >    , testProperty "Checking FL Prim invert rollback..."
> > hunk ./src/Darcs/Test/Patch.hs 144
> > -    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL
> Prim)) -> TestResult)
> > +    (unseal2 $ Prop.invertRollback :: Sealed2 (WithState RepoModel (FL
> prim)) -> TestResult)
> >    , testConditional "Checking Prim effect preserving..."
> > hunk ./src/Darcs/Test/Patch.hs 146
> > -    (unseal2 $ nonEmptyHunksPair . wsPatch)
> > -    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (Prim :> Prim)) -> TestResult)
> > +    (unseal2 $ P1.nonEmptyHunksPair . wsPatch)
> > +    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (prim :> prim)) -> TestResult)
> >    , testConditional "Checking FL Prim effect preserving..."
> > hunk ./src/Darcs/Test/Patch.hs 149
> > -    (unseal2 $ nonEmptyHunksFLPair . wsPatch)
> > -    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (FL Prim :> FL Prim)) -> TestResult)
> > +    (unseal2 $ P1.nonEmptyHunksFLPair . wsPatch)
> > +    (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (FL prim :> FL prim)) -> TestResult)
> >    , testProperty "Checking Prim recommute..."
> > hunk ./src/Darcs/Test/Patch.hs 152
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (Prim :> Prim) ->
> TestResult)
> > +    (unseal2 $ Prop.recommute commute :: Sealed2 (prim :> prim) ->
> TestResult)
> >    , testProperty "Checking FL Prim recommute..."
> > hunk ./src/Darcs/Test/Patch.hs 154
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (FL Prim :> FL Prim) ->
> TestResult)
> > +    (unseal2 $ Prop.recommute commute :: Sealed2 (FL prim :> FL prim) ->
> TestResult)
> >    , testProperty "Checking Prim inverses commute..."
> > hunk ./src/Darcs/Test/Patch.hs 156
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (Prim :> Prim) ->
> TestResult)
> > +    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (prim :> prim) ->
> TestResult)
> >    , testProperty "Checking FL Prim inverses commute..."
> > hunk ./src/Darcs/Test/Patch.hs 158
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL Prim :> FL
> Prim) -> TestResult)
> > +    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL prim :> FL
> prim) -> TestResult)
> >      --do putStr "Checking with quickcheck that real patches have
> consistent flattenings... "
> >      --   quickCheck (not . isBottomTimeOut (Just 10) .
> propConsistentTreeFlattenings) >> return 0
> >      -- The following fails because of setpref patches...
> > hunk ./src/Darcs/Test/Patch.hs 165
> >      --,do putStr "Checking prim inverse doesn't commute using
> QuickCheck... "
> >      --    simpleCheck (inverseDoesntCommute :: Prim -> Maybe Doc)
> >    , testProperty "Checking prim join effect preserving... "
> > -    (unseal2 (Prop.joinEffectPreserving join :: WithState RepoModel
> (Prim :> Prim) C(x y) -> TestResult))
> > +    (unseal2 $ Prop.joinEffectPreserving join :: Sealed2 (WithState
> RepoModel (prim :> prim)) -> TestResult)
> >    , testConditional "Checking prim join commute using QuickCheck... "
> > hunk ./src/Darcs/Test/Patch.hs 167
> > -    (unseal2 nonEmptyHunksTriple)
> > -    (unseal2 (Prop.joinCommute join :: (Prim :> Prim :> Prim) C(x y) ->
> TestResult))
> > +    (unseal2 P1.nonEmptyHunksTriple)
> > +    (unseal2 $ Prop.joinCommute join :: Sealed2 (prim :> prim :> prim)
> -> TestResult)
> >      --,do putStr "Checking prim recommute using QuickCheck... "
> >      --    simpleCheck (recommute
> >      --                 (commute :: Prim :> Prim
> > hunk ./src/Darcs/Test/Patch.hs 173
> >      --                          -> Maybe (Prim :> Prim)))
> > -  , testProperty "Checking that readPatch and showPatch work on
> RealPatch... "
> > +  ]
> > +
> > +qc_V2P1 :: [Test]
> > +qc_V2P1 =
> > +  [ testProperty "Checking that readPatch and showPatch work on
> RealPatch... "
> >      (unseal $ patchFromTree $ (Prop.show_read :: RealPatch Prim C(x y)
> -> TestResult))
> >    , testProperty "Checking that readPatch and showPatch work on FL
> RealPatch... "
> >      (unseal2 $ (Prop.show_read :: FL (RealPatch Prim) C(x y) ->
> TestResult))
> > hunk ./src/Darcs/Test/Patch.hs 184
> >    , testProperty "Checking that tree flattenings are consistent... "
> >      Prop.propConsistentTreeFlattenings
> >    , testProperty "Checking with quickcheck that real patches are
> consistent... "
> > -    (unseal $ patchFromTree $ fromMaybe . isConsistent)
> > +    (unseal $ P1.patchFromTree $ fromMaybe . isConsistent)
> >
> >    , testProperty "Checking we can do merges using QuickCheck"
> >      (isNothing . (Prop.propIsMergeable ::
> > hunk ./src/Darcs/Test/Patch.hs 191
> >                       Sealed (WithStartState RepoModel (Tree Prim))
> >                       -> Maybe (Tree (RealPatch Prim) C(x))))
> >    , testProperty "Checking recommute using QuickCheck Tree generator"
> > -    (unseal $ commutePairFromTree $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> >    , testProperty "Checking recommute using QuickCheck TWFP generator"
> > hunk ./src/Darcs/Test/Patch.hs 193
> > -    (unseal $ commutePairFromTWFP $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> >    , testConditional "Checking nontrivial recommute"
> > hunk ./src/Darcs/Test/Patch.hs 195
> > -    (unseal $ commutePairFromTree $ nontrivialReals)
> > -    (unseal $ commutePairFromTree $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> >    , testConditional "Checking nontrivial recommute using TWFP"
> > hunk ./src/Darcs/Test/Patch.hs 198
> > -    (unseal $ commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ commutePairFromTWFP $ Prop.recommute commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> >
> >    , testProperty "Checking inverses commute using QuickCheck Tree
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 202
> > -    (unseal $ commutePairFromTree $
> > +    (unseal $ P1.commutePairFromTree $
> >       (Prop.commuteInverses commuteReals))
> >    , testProperty "Checking inverses commute using QuickCheck TWFP
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 205
> > -    (unseal $ commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> >    , testConditional "Checking nontrivial inverses commute"
> > hunk ./src/Darcs/Test/Patch.hs 207
> > -    (unseal $ commutePairFromTree $ nontrivialReals)
> > -    (unseal $ commutePairFromTree $ Prop.commuteInverses commuteReals)
> > +    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTree $ Prop.commuteInverses
> commuteReals)
> >    , testConditional "Checking nontrivial inverses commute using TWFP"
> > hunk ./src/Darcs/Test/Patch.hs 210
> > -    (unseal $ commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ commutePairFromTWFP $ Prop.commuteInverses commuteReals)
> > +    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > +    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> >
> >    , testProperty "Checking merge either way using QuickCheck TWFP
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 214
> > -    (unseal $ mergePairFromTWFP $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> >    , testProperty "Checking merge either way using QuickCheck Tree
> generator"
> > hunk ./src/Darcs/Test/Patch.hs 216
> > -    (unseal $ mergePairFromTree $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> >    , testConditional "Checking nontrivial merge either way"
> > hunk ./src/Darcs/Test/Patch.hs 218
> > -    (unseal $ mergePairFromTree $ nontrivialMergeReals)
> > -    (unseal $ mergePairFromTree $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTree $ nontrivialMergeReals)
> > +    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> >    , testConditional "Checking nontrivial merge either way using TWFP"
> > hunk ./src/Darcs/Test/Patch.hs 221
> > -    (unseal $ mergePairFromTWFP $ nontrivialMergeReals)
> > -    (unseal $ mergePairFromTWFP $ mergeEitherWayReals)
> > +    (unseal $ P1.mergePairFromTWFP $ nontrivialMergeReals)
> > +    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> >
> >    , testConditional "Checking permutivity"
> > hunk ./src/Darcs/Test/Patch.hs 225
> > -    (unseal $ commuteTripleFromTree notDuplicatestriple)
> > -    (unseal $ commuteTripleFromTree $ Prop.permutivity commuteReals)
> > +    (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> > +    (unseal $ P1.commuteTripleFromTree $ Prop.permutivity commuteReals)
> >    , testConditional "Checking partial permutivity"
> > hunk ./src/Darcs/Test/Patch.hs 228
> > -    (unseal $ commuteTripleFromTree notDuplicatestriple)
> > -    (unseal $ commuteTripleFromTree $ Prop.partialPermutivity
> commuteReals)
> > +    (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> > +    (unseal $ P1.commuteTripleFromTree $ Prop.partialPermutivity
> commuteReals)
> >    , testConditional "Checking nontrivial permutivity"
> > hunk ./src/Darcs/Test/Patch.hs 231
> > -    (unseal $ commuteTripleFromTree (\t -> nontrivialTriple t &&
> notDuplicatestriple t))
> > -    (unseal $ commuteTripleFromTree $ (Prop.permutivity commuteReals))
> > +    (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t &&
> notDuplicatestriple t))
> > +    (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity
> commuteReals))
> >    ]
> >
> > hunk ./src/Darcs/Test/Patch.hs 235
> > -patchPropertyTests :: [Test]
> > -patchPropertyTests =
> > +qc_V1P1 :: [Test]
> > +qc_V1P1 =
> >    [
> >      testProperty "Checking that show and read work right" (unseal
> Prop.propReadShow)
> >    ]
> > hunk ./src/Darcs/Test/Patch.hs 272
> >
> >  -- | This is the big list of tests that will be run using testrunner.
> >  testSuite :: [Test]
> > -testSuite = [ testGroup "Darcs.Patch (Properties.GenericUnwitnessed +
> Examples.Set3Unwitnessed)" patchUnitTests
> > -            , testGroup "Darcs.Patch (Properties.Generic + Arbitrary)"
> patchUnitTests2
> > -            , testGroup "Darcs.Patch (Properties.V1Set2 + Arbitrary)"
> patchPropertyTests
> > -            , testGroup "Darcs.Patch (Properties.V1Set1 +
> Examples.Set1)" patchExampleTests
> > +testSuite = [ testGroup "Darcs.Patch.Prim.V1" $ qc_prim (undefined ::
> Prim C(x y))
> > +            , testGroup "Darcs.Patch.V1 (using Prim.V1)" $ unit_V1P1 ++
> qc_V1P1
> > +            , testGroup "Darcs.Patch.V2 (using Prim.V1)" $ unit_V2P1 ++
> qc_V2P1
> >              , Darcs.Test.Patch.Info.testSuite
> >              ]
> > [Generalise the V1.Prim Arbitrary instance based on Tree to any
> PrimPatch.
> > Petr Rockai <me@mornfall.net>**20110620123027
> >  Ignore-this: 289e1227afffcec6484ce10a477f977a
> > ] hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 31
> >  import Darcs.Patch.Patchy ( Invert(..), Commute(..) )
> >  import Darcs.Patch.Prim ( PrimOf, PrimPatch, PrimPatchBase,
> FromPrim(..), move )
> >  import Darcs.Patch.Prim.V1 ()
> > +import Darcs.Patch.V2 ( RealPatch ) -- XXX this is more or less a hack
> >  --import Darcs.ColorPrinter ( errorDoc )
> >  --import Darcs.ColorPrinter ( traceDoc )
> >  import Darcs.Witnesses.Show
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 222
> >  getTriples (_:>:NilFL) = []
> >  getTriples (_:>:_:>:NilFL) = []
> >  getTriples (a:>:b:>:c:>:d) = seal2 (a:>b:>c) : getTriples (b:>:c:>:d)
> > +
> > +instance ArbitraryPrim prim => Arbitrary (Sealed (WithStartState
> RepoModel (TreeWithFlattenPos prim))) where
> > +   arbitrary = do Sealed (WithStartState rm t) <- arbitrary
> > +                  let num = unseal (length . getPairs) (flattenOneRP t)
> > +                  if num == 0 then return $ Sealed $ WithStartState rm $
> TWFP 0 NilTree
> > +                    else do n <- choose (0, num - 1)
> > +                            return $ Sealed $ WithStartState rm $ TWFP n
> t
> > +                    where -- just used to get the length. In principle
> this should be independent of the patch type.
> > +                          flattenOneRP :: Tree prim C(x) -> Sealed (FL
> (RealPatch prim) C(x))
> > +                          flattenOneRP = flattenOne
> > +
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Real.hs 19
> >  import Darcs.Witnesses.Sealed
> >  import Darcs.Witnesses.Eq
> >  import Darcs.Patch.Prim ( FromPrim(..) )
> > -import Darcs.Patch.Prim.V1 ( Prim )
> >
> >  #include "gadts.h"
> >
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Real.hs 65
> >          Just (c' :> b'') -> (not (a `unsafeCompare` a') || not (b
> `unsafeCompare` b')) &&
> >                              (not (c' `unsafeCompare` c) || not (b''
> `unsafeCompare` b)) &&
> >                              (not (c'' `unsafeCompare` c) || not (a''
> `unsafeCompare` a'))
> > -
> > -instance Arbitrary (Sealed (WithStartState RepoModel (TreeWithFlattenPos
> Prim))) where
> > -   arbitrary = do Sealed (WithStartState rm t) <- arbitrary
> > -                  let num = unseal (length . getPairs) (flattenOneRP t)
> > -                  if num == 0 then return $ Sealed $ WithStartState rm $
> TWFP 0 NilTree
> > -                    else do n <- choose (0, num - 1)
> > -                            return $ Sealed $ WithStartState rm $ TWFP n
> t
> > -                    where -- just used to get the length. In principle
> this should be independent of the patch type.
> > -                          flattenOneRP :: Tree Prim C(x) -> Sealed (FL
> (RealPatch Prim) C(x))
> > -                          flattenOneRP = flattenOne
> > -
> > [Generalise a bunch of merge/commute properties over the patch type &
> generator.
> > Petr Rockai <me@mornfall.net>**20110620123354
> >  Ignore-this: fd5b45e576226d719531182bedd5ac9d
> > ] hunk ./src/Darcs/Test/Patch.hs 1
> > +{-# OPTIONS_GHC -fno-warn-orphans #-}
> >  --  Copyright (C) 2002-2005,2007 David Roundy
> >  --
> >  --  This program is free software; you can redistribute it and/or modify
> > hunk ./src/Darcs/Test/Patch.hs 26
> >  import Test.Framework.Providers.HUnit ( testCase )
> >  import Test.Framework.Providers.QuickCheck2 ( testProperty )
> >  import Test.QuickCheck.Arbitrary( Arbitrary )
> > +import Test.QuickCheck( Testable )
> >  import Test.HUnit ( assertBool )
> >
> >  import Darcs.Test.Util.TestResult ( TestResult, isOk, fromMaybe )
> > hunk ./src/Darcs/Test/Patch.hs 38
> >  import Darcs.Witnesses.Show
> >  import Darcs.Patch.Prim( PrimPatch, join, FromPrim, PrimOf,
> PrimPatchBase )
> >  import Darcs.Patch.Prim.V1 ( Prim )
> > +import qualified Darcs.Patch.V1 as V1
> >  import Darcs.Patch.V2.Real ( isConsistent, isForward, RealPatch )
> > hunk ./src/Darcs/Test/Patch.hs 40
> > -import Darcs.Patch.Patchy ( Commute(..) )
> > +import Darcs.Patch.RepoPatch( RepoPatch )
> > +import Darcs.Patch.Patchy ( Commute(..), Patchy )
> >
> >  import Darcs.Test.Patch.Arbitrary.Generic
> >  import qualified Darcs.Test.Patch.Arbitrary.PrimV1 as P1
> > hunk ./src/Darcs/Test/Patch.hs 120
> >    , runPrimitiveTests "real partial permutivity"
> (PropU.partialPermutivity WSub.commute) ExU.realNonduplicateTriples
> >    ]
> >
> > +instance Check (RealPatch Prim) where
> > +  checkPatch p = return $ isNothing $ isConsistent p
> > +
> >  commuteReals :: PrimPatch prim => (RealPatch prim :> RealPatch prim) C(x
> y) -> Maybe ((RealPatch prim :> RealPatch prim) C(x y))
> >  commuteReals = commute
> >
> > hunk ./src/Darcs/Test/Patch.hs 126
> > -mergeEitherWayReals :: PrimPatch prim => (RealPatch prim :\/: RealPatch
> prim) C(x y) -> TestResult
> > -mergeEitherWayReals = Prop.mergeEitherWay
> > -
> >  qc_prim :: forall prim C(x y a).
> >             (PrimPatch prim, ArbitraryPrim prim, Show2 prim
> >             , Check prim, PrimPatchBase prim, PrimOf prim ~ prim
> > hunk ./src/Darcs/Test/Patch.hs 130
> >             , FromPrim prim
> > +           , Arbitrary (Sealed ((prim :> prim) C(a)))
> > +           , Arbitrary (Sealed ((FL prim :> FL prim) C(a)))
> > +           , Show1 ((PrimOf prim :> PrimOf prim) C(a))
> >             , Arbitrary (Sealed2 prim)
> >             , Arbitrary (Sealed2 (WithState RepoModel prim))
> >             , Arbitrary (Sealed2 (WithState RepoModel (prim :> prim)))
> > hunk ./src/Darcs/Test/Patch.hs 158
> >    , testConditional "Checking FL Prim effect preserving..."
> >      (unseal2 $ P1.nonEmptyHunksFLPair . wsPatch)
> >      (unseal2 $ Prop.effectPreserving commute :: Sealed2 (WithState
> RepoModel (FL prim :> FL prim)) -> TestResult)
> > -  , testProperty "Checking Prim recommute..."
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (prim :> prim) ->
> TestResult)
> > -  , testProperty "Checking FL Prim recommute..."
> > -    (unseal2 $ Prop.recommute commute :: Sealed2 (FL prim :> FL prim) ->
> TestResult)
> > -  , testProperty "Checking Prim inverses commute..."
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (prim :> prim) ->
> TestResult)
> > -  , testProperty "Checking FL Prim inverses commute..."
> > -    (unseal2 $ Prop.commuteInverses commute :: Sealed2 (FL prim :> FL
> prim) -> TestResult)
> >      --do putStr "Checking with quickcheck that real patches have
> consistent flattenings... "
> >      --   quickCheck (not . isBottomTimeOut (Just 10) .
> propConsistentTreeFlattenings) >> return 0
> >      -- The following fails because of setpref patches...
> > hunk ./src/Darcs/Test/Patch.hs 172
> >      --    simpleCheck (recommute
> >      --                 (commute :: Prim :> Prim
> >      --                          -> Maybe (Prim :> Prim)))
> > -  ]
> > +  ] ++ commute_properties (undefined :: prim C(x y)) "arbitrary"
> arbitraryCommutePair
> > +    ++ commute_properties (undefined :: FL prim C(x y)) "arbitrary FL"
> arbitraryFLCommutePair
> > +    where arbitraryCommutePair
> > +            :: (FORALL(xx yy) (prim :> prim) C(xx yy) -> t) ->
> > +               ((prim :> prim) C(a bb) -> t)
> > +          arbitraryCommutePair f p = f p
> > +          arbitraryFLCommutePair :: (FORALL(xx yy) (FL prim :> FL prim)
> C(xx yy) -> t) ->
> > +                                    ((FL prim :> FL prim) C(a bb) -> t)
> > +          arbitraryFLCommutePair f p = f p
> >
> >  qc_V2P1 :: [Test]
> >  qc_V2P1 =
> > hunk ./src/Darcs/Test/Patch.hs 184
> > +  -- utilities
> ------------------------------------------------------------------------------
> >    [ testProperty "Checking that readPatch and showPatch work on
> RealPatch... "
> >      (unseal $ patchFromTree $ (Prop.show_read :: RealPatch Prim C(x y)
> -> TestResult))
> >    , testProperty "Checking that readPatch and showPatch work on FL
> RealPatch... "
> > hunk ./src/Darcs/Test/Patch.hs 198
> >      (isNothing . (Prop.propIsMergeable ::
> >                       Sealed (WithStartState RepoModel (Tree Prim))
> >                       -> Maybe (Tree (RealPatch Prim) C(x))))
> > -  , testProperty "Checking recommute using QuickCheck Tree generator"
> > -    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> > -  , testProperty "Checking recommute using QuickCheck TWFP generator"
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> > -  , testConditional "Checking nontrivial recommute"
> > -    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTree $ Prop.recommute commuteReals)
> > -  , testConditional "Checking nontrivial recommute using TWFP"
> > -    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.recommute commuteReals)
> > -
> > -  , testProperty "Checking inverses commute using QuickCheck Tree
> generator"
> > -    (unseal $ P1.commutePairFromTree $
> > -     (Prop.commuteInverses commuteReals))
> > -  , testProperty "Checking inverses commute using QuickCheck TWFP
> generator"
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> > -  , testConditional "Checking nontrivial inverses commute"
> > -    (unseal $ P1.commutePairFromTree $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTree $ Prop.commuteInverses
> commuteReals)
> > -  , testConditional "Checking nontrivial inverses commute using TWFP"
> > -    (unseal $ P1.commutePairFromTWFP $ nontrivialReals)
> > -    (unseal $ P1.commutePairFromTWFP $ Prop.commuteInverses
> commuteReals)
> > -
> > -  , testProperty "Checking merge either way using QuickCheck TWFP
> generator"
> > -    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> > -  , testProperty "Checking merge either way using QuickCheck Tree
> generator"
> > -    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> > -  , testConditional "Checking nontrivial merge either way"
> > -    (unseal $ P1.mergePairFromTree $ nontrivialMergeReals)
> > -    (unseal $ P1.mergePairFromTree $ mergeEitherWayReals)
> > -  , testConditional "Checking nontrivial merge either way using TWFP"
> > -    (unseal $ P1.mergePairFromTWFP $ nontrivialMergeReals)
> > -    (unseal $ P1.mergePairFromTWFP $ mergeEitherWayReals)
> >
> > hunk ./src/Darcs/Test/Patch.hs 199
> > +  -- permutivity
> ----------------------------------------------------------------------------
> >    , testConditional "Checking permutivity"
> >      (unseal $ P1.commuteTripleFromTree notDuplicatestriple)
> >      (unseal $ P1.commuteTripleFromTree $ Prop.permutivity commuteReals)
> > hunk ./src/Darcs/Test/Patch.hs 209
> >    , testConditional "Checking nontrivial permutivity"
> >      (unseal $ P1.commuteTripleFromTree (\t -> nontrivialTriple t &&
> notDuplicatestriple t))
> >      (unseal $ P1.commuteTripleFromTree $ (Prop.permutivity
> commuteReals))
> > +
> > +  ] ++ merge_properties (undefined :: RealPatch Prim C(x y)) "tree"
> mergePairFromTree
> > +    ++ merge_properties (undefined :: RealPatch Prim C(x y)) "twfp"
> mergePairFromTWFP
> > +    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "tree"
> commutePairFromTree
> > +    ++ commute_properties (undefined :: RealPatch Prim C(x y)) "twfp"
> commutePairFromTWFP
> > +
> > +commute_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf
> p), FromPrim p
> > +                                       , Show2 p, Show2 (PrimOf p),
> Patchy p
> > +                                       , Show1 gen, Arbitrary (Sealed
> gen))
> > +                 => p C(x y) -> String ->
> > +                    (FORALL(ctx t) ((FORALL(xx yy) (p :> p) xx yy -> t)
> -> (gen ctx -> t))) ->
> > +                    [Test]
> > +commute_properties _ genname gen =
> > +  [ prop "recommute" $ Prop.recommute commute
> > +  , cond "nontrivial recommute" nontrivialCommute $ Prop.recommute
> commute
> > +  , prop "inverses commute" $ Prop.commuteInverses commute
> > +  , cond "nontrivial inverses" nontrivialCommute $ Prop.commuteInverses
> commute
> >    ]
> > hunk ./src/Darcs/Test/Patch.hs 227
> > +  where prop :: String -> (FORALL (yy zz) (p :> p) C(yy zz) ->
> TestResult) -> Test
> > +        prop t p = cond t (const True) p
> > +        cond :: String ->
> > +                (FORALL (yy zz) (p :> p) C(yy zz) -> Bool) ->
> > +                (FORALL (yy zz) (p :> p) C(yy zz) -> TestResult) -> Test
> > +        cond t c p =
> > +          testConditional ("commute (" ++ genname ++ "): " ++ t)
> > +          (unseal $ gen c) (unseal $ gen p)
> > +
> > +merge_properties :: forall p x y gen. (Check p, ArbitraryPrim (PrimOf
> p), FromPrim p
> > +                                      , Show2 p, Show2 (PrimOf p),
> RepoPatch p
> > +                                      , Show1 gen, Arbitrary (Sealed
> gen))
> > +                 => p C(x y) -> String ->
> > +                    (FORALL(ctx t) ((FORALL(xx yy) (p :\/: p) xx yy ->
> t) -> (gen ctx -> t))) ->
> > +                    [Test]
> > +merge_properties _ genname gen =
> > +    [ prop "merge swap" Prop.tMergeSwapMerge
> > +    , prop "merge either way" Prop.mergeEitherWay
> > +    , prop "merge either way valid" Prop.tMergeEitherWayValid
> > +    , cond "nontrivial merge either way" nontrivialMerge
> Prop.mergeEitherWay
> > +    ]
> > +  where prop :: Testable t => String -> (FORALL (yy zz) (p :\/: p) C(yy
> zz) -> t) -> Test
> > +        prop t p = cond t (const True) p
> > +        cond :: (Testable t) => String ->
> > +                (FORALL (yy zz) (p :\/: p) C(yy zz) -> Bool) ->
> > +                (FORALL (yy zz) (p :\/: p) C(yy zz) -> t) -> Test
> > +        cond t c p =
> > +          testConditional ("merge (" ++ genname ++ "): " ++ t)
> > +          (unseal $ gen c) (unseal $ gen p)
> >
> >  qc_V1P1 :: [Test]
> >  qc_V1P1 =
> > hunk ./src/Darcs/Test/Patch.hs 269
> >    [ testProperty "Checking that commuting by patch and its inverse is
> ok" Prop.propCommuteInverse
> >     --putStr "Checking that conflict resolution is valid... "
> >     --runQuickCheckTest returnval propResolveConflictsValid
> > -  , testProperty "Checking that a patch followed by its inverse is
> identity" Prop.propPatchAndInverseIsIdentity
> > +  , testProperty "Checking that a patch followed by its inverse is
> identity"
> > +    Prop.propPatchAndInverseIsIdentity
> >    , testProperty "Checking 'simple smart merge'"
> Prop.propSimpleSmartMergeGoodEnough
> >    , testProperty "Checking that commutes are equivalent"
> Prop.propCommuteEquivalency
> >    , testProperty "Checking that merges are valid" Prop.propMergeValid
> > hunk ./src/Darcs/Test/Patch.hs 291
> >    , testProperty "Checking that merges commute and are well behaved"
> Prop.propMergeIsCommutableAndCorrect
> >    , testProperty "Checking that merges can be swapped"
> Prop.propMergeIsSwapable
> >    , testProperty "Checking again that merges can be swapped (I'm
> paranoid) " Prop.propMergeIsSwapable
> > -  ]
> > +
> > +  ] -- the following properties are disabled, because they routinely
> lead to
> > +    -- exponential cases, making the tests run for ever and ever;
> nevertheless,
> > +    -- we would expect them to hold
> > + {- ++ merge_properties (undefined :: V1.Patch Prim C(x y)) "tree"
> mergePairFromTree
> > +    ++ merge_properties (undefined :: V1.Patch Prim C(x y)) "twfp"
> mergePairFromTWFP
> > +    ++ commute_properties (undefined :: V1.Patch Prim C(x y)) "tree"
> commutePairFromTree
> > +    ++ commute_properties (undefined :: V1.Patch Prim C(x y)) "twfp"
> commutePairFromTWFP -}
> >
> >  -- | This is the big list of tests that will be run using testrunner.
> >  testSuite :: [Test]
> > hunk ./src/Darcs/Test/Patch/Arbitrary/Generic.hs 63
> >  instance Show2 p => Show1 (Tree p) where
> >      showDict1 = ShowDictClass
> >
> > +instance Show2 p => Show1 (TreeWithFlattenPos p) where
> > +    showDict1 = ShowDictClass
> > +
> >  sizeTree :: Tree p C(x) -> Int
> >  sizeTree NilTree = 0
> >  sizeTree (SeqTree _ t) = 1 + sizeTree t
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 18
> >  import Darcs.Witnesses.Eq
> >  import Darcs.Witnesses.Unsafe
> >  import Darcs.Witnesses.Ordered
> > -import Darcs.Witnesses.Show
> > +-- import Darcs.Witnesses.Show
> >  import Darcs.Patch.Prim.V1 ()
> >  import Darcs.Patch.Prim.V1.Core ( FilePatchType( Hunk, TokReplace ),
> Prim( FP ), isIdentity )
> >  import Darcs.Patch.RepoPatch ( RepoPatch )
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 84
> >    arbitrary = do repo <- aSmallRepo
> >                   liftM (unseal (seal2 . wesPatch)) $ arbitraryState repo
> >
> > -instance Show1 (TreeWithFlattenPos Prim) where
> > -   showDict1 = ShowDictClass
> > +-- instance Show1 (TreeWithFlattenPos Prim) where
> > +--   showDict1 = ShowDictClass
> >
> >  -- WithState and propFail are handy for debugging arbitrary code
> >  propFail :: Int -> Tree Prim C(x) -> Bool
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 339
> >                   WithEndState pp _ <- aPrimPair repo
> >                   return $ seal2 pp
> >
> > +instance Arbitrary (Sealed ((Prim :> Prim) C(a))) where
> > +  arbitrary = do repo <- aSmallRepo
> > +                 WithEndState pp _ <- aPrimPair repo
> > +                 return $ seal pp
> > +
> >  instance Arbitrary (Sealed2 (Prim :> Prim :> Prim)) where
> >    arbitrary = makeGen aSmallRepo
> >
> > hunk ./src/Darcs/Test/Patch/Arbitrary/PrimV1.hs 353
> >  instance Arbitrary (Sealed2 (FL Prim :> FL Prim)) where
> >    arbitrary = makeGen aSmallRepo
> >
> > +instance Arbitrary (Sealed ((FL Prim :> FL Prim) C(a))) where
> > +  arbitrary = makeSGen aSmallRepo
> >
> >  instance Arbitrary (Sealed2 (WithState RepoModel Prim)) where
> >    arbitrary
Attachments
msg14650 (view) Author: mornfall Date: 2011-08-14.09:06:21
Attaching the part of patch635 that actually went in (since the previous 
submission included an unrelated fix).
Attachments
msg14651 (view) Author: darcswatch Date: 2011-08-14.09:07:49
This patch bundle (with 21 patches) was just applied to the repository http://darcs.net/screened.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_screened.html#bundle-3e85d76a8ff2d6069fdb7b8ae5af4c9e4f8cfe08
msg14653 (view) Author: ganesh Date: 2011-08-14.10:49:01
This patch is in screened but not listed in the patch tracker -
seems to be logically part of this bundle.

1 patch for repository /home/ganesh/darcs/darcs-screened-temp:

Wed Jun  1 22:25:25 BST 2011  Petr Rockai <me@mornfall.net>
  * Fix up test group labels.
Attachments
msg14860 (view) Author: ganesh Date: 2011-12-27.20:47:32
The "Fix a couple of GHC 7 deprecation warnings" patch doesn't work with 
GHC 6.12, so dropping it for now. Should be easy enough to redo later.
msg14876 (view) Author: darcswatch Date: 2011-12-28.02:24:45
This patch bundle (with 21 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-3e85d76a8ff2d6069fdb7b8ae5af4c9e4f8cfe08
History
Date User Action Args
2011-06-21 17:46:44mornfallcreate
2011-06-26 08:54:44koweysetmessages: + msg14554
2011-06-26 11:49:56iagosetfiles: + unnamed
messages: + msg14555
2011-06-27 19:59:28mornfallsetfiles: + unnamed, fix-a-couple-of-ghc-7-deprecation-warnings_.dpatch, unnamed
messages: + msg14557
title: Merge Set2, Set2Unwitnessed and Set3Unwi... (and 12 more) -> generalise testing infrastructure & import Prim V3 skeleton
2011-07-11 10:25:40iagosetfiles: + unnamed
messages: + msg14583
title: generalise testing infrastructure & import Prim V3 skeleton -> Merge Set2, Set2Unwitnessed and Set3Unwi... (and 12 more)
2011-08-14 09:06:21mornfallsetstatus: needs-screening -> needs-review
files: + bootstrap-the-v3-prim-patches-as-a-clone-of-v1_.dpatch
messages: + msg14650
2011-08-14 09:07:47darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-3e85d76a8ff2d6069fdb7b8ae5af4c9e4f8cfe08
2011-08-14 09:07:49darcswatchsetmessages: + msg14651
2011-08-14 10:49:02ganeshsetfiles: + unnamed, fix-up-test-group-labels_.dpatch, unnamed
messages: + msg14653
title: Merge Set2, Set2Unwitnessed and Set3Unwi... (and 12 more) -> Fix up test group labels
2011-12-27 19:19:27ganeshsetstatus: needs-review -> accepted-pending-tests
2011-12-27 20:47:32ganeshsetmessages: + msg14860
2011-12-28 02:24:45darcswatchsetstatus: accepted-pending-tests -> accepted
messages: + msg14876