-
Notifications
You must be signed in to change notification settings - Fork 27
Description
I believe there was a suggestion at some point to create a new package that would define a Domain type. I can't seem to find the comment. Anyway, I think at some point it will be a good way forward, hence this issue. No rush I guess.
Possible definitions may be:
1.
abstract type Domain end
abstract type AbstractDomain end
abstract type Domain{T} <: AbstractDomain end
Base.eltype(::Type{<:Domain{T}}) where T = T
abstract type Domain{T} end
Base.eltype(::Type{<:Domain{T}}) where T = T
These possibilities of course relate to the discussion of whether or not a domain has an eltype
.
My current personal stance is that domains represent discrete or continuous sets (which sets them apart from existing sets in Julia), that sets are expected to have elements, and that it is useful to convey information about that. However, we could ensure that T=Any
is a perfectly acceptable option, as it is in Julia for arrays:
julia> ["1", 2]
2-element Vector{Any}:
"1"
2
and for dictionaries:
julia> Dict("2"=>1, 2 => "3")
Dict{Any, Any} with 2 entries:
2 => "3"
"2" => 1
and for sets:
julia> Set([1, "2"])
Set{Any} with 2 elements:
"2"
1
In that case, for simplicity I'd favour the third option above.