Nothing like this exists. There aren’t many situations where this is a useful quantity to know. You’ll have to define it yourself for your types of interest if you really need it.

It’s tricky because you’d think that you could do things like foo(x::LowerTriangular) = div(size(x,1)^2 + size(x,1), 2),
but what about LowerTriangular{T,<:Diagonal}? What about LowerTriangular{T, SparseMatrixCSC{T,Int}} and LowerTriangular{T, Diagonal{T, SparseVector{T,Int}}}? How about UpperTriangular{T, UnitLowerTriangular{T, Matrix{T}}}? And it gets even harder when you start looking at SubArray (ie, view) wrappers. This question is staggeringly complicated when you consider nested types like these.