Skip to content

Associated types #45

Open
Open
@mauro3

Description

The AbstractArray interface also encompasses the meaning of the type parameters: MyArray{T,N} has eltype T and dim N. A trait LikeArray ought to contain these two type parameters also, which in this context are associated types (at least Rust uses this term). Maybe this could be written as TraitAbstractArray{TT,2}(SomeTypeWhichIsAlsoArrayLike{P1,P2,TT}), which would mean that SomeTypeWhichIsAlsoArrayLike{P1,P2,T} belongs to the trait and that it has associated types eltype==TT and ndims==2. Note this syntax is different to the current syntax on master, where the type-parameters are occupied by the types fulfilling (or not) the trait.

Not sure this is SimpleTraits material but I thought I better write it down somewhere before I forget.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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