[rust-dev] purely function red-black tree

Steve Jenson stevej at fruitless.org
Tue Dec 18 16:56:57 PST 2012


On Mon, Dec 17, 2012 at 11:46 AM, Graydon Hoare <graydon at mozilla.com> wrote:

> On 12-12-17 11:28 AM, Graydon Hoare wrote:
> > On 12-12-14 03:51 PM, Steve Jenson wrote:
> >> I recently ported Matt Might's Scala port of Okasaki's purely functional
> >> red-black tree to Rust and am looking for some feedback.
> >>
> >> https://github.com/stevej/rustled/blob/master/red_black_tree.rs
> >>
> >> I've written this for 0.4 and will update it with other feedback I've
> >> received for 0.5 when that lands.
> >
> > Nice! The only things I'd ask are:
> >
> >   - I can't tell at a glance (sorry, RB-trees are always very subtle)
> >     whether this is an LLRB. If not, could you make it so? It's likely
> >     just a simplification to a couple of the functions.
>
> Er, except of course, there's also:
>
>   https://github.com/fawek/llrbt.rs
>
> I think we need some better coordination of library development :)
>

That's a mutable LLRB tree whereas mine is immutable.

Since the language provides optional mutability, is it a goal to have both
pure functional and mutable versions of common data structures and traits?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20121218/bcf82752/attachment.html>


More information about the Rust-dev mailing list