the GenericMemory
type parameters
#54312
Labels
arrays
[a, r, r, a, y, s]
breaking
This change will break code
design
Design of APIs or of the language itself
speculative
Whether the change will be implemented is speculative
#53854 (comment) @oscardssmith
The order of the parameters: could the element type be moved to the front?GenericMemory
has three type parameters, of which the element type is set in stone, as it's required by theAbstractVector
supertype; the remaining two parameters seem subject to change. I think it would make sense to make the element type the first type parameter, and perhaps declare in the docs that the rest of the type parameters are experimental/subject to change. This would make it more convenient to useGenericMemory
as a type parameter in user types while avoiding the non-public type parameters ofGenericMemory
.For example, the FixedSizeArrays package (not registered yet), is currently backed by
Memory
storage, but it'd ideally supportGenericMemory
: JuliaArrays/FixedSizeArrays.jl#33. Currently thestruct
definition looks like this (ref):GenericMemory
support could look something like this:Moving the element type parameter of
GenericMemory
to the first place would enable avoiding the awkward<:Any
above.The
kind
parameter: could it be made a singleton type instead of aSymbol
value?Having something like this, unlike just
Symbol
s, would be typo-proof:The text was updated successfully, but these errors were encountered: