On Tuesday, April 29, 2014 5:14:01 PM UTC+1, Jason Merrill wrote:
>
> Suppose the types that you want existed. Let's call them ConcreteArray,
> and Cell.
>
> ConcreteArray gives the guarantee that all of it's elements are stored
> directly with a fixed stride.
>
> Can you give some examples of functions that would use these in their type
> signature?
>
Sure. sum(x::ConcreteArray{Number}). Because currently if I write
sum(x::Array{Real}) and try to pass in an Array{Float64} I get an error.
Note that most arrays are actually homogeneous (as Jacob and Matt both
stated), so if you want to make sure of that you need to use static
parameters. I'm suggesting a system that doesn't require static parameters
for the usual case.