-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
e.g. consider the sum type in the readme:
@sum_type AT begin
A(common_field::Int, a::Bool, b::Int)
B(common_field::Int, a::Int, b::Float64, d::Complex)
C(common_field::Int, b::Float64, d::Bool, e::Float64, k::Complex{Real})
D(common_field::Int, b::Any)
end
here A
, B
, C
and D
are just "fake types" used for making constructors for sum types. But I wonder why couldn't they be alias of the variants?
const A = SumTypes.Variant{:A, (:common_field, :a, :b), Tuple{Int64, Bool, Int64}}
this way the dispatch system will become available even for sum types, which is something it would be useful for things I plan to do in MixedStructTypes
, but I think it would be good in general...this shouldn't be breaking right?
Metadata
Metadata
Assignees
Labels
No labels