AlgebraicJulia / AlgebraicJulia/TraitInterfaces.jl

Explicit type parameters for wrapper types

Offen
#6 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @kris-brown Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
4
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently we support declaring a wrapper type to be a subtype of some abstract type, e.g.

```julia
ThMonoid.Meta.@wrapper Monoid <: AbsAlgType
```

This creates smart constructor `struct Monoid <: AbsAlgType` which wraps implementations of `ThMonoid`.

We can also use a variant which produces a type `Monoid{T}` where `T` is the julia type of the underlying set

```julia
ThMonoid.Meta.@typed_wrapper Monoid <: AbsAlgType
```

The problem is that, if the abstract type itself has parameters, such as `AbstractAlgType{T}`, we *cannot* do:

```julia
ThMonoid.Meta.@typed_wrapper Monoid{T} <: AbsAlgType{T}
```

So the `@typed_wrapper` macro should be extended to allow this.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.