Closed treeowl closed 1 year ago
So sizeofSmallMutableArray
sometimes returns the wrong result? We should think about deprecating it then, just like the underlying primitive.
@konsumlamm The situation is slightly more complicated than that, I think. Originally, there was no primop for shrinking in place; "resizing" always meant copying. So a pure function for the size was totally fine. Now that there is a shrinking primop, we need to have an IO
action to be sure to get the most recent size, rather than one that might be CSEed from earlier. However, it's arguably okay to use it in a program that doesn't use shrinking. Most programs, indeed, don't use shrinking. So ... I dunno if deprecation is right or not. I don't want to make that decision in this PR; we can discuss it in an issue if you like.
Agree that it should be a separate issue. For now this LGTM. Thanks for expanding the docs @treeowl .
I've opened #373 to discuss that.
Thanks for the review, @chessai .
@chessai I added some documentation since your review. Would you mind giving it a once-over?