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

Scala's immutable types are also "shallow". For example you can put mutable objects inside an immutable container and change them when you want. Rust avoids this using lifetimes.

It would be interesting if mutability was actually part of Scala's type system, for example if immutable Seq was defined as

    class Seq[T <: Immutable]


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

Search: