Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's nothing like duck typing -- type classes are a major thing in Haskell, which should tell you how far from duck typing it is ;) They're also present in Scala (as the OP mentioned), in Rust as Traits, and C++11 had a proposal for Concepts, which are quite similar as well.

The short but slightly inaccurate description is that type classes are a way to allow interfaces to be implemented separately from the way you define types.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: