Sam Tobin-Hochstadt
Sam Tobin-Hochstadt
This is basically the "transient" idea, first popularized in Clojure. This paper describes transients for RRB trees (what treelists are) but in C++, and uses some things we don't have...
Thanks, this looks like a reasonable approach.
Unfortunately, fixing this exposes problems in a number of other libraries. In particular, some `math` library operations will have different and more limited types (they were of course wrong before).
We should just change `typed/rackunit` to use `unsafe-require/typed` in a bunch of places.
Immutable hash tables would support `hash-set`, and you can't pass a mutable hash table where one is expected. Read-only tables would admit mutable ones, but you could only read them....
Yes, all of these things would be good ideas, and I think we could make everything compatible.
`HashTable` would be a supertype of the other types. I think the story for `Set` is less obvious. It's not clear that supporting more without supporting generic sets is useful.
Sure, if there's need, we should support it. I think we should just split `Set` and `MutableSet` though.