darcs

Patch 490 remove unused parameter (and 6 more)

Title remove unused parameter (and 6 more)
Superseder Nosy List ganesh
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-11-23.23:40:23 by ganesh, last changed 2011-05-10.21:36:39 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
remove-unused-parameter.dpatch ganesh, 2010-11-23.23:40:23 text/x-darcs-patch
unnamed ganesh, 2010-11-23.23:40:23
See mailing list archives for discussion on individual patches.
Messages
msg13252 (view) Author: ganesh Date: 2010-11-23.23:40:23
More cleanups and refactorings. Trying to get cruft out
of the Apply class, and to inch the Conflict class towards
something I can understand.

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

Tue Nov 23 07:50:37 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * remove unused parameter

Tue Nov 23 07:50:39 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * get rid of unused default implementation for apply

Tue Nov 23 07:50:40 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * break patch repair out into its own class

Tue Nov 23 07:50:41 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * remove default for resolveConflicts

Tue Nov 23 07:50:43 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * drop an unused instance of Conflict

Tue Nov 23 07:50:44 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * move consistency checking into Darcs.Patch.Repair

Tue Nov 23 07:50:45 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * put commuteNoConflicts into its own class and remove default impl
Attachments
msg13255 (view) Author: darcswatch Date: 2010-11-24.00:01:10
This patch bundle (with 7 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-b07dcf7daad26e23391c4ca60cd3a10305d36a50
msg13640 (view) Author: gh Date: 2011-02-06.12:36:53
Tue Nov 23 07:50:37 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * remove unused parameter

OK

==============
Tue Nov 23 07:50:39 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * get rid of unused default implementation for apply


OK

==============

Tue Nov 23 07:50:40 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * break patch repair out into its own class


The change of this patch consists in removing the following functions
from the class Apply:

    applyAndTryToFix :: WriteableDirectory m => p C(x y) -> m (Maybe
(String, p C(x y)))
    applyAndTryToFix p = do apply p; return Nothing
    applyAndTryToFixFL :: WriteableDirectory m => p C(x y) -> m (Maybe
(String, FL p C(x y)))
    applyAndTryToFixFL p = mapMaybeSnd (:>:NilFL) `liftM` applyAndTryToFix p


And putting them respectively in in the classes Repair and RepairToFL,
that are in the new module Darcs.Patch.Repair.

The class RepairToFL is in its turn added as requirement to the classes
RepoPatch, PrimPatch. (*)

Now a little file-by-file summary:

Introduces Darcs.Patch.Repair:
        M ./darcs.cabal +1

Split class "Apply":
        M ./src/Darcs/Patch/Apply.lhs -22 +1

Add "instance RepairToFL p => Repair (Named p)" (due to split):
        M ./src/Darcs/Patch/Named.lhs -1 +3

Add "instance RepairToFL p => Repair (PatchInfoAnd p)" (due to split):
        M ./src/Darcs/Patch/PatchInfoAnd.hs +3

Already mentioned (*):
        M ./src/Darcs/Patch/Prim/Class.hs -1 +2

Add "instance RepairToFL Prim" (due to split):
        M ./src/Darcs/Patch/Prim/V1/Apply.lhs +4

The new module:
        A ./src/Darcs/Patch/Repair.hs

Already mentioned (*):
        M ./src/Darcs/Patch/RepoPatch.hs -1 +2

Add "instance PrimPatch prim => RepairToFL (Patch prim)" (due to split):
        M ./src/Darcs/Patch/V1/Apply.hs -4 +5

Add "instance PrimPatch prim => RepairToFL (RealPatch prim)" (due to split):
        M ./src/Darcs/Patch/V2/Real.hs -1 +3

Import "applyAndTryToFix" from Darcs.Patch.Repair instead of
Darcs.Patch.Patchy (which keeps in importing Darcs.Patch.Apply, but not
Repair):
        M ./src/Darcs/Repository/Repair.hs -1 +1


So Darcs.Repository.Repair (the only module outside of Darcs.Patch
impacted by this patch) now imports Darcs.Patch.Repair instead of
Darcs.Patch.Patchy, which is more fine-grained.

===============
Tue Nov 23 07:50:41 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * remove default for resolveConflicts

OK.

================
Tue Nov 23 07:50:43 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * drop an unused instance of Conflict

OK.

===============
Tue Nov 23 07:50:44 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * move consistency checking into Darcs.Patch.Repair

Moves function isInconsistent from the class Conflict
(Darcs.Patch.Conflict) to a new class Check (Darcs.Patch.Repair). This
class Check is added as requirement to the class RepoPatch.

The rest is about fixing instances. Just one weird change at first
sight, in Darcs.Patch.V2.Real:

+instance PrimPatch prim => Check (RealPatch prim) where
+    isInconsistent = isConsistent

But it's fine since both functions are about issuing a message if
something is wrong with a patch.

(No module outside of Darcs.Patch is impacted)

================
Tue Nov 23 07:50:45 GMT 2010  Ganesh Sittampalam <ganesh@earth.li>
  * put commuteNoConflicts into its own class and remove default impl

Main change happens in ./src/Darcs/Patch/Conflict.hs by introducing
class CommuteNoConflicts whose only function commuteNoConflicts was in
class Conflict. Also no longer include its default implementation.

The rest is fixing imports and instances (class CommuteNoConflicts si
added as requirement to RepoPatch).

I guess this will help defining patch types for which there are no
conflicts: make them belong to CommuteNoConflicts class, but not to
Conflict.

=================

Compile and tests ok, pushing them.
msg13784 (view) Author: darcswatch Date: 2011-03-09.18:35:42
This patch bundle (with 7 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-b07dcf7daad26e23391c4ca60cd3a10305d36a50
msg14361 (view) Author: darcswatch Date: 2011-05-10.21:36:39
This patch bundle (with 7 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-b07dcf7daad26e23391c4ca60cd3a10305d36a50
History
Date User Action Args
2010-11-23 23:40:23ganeshcreate
2010-11-23 23:42:16darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-b07dcf7daad26e23391c4ca60cd3a10305d36a50
2010-11-24 00:01:10darcswatchsetmessages: + msg13255
2011-02-06 12:36:55ghsetstatus: needs-review -> accepted
messages: + msg13640
2011-03-09 18:35:42darcswatchsetmessages: + msg13784
2011-05-10 21:36:39darcswatchsetmessages: + msg14361