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

I don't know Scala but the very basics of the language, however notation seems clear.

Class HashMap is parametrized over two types, A and B (presumably, key and value types). The rest seems to be implementation details, that play no importance unless you're going to actually use them. Just as integers are totally ordered, but unless you have use to that fact (i.e. comparing those integers), you can safely ignore that.

Same as with interfaces - if there's a interface Foo { ... } somewhere, you don't have to care your types implement it unless you're actually using it.



One problem with that idiomatic Scala code is that all inherited traits have to be declared in the same place, making the definition conceptually "too loaded". (Scala's implicits allow for something more flexible, akin to Haskell's type classes, though.)




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

Search: