darcs

Patch 488 get rid of Effect instance for Prim (and 2 more)

Title get rid of Effect instance for Prim (and 2 more)
Superseder Nosy List ganesh
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-11-23.23:34:46 by ganesh, last changed 2011-05-10.19:37:09 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
get-rid-of-effect-instance-for-prim.dpatch ganesh, 2010-11-23.23:34:46 text/x-darcs-patch
unnamed ganesh, 2010-11-23.23:34:46
See mailing list archives for discussion on individual patches.
Messages
msg13250 (view) Author: ganesh Date: 2010-11-23.23:34:46
A few more cleanups.

DummyPatch is useful in some places where code is overloaded on the
patch type but has some aspects of its behaviour that are independent
of the patch type, so we need a Patchy instance that will be ignored.

3 patches for repository darcs-unstable@darcs.net:screened:

Tue Nov 23 07:42:46 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * get rid of Effect instance for Prim

Tue Nov 23 07:42:47 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * get rid of unnecessary instances for Prim

Tue Nov 23 07:42:49 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * introduce Dummy patch type
Attachments
msg13256 (view) Author: darcswatch Date: 2010-11-24.00:01:11
This patch bundle (with 3 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-e3626b5fec98a49b37536f538ae5ec718f44e74c
msg13619 (view) Author: gh Date: 2011-02-02.00:47:40
This bundle depends on patch487
msg13630 (view) Author: gh Date: 2011-02-05.18:15:52
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.
msg13631 (view) Author: darcswatch Date: 2011-02-05.18:35:25
This patch bundle (with 3 patches) was just applied to the repository http://darcs.net/.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-e3626b5fec98a49b37536f538ae5ec718f44e74c
msg14204 (view) Author: darcswatch Date: 2011-05-10.19:37:09
This patch bundle (with 3 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-e3626b5fec98a49b37536f538ae5ec718f44e74c
History
Date User Action Args
2010-11-23 23:34:46ganeshcreate
2010-11-23 23:35:54darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-e3626b5fec98a49b37536f538ae5ec718f44e74c
2010-11-24 00:01:11darcswatchsetmessages: + msg13256
2011-02-02 00:47:40ghsetmessages: + msg13619
2011-02-05 18:15:53ghsetstatus: needs-review -> accepted
messages: + msg13630
2011-02-05 18:35:25darcswatchsetmessages: + msg13631
2011-05-10 19:37:09darcswatchsetmessages: + msg14204