-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]designDesign of APIs or of the language itselfDesign of APIs or of the language itselfspeculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative
Description
The situation for the similar
function feels a little messy these days (perhaps I'm wrong about that and it's all under control, in which case, consider this a documentation request). It seems like the similar
API could be clarified with appropriate traits, e.g.
similar(a, Dense) # same dimensions and element type as `a` but dense
similar(a, Sparse) # same dimensions and element type as `a` but sparse
similar(a, Mutable) # same dimensions and element type as `a` but fully mutable
similar(a, ElType{T}) # same dimensions and storage type as `a` but with element type `T`
similar(a, Dimensions{...}) # same storage and element type as `a` but with different dimensions
This is sort of already what we're doing but the current system is a bit more ad hoc: type arguments are treated as an implicit element type trait and a tuple of integers is treated collectively as a dimensions trait. It might be fruitful to have a more explicit trait-based core API and translate the various shorthands into that.
timholy, oxinabox, TotalVerb, martinholters, ChrisRackauckas and 3 more
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]designDesign of APIs or of the language itselfDesign of APIs or of the language itselfspeculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative