[Haskell-cafe] Advice needed on best way to simulate an STL vector
Robert Dockins
robdockins at fastmail.fm
Wed Apr 19 15:31:37 EDT 2006
On Apr 19, 2006, at 3:06 PM, Brian Hulley wrote:
> Thanks. I might try this if I don't have any luck with finger trees
> (from Udo's post), or if they seem too heavy for the simple thing
> I'm planning to use them for (implementing the text buffer for an
> edit control which needs a mutable array of lines where each line
> contains a mutable array of character info). I don't need non-Int
> indices so your data type for Vector would be fine.
In that case, you may be interested in this paper, which discusses a
data structure specifically designed for strings called 'ropes':
http://www.cs.ubc.ca/local/reading/proceedings/spe91-95/spe/vol25/
issue12/spe986.pdf
I'm not aware of a Haskell implementation of ropes, but there may
well be one floating around. Actually, I'd be kind of surprised if
someone hasn't implemented this already (does YI use ropes?); it
seems like such a great fit for Haskell.
Rob Dockins
Speak softly and drive a Sherman tank.
Laugh hard; it's a long way to the bank.
-- TMBG
More information about the Haskell-Cafe
mailing list