Just for understanding variance in scala
Tasks:
- implement all needed case class and case object for proposed traits
and
trait ContrVOrdering[-T] { def compare(a: T, b: T): Int }
trait BiTree[+T] { def value: T def left: BiTree[T] def right: BiTree[T] def find(v: T): Option[T] def add[U/*Think about bound here*/](value: U)(implicit ord: ContrVOrdering[U]): BiTree[U] }
- write tests using
scalatest
- write tests using
scalacheck
NOTE: Feel free to extend / change any interface if needed.