However, can you clarify why you would argue for type classes over duck/structural typing? You indicate that 'type classes are the way to go' but don't explain why.
Scala of course does have a form of Type Classes and while they tend to be what I reach for more often than Structural Types in Scala, it doesn't obviate Structural Types completely and I'd be interested in analysis of the diffs.
Like kscaldef said, you know at compiletime if something can quack, and the overhead for doing this is quite small.
Haskell: instance Quacker MySpecialDuck where quack = "qqquuuuuuaaaaaakkkkk"
"Scala of course does have a form of Type Classes and while they tend to be what I reach for more often than Structural Types in Scala, it doesn't obviate Structural Types completely and I'd be interested in analysis of the diffs."
In which cases do you need duck typing? Adding dynamically a method to a class?
I think that type classes are the way to go.
Duck typing is mostly popular because multiple inheritance sucks, and because inherting a class to only overload a method sucks.
Languages like Ruby, Python or Perl are so popular because they are less verbose than Java or C++, with the disadvantage, that the compiler can't help you that much.
Haskell is a language that combines the advantages, less verbosity with a helping compiler, and a static type system that rocks.