[darcs-users] [patch120] move witness support into its own namespace
ganesh at earth.li
Thu Dec 24 10:42:02 UTC 2009
On Thu, 24 Dec 2009, Eric Kow wrote:
> Eric Kow <kowey at 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
More information about the darcs-users