Skip to content

Proposal: CombinedTrait #71

Open
Open
@matbesancon

Description

@matbesancon

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}}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions