Inheritance is bad you say? I bet your "Haskell" can't do this!
sealed trait Integer
sealed trait Nat extends Integer
case object Zero extends Nat
case class Succ(pred: Nat) extends Nat
case class Negate(nonzero: Succ) extends Integer
Conversation
Is this inheritance or just subtyping though? I sometimes get confused at the difference.
2
1
I guess it's inheritance because you are pulling the constructors from the supertype, right?

