Tue Nov 23 07:42:46 GMT 2010 Ganesh Sittampalam <ganesh@earth.li>
* get rid of Effect instance for Prim
Some background on the Effect class. As explained in Darcs.Patch.Effect:
--------8<----------
-- | Patches whose concrete effect which can be expressed as a list of
-- primitive patches.
--
-- A minimal definition would be either of @effect@ or @effectRL@.
class Effect p where
effect :: p C(x y) -> FL (PrimOf p) C(x y)
effect = reverseRL . effectRL
effectRL :: p C(x y) -> RL (PrimOf p) C(x y)
effectRL = reverseFL . effect
instance Effect p => Effect (FL p) where
effect p = concatFL $ mapFL_FL effect p
effectRL p = concatRL $ mapRL_RL effectRL $ reverseFL p
instance Effect p => Effect (RL p) where
effect p = concatFL $ mapFL_FL effect $ reverseRL p
effectRL p = concatRL $ mapRL_RL effectRL p
-------->8----------
The file above is left untouched by this patch.
The Prim instance of Effect, removed by this patch
(./src/Darcs/Patch/Prim/V1.hs), is:
--------8<----------
instance Effect Prim where
effect p = p :>: NilFL
effectRL p = p :<: NilRL
-------->8----------
which indeed looks redundant.
Changes of the patch:
Remove "instance Effect Prim":
M ./src/Darcs/Patch/Prim/V1.hs -6
Consequence, fix some type signatures and introduce "class WL l" and
"instance WL FL" and "instance WL RL":
M ./src/Darcs/Patch/V2/Non.hs -7 +24
Finally, a consequence of Prim not being in Effect:
hunk ./src/Darcs/Test/Patch/Test.hs 618
- Just (mp' :> _) -> doml (effect p +>+ effect mp') ps
+ Just (mp' :> _) -> doml (p +>+ mp') ps
==================
Tue Nov 23 07:42:47 GMT 2010 Ganesh Sittampalam <ganesh@earth.li>
* get rid of unnecessary instances for Prim
Just removes instances in ./src/Darcs/Patch/Prim/V1.hs (FromPrim,
ToFromPrim, PrimPatchBase).
==================
Tue Nov 23 08:42:49 CET 2010 Ganesh Sittampalam <ganesh@earth.li>
* introduce Dummy patch type
Adds module Darcs.Patch.Dummy:
M ./darcs.cabal +1
Define "data DummyPatch C(x y)" with no constructor, making it instance
of relevant type classes:
A ./src/Darcs/Patch/Dummy.hs
Use module Darcs.Patch.Dummy instead of Darcs.Patch.Prim.V1:
M ./src/Darcs/Match.lhs -6 +6
M ./src/Darcs/Patch/Match.lhs -3 +2
M ./src/Darcs/Repository/Internal.hs -1 +3
Compiles, tests ok, pushing it.
|