[darcs-users] Theory of Patches

Trent W. Buck trentbuck at gmail.com
Fri Apr 10 13:43:51 UTC 2009


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?



More information about the darcs-users mailing list