I was reading this, http://www.scala-lang.org/node/105, and wondered when it was better to use Abstract Types e.g.
abstract class Buffer {
type T
val element: T
}
rather that generics, e.g.
abstract class Buffer[T] {
val element: T
}
...
I am trying to use the answer of a preceding question to implement a small graph library. The idea is to consider graphs as colections, where vertices wrap collection elements.
I would like to use abstract types to represent Vertex and Edge types (because of type safety) and I want to use type parameters to represent the type of the col...
In what situations should abstract types be preferred over type parameters?
...