This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Why not have Ordered[T] extend Comparable[T]

No replies
Blair Zajac
Joined: 2009-01-12,
User offline. Last seen 42 years 45 weeks ago.

I need to put some Scala objects into some Java collections and I had already
implemented Ordered[], but to add them into the Java collections, I needed to
just say "with Comparable[T]".

Given that Ordered implements compareTo by delegating to Ordered's compare(),
why not have Ordered extend Comparable?

Blair

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland