darcs

Patch 120 move witness support into its own namespace

Title move witness support into its own namespace
Superseder Nosy List dagit, darcs-users, ganesh, kowey
Related Issues
Status accepted Assigned To dagit
Milestone

Created on 2009-12-19.23:01:03 by ganesh, last changed 2011-05-10.18:36:05 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
move-witness-support-into-its-own-namespace.dpatch ganesh, 2009-12-19.23:01:01 text/x-darcs-patch
move-witnesses-code-into-its-own-namespace.dpatch ganesh, 2009-12-24.16:56:55 text/x-darcs-patch
unnamed ganesh, 2009-12-19.23:01:01 text/plain
unnamed ganesh, 2009-12-24.16:56:55 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg9651 (view) Author: ganesh Date: 2009-12-19.23:01:01
Hi,

I think it would be good to have all the witness support code in
a specific namespace.

Really annoyingly, the replace patches here don't commute/merge with most
other replace patches, because they have '.'s in the regexp to support
the renaming of Darcs.Ordered -> Darcs.Witnesses.Ordered etc, and
replace patches with different regexps never commute.

So it may be worth delaying this if there is anything else outstanding
it would conflict with.

Ganesh

Sat Dec 19 22:56:17 GMT 2009  Ganesh Sittampalam <ganesh@earth.li>
  * move witness support into its own namespace
Attachments
msg9671 (view) Author: kowey Date: 2009-12-24.10:33:55
On Sat, Dec 19, 2009 at 23:01:03 +0000, Ganesh Sittampalam wrote:
> I think it would be good to have all the witness support code in
> a specific namespace.
> 
> Really annoyingly, the replace patches here don't commute/merge with most
> other replace patches, because they have '.'s in the regexp to support
> the renaming of Darcs.Ordered -> Darcs.Witnesses.Ordered etc, and
> replace patches with different regexps never commute.

So aside from the commute problems, one of the entries in our
GettingStarted guide (I think I wrote this after our experiences merging
in some replace patches) was

  Try to avoid using the tokens . and - in your darcs replace patches
  that affect Haskell files. The problem is that the . can affect code
  like lines.liftM

Now I don't really remember why this would be an issue in practice.

Anyway, as for the commute problem, the Darcs manual suggests that as a
best practise, each project should standardise on its own set of tokens
to avoid the commute problem (or at least it used to).

Do we you think we should follow that advice and just darcs replace for
things we can do with (say) the default tokens?

Eric, who has submitted his fair share of weird darcs replace patches.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
msg9672 (view) Author: ganesh Date: 2009-12-24.10:42:13
On Thu, 24 Dec 2009, Eric Kow wrote:

> Eric Kow <kowey@darcs.net> added the comment:
>
> On Sat, Dec 19, 2009 at 23:01:03 +0000, Ganesh Sittampalam wrote:
>>
>> Really annoyingly, the replace patches here don't commute/merge with most
>> other replace patches, because they have '.'s in the regexp to support
>> the renaming of Darcs.Ordered -> Darcs.Witnesses.Ordered etc, and
>> replace patches with different regexps never commute.
>
> So aside from the commute problems, one of the entries in our
> GettingStarted guide (I think I wrote this after our experiences merging
> in some replace patches) was
>
>  Try to avoid using the tokens . and - in your darcs replace patches
>  that affect Haskell files. The problem is that the . can affect code
>  like lines.liftM
>
> Now I don't really remember why this would be an issue in practice.

I suspect it's unlikely, because namespaces typically aren't also values 
that are used in compositions - in theory there might be data constructors 
Darcs and Ordered which would mean that Darcs.Ordered could mean that 
composition (though I forget precisely what the Haskell syntax actually 
defines in that situation).

In general I think Haskell is moving in the direction of requiring spaces 
around operators where they might otherwise be ambiguous with other syntax 
- e.g. this can happen with $ if you have Template Haskell enabled, as 
$foo is a splice, so you have to do $ foo instead if you want application. 
So as a general principle I think it should be a darcs coding standard to 
use spaces around the . operator.

> Anyway, as for the commute problem, the Darcs manual suggests that as a
> best practise, each project should standardise on its own set of tokens
> to avoid the commute problem (or at least it used to).
>
> Do we you think we should follow that advice and just darcs replace for
> things we can do with (say) the default tokens?

Well, if I change them to hunk patches, then they'll commute badly with 
other patches that affect the same lines, but as things stand they commute 
badly with any other replace patch at all. I guess the former is 
preferable.

Cheers,

Ganesh
msg9680 (view) Author: ganesh Date: 2009-12-24.16:56:55
Here's an alternate version of the patch that uses hunk patches
rather than replace patches. I'd be happy with either variant
being applied.

Thu Dec 24 14:22:04 GMT 2009  Ganesh Sittampalam <ganesh@earth.li>
  * move witnesses code into its own namespace
Attachments
msg9681 (view) Author: ganesh Date: 2009-12-24.17:01:57
Jason, I'm adding you to the nosy list on this patch because I'd like your 
approval for the principle behind this patch, namely that the witnesses support 
code should live in its own 'Darcs.Witnesses' namespace.
msg9683 (view) Author: kowey Date: 2009-12-25.14:07:20
Perhaps you could just push it if you approve in principle? (thanks!)
msg9685 (view) Author: darcswatch Date: 2009-12-26.08:05:35
This patch bundle (with 1 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-5a7996d72a41b6afd2abe6a0b26d20abcbcde12f
msg14118 (view) Author: darcswatch Date: 2011-05-10.18:36:05
This patch bundle (with 1 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-5a7996d72a41b6afd2abe6a0b26d20abcbcde12f
History
Date User Action Args
2009-12-19 23:01:03ganeshcreate
2009-12-19 23:02:12darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-2feb269dde248a323ebcb7dacc7f2cbcef048b08
2009-12-24 10:33:56koweysetnosy: + kowey
messages: + msg9671
2009-12-24 10:42:14ganeshsetmessages: + msg9672
2009-12-24 16:56:55ganeshsetfiles: + move-witnesses-code-into-its-own-namespace.dpatch, unnamed
messages: + msg9680
2009-12-24 16:57:55darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-2feb269dde248a323ebcb7dacc7f2cbcef048b08 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-5a7996d72a41b6afd2abe6a0b26d20abcbcde12f
2009-12-24 17:01:58ganeshsetnosy: + dagit
messages: + msg9681
2009-12-25 14:07:20koweysetassignedto: dagit
messages: + msg9683
2009-12-26 08:05:37darcswatchsetstatus: needs-review -> accepted
messages: + msg9685
2011-05-10 17:35:58darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-5a7996d72a41b6afd2abe6a0b26d20abcbcde12f -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-2feb269dde248a323ebcb7dacc7f2cbcef048b08
2011-05-10 18:36:05darcswatchsetmessages: + msg14118