AlgebraicJulia / AlgebraicJulia/TraitInterfaces.jl

Explicit type parameters for wrapper types

Open
#6 0 comments 0 reactions 1 assignee Claimed by @kris-brown View on GitHub
Dominant language
Julia
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.