These exist in stdlib, but… import compiletime.S type +[A <: Int, B <: Int] <: Int = A match case 0 => B case S[a] => a + S[B] type *[A <: Int, B <: Int] = Mult[A, B, 0] type Mult[A, B, C] <: Int = A match case 0 => C case S[a] => Mult[a, B, B + C] val x: 10 * 11 = 110
I probably don't know everything Refined can do, but a lot of its functionality becomes easier and more natural to implement in Scala 3. But I think there's still room for a library like Refined that would make these capabilities more accessible. /cc @fst9000