19176, "stonea", "Should reshape function be moved into Array type? Should we rename it? Should we mark it unstable", "2022-02-04T00:41:17Z"
The array module has a free function proc reshape(A: [], D: domain)
. The only other free functions in that module are ones that deal with querying types (which may get moved into the type module anyway), so it's tempting to say we should move reshape
to be a method on the array type as well.
One argument for keeping it separated is that making it a method on the array type makes it sound like it will mutate that array (rather than returning a new array).
It might also get confused with the reindex
method (note that we can't reindex into a
different shape).
Even if we decide to keep it as a free function we still may want to change the name.