First patch takes care of darcs-1 patch semantics, second one of darcs-2.
* abstract Patch over prim type
Replace Patch by Patch Prim:
M ./src/Darcs/Commands/Convert.lhs -4 +5
M ./src/Darcs/Commands/Get.lhs -2 +3
It happens here:
M ./src/Darcs/Patch/V1.hs -2 +3
hunk ./src/Darcs/Patch/V1.hs 5
+import Darcs.Patch.Prim ( PrimPatch )
hunk ./src/Darcs/Patch/V1.hs 15
-instance Patchy Patch
-instance RepoPatch Patch
+instance PrimPatch prim => Patchy (Patch prim)
+instance PrimPatch prim => RepoPatch (Patch prim)
Then it's a matter of adapting types:
M ./src/Darcs/Patch/V1/Apply.hs -2 +2
M ./src/Darcs/Patch/V1/Commute.lhs -41 +42
M ./src/Darcs/Patch/V1/Core.lhs -20 +19
M ./src/Darcs/Patch/V1/Read.hs -2 +3
M ./src/Darcs/Patch/V1/Show.lhs -6 +6
M ./src/Darcs/Patch/V1/Viewing.hs -2 +3
The changes are bigger in Commute, where more fine-grained class
requirements is done on some functions.
Replace Patch by Patch Prim:
M ./src/Darcs/Repository.hs -2 +3
M ./src/Darcs/Repository/Internal.hs -1 +2
M ./src/Darcs/Test/Patch.hs -1 +3
Same + use pragma "TypeSynonymInstances" to be able to write "type Patch
= V1.Patch Prim":
M ./src/Darcs/Test/Patch/Test.hs -11 +15
=============================
* abstract RealPatch over Prim
RealPatch -> RealPatch prim:
M ./src/Darcs/Commands/Convert.lhs -4 +4
An extra haddock comment:
M ./src/Darcs/Patch/V1/Core.lhs +4
Here is where it happens:
M ./src/Darcs/Patch/V2.hs -1 +2
-instance RepoPatch RealPatch
+instance PrimPatch prim => RepoPatch (RealPatch prim)
Many lines changed by just consequence of RepoPatch parametrization +
comment block as in ./src/Darcs/Patch/V1/Core.lhs:
M ./src/Darcs/Patch/V2/Real.hs -66 +72
RealPatch -> RealPatch prim:
M ./src/Darcs/Repository/Internal.hs -1 +1
Same + export existing data type "TreeWithFlattenPos", and introduce
"ArbitraryPrim" class to save some space in function signatures:
M ./src/Darcs/Test/Patch/QuickCheck.hs -12 +18
Same:
M ./src/Darcs/Test/Patch/Unit.hs -19 +20
Same + import aforementioned "TreeWithFlattenPos", and enforce proper
types on functions commuteTripleFromTree, commutePairFromTree,
commutePairFromTWFP, mergePairFromTree, mergePairFromTWFP, patchFromTree:
M ./src/Darcs/Test/Patch/Unit2.hs -15 +38
Compile, tests ok, pushing them.
|