-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The bottom type Union{} has some nice properties. For example, a DiscreteCategory{Ob} could be a model of ThCategory{Ob, Union{}}. However, GATlab tries to instantiate the method id(x::Union{}) = ... and the Julia compiler rejects this due to a breaking change in Julia 1.10 that has persisted in 1.11. In Julia 1.12 it might be addressed.
So this issue is just documenting an upstream problem rather than anything to be done in GATlab itself.
In practice, this just leads to definitions like DiscreteCategory{Ob, Hom} - we have to manually declare what the homs would be when creating a discrete category, which is cumbersome. Another solution is that we can use a type parameter: @instance ThCategory{Ob, T} where {T<:Union{}} (the compiler does not reject f(x::T) where {T<:Union{}}), though this results in a bunch of "T was declared but not used" warnings.