Hello, is multiple dispatch possible for an enumerated type ?
my version:
@enum Foo M=1 N=2
Bar(x) = Bar(Val(x))
Bar(::Val{M}) = 111
Bar(::Val{N}) = 222
Hello, is multiple dispatch possible for an enumerated type ?
my version:
@enum Foo M=1 N=2
Bar(x) = Bar(Val(x))
Bar(::Val{M}) = 111
Bar(::Val{N}) = 222
Possible, but perhaps not desirable. See
Does the same apply for SumTypes.jl too?
Take a look at WhereTraits.jl or even MLStyle.jl @switch, for example.