As we move to treating multiply decorated cospans like a vector of AbstractModels, we might want to consider refactoring it into a subtype of AbstractVector.
In this case a Decorated is like an AbstractVector of Models that also has dom,codom
we could do Decorated <: AbstractVector{AbstractModel} and then a lot of other Base functionality would come, like map, filter, broadcasting...
we just have to overload getindex(d::Decorated, i::Int), set_index!(d, i, val::AbstractModel) and a few other things. https://docs.julialang.org/en/v1/manual/interfaces/#man-interface-array-1.
I'd also like the ability to represent singly Decorated cospans without the overhead of a singleton array.
As we move to treating multiply decorated cospans like a vector of AbstractModels, we might want to consider refactoring it into a subtype of AbstractVector.
In this case a Decorated is like an AbstractVector of Models that also has
dom,codom
we could doDecorated <: AbstractVector{AbstractModel}
and then a lot of other Base functionality would come, likemap, filter, broadcasting
... we just have to overloadgetindex(d::Decorated, i::Int), set_index!(d, i, val::AbstractModel)
and a few other things. https://docs.julialang.org/en/v1/manual/interfaces/#man-interface-array-1.I'd also like the ability to represent singly Decorated cospans without the overhead of a singleton array.