BinaryTraits.jl
BinaryTraits.jl copied to clipboard
RFC: Allow multiple traits in one interface
It should be possible to define interfaces, which require more than one interface type. Example with proposal for syntax:
@trait ProblemDescription prefix Is,IsNot
@trait Solve
@implement Tuple{IsProblemDescription,CanSolve} by solve(_2, _1, general_parameters)
Love this idea. The syntax shouldn't require Tuple{}
construct though?
@implement IsProblemDescription,CanSolve by solve(_2, _1, general_parameters)
Agreed. Your syntax looks cleaner.
I was actually thinking of the key type of BinaryTraits.interface_map
and the value type of traits_map
. ( Tuple{A,B} isa Datatype
). But that is independent of the user syntax.
This feature is a generalization of what was proposed from #29