jpfairbanks / SemanticModels.jl

A julia package for representing and manipulating model semantics
MIT License
77 stars 17 forks source link

Better handling of Decorated type #237

Open jpfairbanks opened 4 years ago

jpfairbanks commented 4 years ago

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.