I am using types to denote dimension. The following code works fine in Scala 3:
type Dim[T<:Tuple]
trait LoadedData[S<: Tuple, T <: Dim[S]]
case object MNIST extends LoadedData[(28,28), Dim[(28,28)]]
But the above is clunky. I want to get rid of the explicit `S’. So I tried removing it. However these don’t work:
trait LoadedData[T <: Dim[_ <: Tuple]]
trait LoadedData[T <: Dim[_]]
case object MNIST extends LoadedData[Dim[(28,28)]]
Obviously I could use a generic invariant type in LoadedData
. But is there any way to ensure the <: Dim
generic type?
TIA.