Hi Rob, On Tue, Jan 13, 2009 at 18:12:01 -0600, Rob Hoelz wrote: > What happens is I have an FL of hunks that apply to a file when > recording. When the user hits 'e', Darcs drops into an editor and > accepts their changes. After the editor exits, I rescan the file for > hunks. Let's say that our old hunk list is (1, 2, 3, 4, 5), and our > user hits 'y' for 1 and 2, then 'e' for 3. Now suppose that the user > alters change 3 (resulting in a change we'll call 6), and removes > change 4 altogether. Our new list of changes is now (1, 2, 6, 5). > When Darcs resumes, the user shouldn't have to press 'y' for 1 and 2 > again, so my code attempts to compare the two patch lists and find the > largest common prefix. Unfortunately, because of type witnesses, my > comparison function will not compile. Again, I don't think I can do > this without unsafeCoerce (but I would be happy to accept and implement > suggestions!)
I'm not too familiar with the type witnesses (maybe somebody like Ganesh would comment), but from your description of the situation, I don't see any way to avoid using unsafeCoerce in your common prefix function. > So, when is it ok to use unsafeCoerceP(2), and do you think it's > necessary in this case? If you find some answers in the ensuing discussion, please consider wikifying them, maybe in http://wiki.darcs.net/index.html/DarcsInternals Thanks for your questions! -- Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow> PGP Key ID: 08AC04F9
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
