On Sun, Aug 16, 2009 at 2:18 PM, David Copeland wrote:
> Other than using abstract types as an alias mechanism, when would you use
> them over generics?
>

Consider using an abstract type when most of the client code doesn't
care what the parameter is. In other words, if most of the sites look
like:
blah[T](foo: Foo[T])
leaving the variable unbound and immediately exposing it to the
caller, it might be simpler to make T an abstract type.

For one example, have a read of the paper referenced in the 'Scala API for remote monitoring and control' news item on thehttp://scala-lang.org front page.
2009/8/16 David Copeland <davec [at] naildrivin5 [dot] com>

Other than using abstract types as an alias mechanism, when would you use them over generics?

Basically, you have to use a type member (as opposed to parameter) where you want the type to be constrained by an inner class/trait.

2009/8/17 Rob Dickens <arctic [dot] bob [at] googlemail [dot] com>

For one example, have a read of the paper referenced in the 'Scala API for remote monitoring and control' news item on the
http://scala-lang.org front page.
2009/8/16 David Copeland <davec [at] naildrivin5 [dot] com>

Other than using abstract types as an alias mechanism, when would you use them over generics?

On Sun, Aug 16, 2009 at 2:18 PM, David Copeland<davec [at] naildrivin5 [dot] com> wrote:
> Other than using abstract types as an alias mechanism, when would you use
> them over generics?
>

Consider using an abstract type when most of the client code doesn't
care what the parameter is. In other words, if most of the sites look
like:
blah[T](foo: Foo[T])
leaving the variable unbound and immediately exposing it to the
caller, it might be simpler to make T an abstract type.