Trying to make a scala.collection.immutable.NumericRange[UInt]
Looks like it needs a scala.math.Integral[UInt]
.
But there does not seem to be a spire.math.Integral[UInt]
.
I am assuming thats because UInt
violates the laws around Integral
in some way.
I am mostly interested in NumericRange[UInt].contains(x: UInt)
Is it folly for me to attempt to construct a scala.math.Integral[UInt]
on my own?
Or should I find some other way to get contains
?
Is there a trait that should exist that should be inherited by Set[T]
and Range
and NumericRange[T]
that declares contains[T]
What should that trait be called?
Should I do this as a type class?
What should I call this type class?