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

> Classic type classes can only contain functions not types...

> Now if Rust did not have such language features maybe it would have implemented iterators very differently. Current Rust iterators are similar to Java iterators, and in Java, iterators themselves have a type parameter, rather than having an associated type inside the iterator trait.

True, although I'm not sure how much difference it makes in a language with first-class modules. But more importantly, how much difference does it make at the point of use? As far as I can see the overwhelming majority of Rust iterator code looks pretty much the same as one would write in OCaml, or Java.



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

Search: