How do i create a custom supertype?

julia> struct Categorical{S, T} end

julia> upper_bound = Matrix{Categorical{T, Vector{T}}} where {T <: AbstractFloat}
Array{Categorical{T, Vector{T}}, 2} where T<:AbstractFloat

julia> Matrix{Categorical{Float64, Vector{Float64}}} <: upper_bound
true

(In the first line I defined a parametric struct named Categorical just so the code would run. Yours should behave the same with the Categorical type that you are getting from somewhere.)

1 Like