[darcs-users] Theory of Patches

Jason Dagit dagit at codersbase.com
Fri Apr 10 15:26:38 UTC 2009


On Fri, Apr 10, 2009 at 6:43 AM, Trent W. Buck <trentbuck at gmail.com> wrote:
> Jason Dagit <dagit at codersbase.com> writes:
>
>>> 2. Do patches have an internal representation that is context independent?
>>
>> Short answer: Yes and no.
>>
>> Detailed answer:
>> Yes:  There are no values in darcs that correspond to context.
>> Specifically, context is tracked implicitly.  Our witness types do
>> carry context information, but they are implemented as phantom types.
>> A phantom type is just a type variable with no value associated with
>> it.  So, in this sense the "representation" of a patch is independent
>> of the context.
>>
>> No:  When you commute two patches sometimes the representation of the
>> patches changes (see Chapter 3 of my thesis for an example).  One
>> could argue that the reason it changed is because the context is part
>> of that representation.  Additionally, we could track patch context
>> dynamically as we manipulate patch sequences.  This could potentially
>> have a huge negative impact on performance.
>
> I'm struggling to grasp this, so let me just ask:
>
> Are these answers inherent in a darcs-style dvcs (i.e. "patch theory"),
> or are they only relevant to the code base or current repository format?
> That is, could Daniel's goals be met if we change the repository format
> and/or the program logic?

This is a very good question and we need people to explore it.  I
don't know the answer but I think it's important.  Essentially, I see
them as intrinsic in the current implementation, but I can't see
beyond that yet.

Jason


More information about the darcs-users mailing list