Structure type + in place modification of columns of arrays

For your first problem, you are looking for:

struct SubT1{F, N}
    # Not AbstractArray - use a concrete type
    # The eltype of B is a subtype of Distribution
    B :: Array{<: Distribution{F}, N}
end

K = 5
T = 2
B = Bernoulli.(rand(K,T))

h = SubT1(B)
2 Likes