Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Proposal: CombinedTrait #71

Open
matbesancon opened this issue Aug 1, 2020 · 0 comments
Open

Proposal: CombinedTrait #71

matbesancon opened this issue Aug 1, 2020 · 0 comments

Comments

@matbesancon
Copy link

This could be a simpler alternative to #2

Defining a trait CombinedTrait{X, T1, T2} with T1{X}, T2{X} traits.

The implementation of CombinedTrait{X, T1, T2} could be given by a function combine_trait implemented as trait_func1(X) && trait_func2(X) (I am not sure if this is feasible)

On the user side, a combined trait can be specified on a function with:

@traitfn function hello(g::G) where {G <: Thing; CombinedTrait{T1{G}, T2{G}}}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant