-
Notifications
You must be signed in to change notification settings - Fork 0
Description
ReadonlyWrapper provides some neat functionality internally, but, broadly speaking, it isn't a totally robust solution. Phase does a lot of cloning that isn't strictly neccessary, but our policy is to clone in order to ensure that the a user can't accidentally corrupt a MultiIndexable via its shape or a coordinate.
Unfortunately, ReadonlyWrapper is also annoying to work with - it has a long and redundant type signature, and is somewhat slow to construct. Ideally, it would be possible to create a container that is mutable by the author, but can be exposed in a readonly fashion. Perhaps a container that stores a ReadonlyWrapper and the mutable data, to make the coupling tigher and ergonomics better?
That might make more sense as a separate library, and it might end up not providing a performance boost - but it surely could be interesting (perhaps shape could expose the data in a readonly way without having to construct a ReadonlyWrapper on each call, for example).