Arithmetic for parametric type values in structs e.g., N+1

I would do the following.

julia> struct Foo{N,M}
           arr1::Array{Float64, N}
           arr2::Array{Float64, M}
           Foo{N}(a,b) where N= new{N, N+1}(a,b)
       end

julia> Foo{1}(rand(2), rand(2,3))
Foo{1, 2}([0.9165330134722103, 0.8133055136507046], [0.15120619990261142 0.8543356012671888 0.5239972992036701; 0.12074486400173157 0.6817097391005016 0.3327645622931258])
4 Likes