> Well, if you consider large word-processors like word keep a complete 
> undo history, I
> would keep a document as a list of changes:
> 
> data Document = Insert Location String | Delete Location Location ...

Better to store it as a pair of the most recent state, and a list of *reversed* 
changes.

--KW 8-)
-- 
Keith Wansbrough <[EMAIL PROTECTED]>
http://www.cl.cam.ac.uk/users/kw217/
University of Cambridge Computer Laboratory.

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to