-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARec can't be grown/shrunk #128
Comments
I’d welcome input. The considerations are that If we go that route, should we then arrange that elements are stored in reverse order in the array from the type-level list (so as to present a more consistent API between At the type-level, cons’ing to the front of the list of types is certainly less work than appending to the end, so offering a back-insertion API for Lastly, do we care about the extra memory use needed to reasonably amortize the cost of adding elements as is done with What do you think? This would result in a function (name tbd) with type Edit: I managed to bury the lede here, actually. That kind of approach generally requires unsafe operations. Doing it purely would require something more like a rope than an array structure. I left out this API before because going through |
Wouldn't doing something analogous to |
It’s the efficiency that’s at question. We can use |
Oh, I know the difference in complexities, it's more that I don't really care, because the number of lookups (potentially one per bind in a given monad) is way, way, way bigger than the number of changes, which are 95% of the time just up front but it does need to support adding things after the fact. |
Fair enough; let’s do it. Any thoughts on naming? I don’t want to do anything clever, so perhaps calling it |
I can try and get it taken care of soon, but admittedly I'm very busy right now and this isn't priority zero for me. |
ARec
has a fixed size, meaning that when an element needs to be added or removed we have to round-trip toRec
. Even if we can stay on one side or the other with few switches, it still requires using the complex (honestly, beyond me)Rec
-type generic interface.The text was updated successfully, but these errors were encountered: