About the `Array{<:Number, 2}` syntax

Hi every julia linguist,

I am trying to find some info about the Array{<:Number, 2} syntax
for matrix, tensor as mentioned in the slide “about Julia 1.0” given by Stefan KARPINSKI / JuliaCon 2016

(goto 3m12s)

I do not find relevant track neither at Issues · JuliaLang/julia · GitHub or GitHub - JuliaLang/Juleps: Julia Enhancement Proposals
I have googled a lot of keywords combination without any success.

My last proposition may be dimensional parametric abstract type

Can someone tell me a bit more about it ?
Is there any page in the manual / github issue already dedicated to it ?

That particular syntax is, I think: https://github.com/JuliaLang/julia/issues/6984

A lot of the other changes were implemented as part of: https://github.com/JuliaLang/julia/pull/18457
(e.g. you can now write the type Array{T,3} where T<:Number)

Ok, thanks for your answer.

I gather here the links you mention and some others that could be useful.

FEATURE REQUEST: ADD SYNTACTIC SUGAR FOR COVARIANT ACTUAL TYPE PARAMETERS
https://github.com/JuliaLang/julia/issues/6984

SYNTACTIC SUGAR FOO{<:BAR} FOR FOO{T} WHERE T<:BAR #20414
https://github.com/JuliaLang/julia/pull/20414

TYPE SYSTEM REVISION AND NEW SUBTYPE ALGORITHM
https://github.com/JuliaLang/julia/pull/18457

TYPES / UNIONALL TYPES
https://github.com/JuliaLang/julia/blob/master/doc/src/manual/types.md#unionall-types

METHODS / PARAMETRIC METHODS
https://github.com/JuliaLang/julia/blob/master/doc/src/manual/methods.md#parametric-methods

I am still struggling a bit to find information about the parametric where rule

f(x::T) where T = T seems a bit tautological to me.

1 Like

where is a new syntax in the development version of Julia (0.6). More information will probably come once that releases.
I don’t think your ‘tautological’ example is right. It is short for f(x::T) where T <: Any = T, so it defines a function, for any T, that returns T (the type of x). If that is what you want it is not tautological.

I agree that docs is rather sparse for now.

It seems to me that some default value could help a lot to enhance clarity.
Even the foo where bar where baz couldn’t be allegiated to foo where bar, baz

[edit] But the thread `Where` questions should be a better place to discuss about that :wink: