SelectChanges is a very important part of the Darcs UI and part of what makes
darcs special. The existing code is written in a style that:
1) is hard to understand;
2) is missing automated tests; and
3) includes an ad-hoc zipper implementation.
I propose that someone spend time refactoring this bit of code to address each
point above as this code is part of what makes Darcs special. Several times
when people have wanted to change this code there has been a general lack of
confidence in understanding the existing code and how to change it. I believe
this is a sign that the existing code should be improved for clarity and testing.
I'm not sure if we can pull in an existing list zipper because of our FLs and
RLs, so we may need to roll our own. If we do this, we need to be sure to add
unit tests for the zipper functionality. Hackage has a few zipper libraries
already. Perhaps it would even make sense to separate Darcs.Ordered from the
darcs repo and create packages on hackage for Darcs.Ordered and any related
zipper modules.
Reading material for zippers can be found here:
http://en.wikibooks.org/wiki/Haskell/Zippers
Jason
|