[Haskell-cafe] Darcs as undo/redo system?

Jason Dagit dagit at codersbase.com
Fri May 8 12:43:54 EDT 2009


Hi Peter,

On Fri, May 8, 2009 at 8:33 AM, Peter Verswyvelen <bugfact at gmail.com> wrote:
> If you work with a text editor like Microsoft Visual Studio (maybe also
> Eclipse, don't know), each text editor has its own undo/redo history.
> However, when you perform refactoring - like renaming a function - this
> becomes an undo/redo on multiple files together, so in a sense these changes
> are part of a global history.
> You can combine these two different kinds of mutations, and undo/redo still
> works as expected.
> I don't know how hard this is to implement, but it looks like this problem
> is somehow is related to Darcs theory of patches (which I don't know yet :-)

I have thought about applications of patch theory like this as well.
I could imagine applying it to the undo stack in GIMP.  Allowing you
to undo things on different layers.  I think one of the things you
need for this to work, is a graphical representation of the undo
history.  You could commute the change you want to undo to the top of
the stack, undo it, and then you have a branch in the history.
Because this could get complicated, you need to display this branched
history to the user so they are able to continue working with it.

If you wanted to work on this, I would encourage you to read more
about patch theory[1,2,3,4] and also try out libdarcs[5].

Thanks,
Jason

[1] http://darcs.net/manual/node9.html
[2] http://en.wikibooks.org/wiki/Understanding_darcs/Patch_theory
[3] http://files.codersbase.com/thesis.pdf (see chapter 3)
[4] http://wiki.darcs.net/DarcsWiki/Talks
[5] http://bugs.darcs.net/issue1149


More information about the Haskell-Cafe mailing list