Using Shapeless's Nat
type, how can I derive evidence that two natural numbers are not equal?
This is what I have so far, but it only proves that a given Nat
is not equal to 0. How can I prove that any two Nat
values are not equal?
trait NEq[A <: Nat, B <: Nat] extends Serializable
object NEq {
def apply[A <: Nat, B <: Nat](implicit neq: A != B): NEq[A, B] = neq
type !=[A <: Nat, B <: Nat] = NEq[A, B]
implicit def neq1[B <: Nat] = new !=[Succ[B], _0] {}
implicit def neq2[B <: Nat] = new !=[_0, Succ[B]] {}
}