[ new ] Seq1#62
Conversation
|
I have a question about this (and similar mutable and size-indexed data structures in here): If we use functions like |
I've been thinking about this as well (before I create documentation for this repo). In general, most of the functions associated with the mutable (postfixed Some examples of this:
So I think this should be fine, since with those functions, we actually aren't internally mutating the original to create the new (we aren't utilizing applying any Although, now I see that |
|
I actually don't see the point of this. Why have a mutable finger tree in the first place? What use is it to store this in and retrieve it from an mutable reference? Why not just use the immutable inner value instead? |
The idea behind the For example, a thread-safe |
|
So you only need the immutable data structure in a mutable reference plus a CAS-loop for thread-safe mutation. Again, please have a look at idris2-async. I'd also argue that such a data structure is highly specialized. Not sure it should be in a general-purpose container library. My main concern is that we currently have a whole bunch of container types in this library, quite a few of which seem to be actually unsound. |
True, wrapping a given immutable data structure in a mutlable reference and utilizing CAS-loop allows for thread-safe mutation. Yeah, I can see how this stuff is specialized, although they are essentially wrappers around a more basic immutable version, which is why I thought they might be nice to include in this library. I believe the only unsound types as of now are I'm open to thinning down this library if you (or the community) feels strongly that these thread-safe mutable versions are out of scope for this library. |
|
I think the three issues currently open sum up my thoughts on this:
If these are properly addressed, then I think we should be fine. |
This PR adds
Seq1(Sized/Unsized), a linear (with thread-safe operations)Seq(Sized/Unsized).