darcs

Patch 1451 abstract out checking whether a Named is... (and 2 more)

Title abstract out checking whether a Named is... (and 2 more)
Superseder Nosy List ganesh
Related Issues
Status accepted Assigned To
Milestone

Created on 2016-02-15.06:17:01 by ganesh, last changed 2016-03-18.19:54:48 by gh.

Files
File name Status Uploaded Type Edit Remove
abstract-out-checking-whether-a-named-is-internal.dpatch ganesh, 2016-02-15.06:17:01 application/x-darcs-patch
patch-preview.txt ganesh, 2016-02-15.06:17:01 text/x-darcs-patch
unnamed ganesh, 2016-02-15.06:17:01 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg19033 (view) Author: ganesh Date: 2016-02-15.06:17:01
some random cleanups related to the rebase refactoring
3 patches for repository darcs-unstable@darcs.net:screened:

patch dca9c5b9376c5f8ba6572cbed260de5473a33984
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Fri Feb 12 23:56:05 GMT 2016
  * abstract out checking whether a Named is internal

patch e76a9e074404dc76ead47c8e93104e6b5a30ca8b
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Fri Feb 12 23:56:05 GMT 2016
  * drop re-exports from Darcs.Patch.Rebase

patch a4a7034615a1bbcbf3b7af64092d584e759d65a1
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Fri Feb 12 23:56:05 GMT 2016
  * Get rid of the need for DummyPatch in Darcs.Patch.Match
Attachments
msg19098 (view) Author: gh Date: 2016-03-18.19:15:42
* abstract out checking whether a Named is internal: OK
    * replace 'isInternal' by 'runInternalChecker'
    * MaybeInternal: remove 'flIsInternal', moved to Named as
'namedIsInternal'
    * Internal, Match.dropn, Match.safetake: we just use
'namedIsInternal' on (map hopefully ps)
    * in Tag and Match: use namedInternalChecker instead of
patchInternalChecker
    * looks good.

* drop re-exports from Darcs.Patch.Rebase: OK

* Get rid of the need for DummyPatch in Darcs.Patch.Match:

Here I have a doubt. If getting rid of DummyPatch is important, why are
there remaining cases in in D.P.Match ?
msg19101 (view) Author: ganesh Date: 2016-03-18.19:45:51
On 18/03/2016 19:15, Guillaume Hoffmann wrote:

> * Get rid of the need for DummyPatch in Darcs.Patch.Match:
> 
> Here I have a doubt. If getting rid of DummyPatch is important, why are
> there remaining cases in in D.P.Match ?

Good question. I originally introduced DummyPatch to replace a case
where Prim was being used effectively as a dummy patch type, probably so
I could decouple the generic code in D.P.Match from any (real) specific
patch type.

It was an improvement on using Prim, but still a bit of a code smell: if
the code we are working with genuinely cares about a patch type
DummyPatch is unlikely to be right, and if it doesn't care about a patch
type then why does it need one in the first place.

I think in practice it's used for code where the patch type doesn't
matter but imperfectly factored types/abstractions mean that one still
has to be supplied.

Ideally we'd get rid of the lot, either by passing in the real patch
type or by factoring the patch type parameter out of the code. In
practice here I probably just removed some cases that were an obstacle
to other refactorings or that I happened to notice along the way. Given
that there are still uses of it, the patch comment is slightly
inaccurate, sorry about that.
msg19103 (view) Author: gh Date: 2016-03-18.19:54:48
Well ok, then the change is sound in itself, in spite of the patch name.

Accepting the bundle.
History
Date User Action Args
2016-02-15 06:17:01ganeshcreate
2016-03-05 15:28:46ghsetstatus: needs-screening -> needs-review
2016-03-18 19:15:42ghsetstatus: needs-review -> review-in-progress
messages: + msg19098
2016-03-18 19:45:52ganeshsetmessages: + msg19101
2016-03-18 19:54:48ghsetstatus: review-in-progress -> accepted
messages: + msg19103