You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In TemporalData, I was led to the following design pattern: I instantiate a category like so, but I also create an empty struct StrictIntervalCat so I can explicitly reference the model of the category theory in code.
""" The category of intervals and their strict embeddings (inclusions). """
abstract type StrictIntervalCat{T} <: Category{Interval, StrictIntervalEmbedding, SmallCatSize} where T end
""" The instantiation of the category of strict embeddings """
@instance ThCategory{Interval, StrictIntervalEmbedding} begin
dom(f::StrictIntervalEmbedding) = f.dom
codom(f::StrictIntervalEmbedding) = f.codom
id(i::Interval) = StrictIntervalEmbedding(i)
function compose(f::StrictIntervalEmbedding, g::StrictIntervalEmbedding)
StrictIntervalEmbedding(dom(f), codom(g))
end
end
I know @kris-brown is working on a deeper integration of GATlab with Catlab, but I think we should be able to refer to the model of the category explicitly after we instantiate it. Perhaps @instance can produce a struct so we can dispatch on it?
Naively,
StrictIntervalCat = @instance ThCategory{Interval, StrictIntervalEmbedding} begin ...
The text was updated successfully, but these errors were encountered:
In TemporalData, I was led to the following design pattern: I instantiate a category like so, but I also create an empty struct
StrictIntervalCat
so I can explicitly reference the model of the category theory in code.I know @kris-brown is working on a deeper integration of GATlab with Catlab, but I think we should be able to refer to the model of the category explicitly after we instantiate it. Perhaps
@instance
can produce a struct so we can dispatch on it?Naively,
The text was updated successfully, but these errors were encountered: