3 ms·
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 thi
by xmcqdpt2 4y ago
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]