3 ms·
> What makes dealing with the borrow check hard is that it triggers on code that intuitively is correct, it can be hard to envision why it's not. Because it's
by pcwalton 11y ago
> What makes dealing with the borrow check hard is that it triggers on code that intuitively is correct, it can be hard to envision why it's not.
Because it's more expressive than just forbidding mutability. You could program in Rust the same way you program in Haskell, by encapsulating mutability in functions with different types (&mut). Then the flow sensitivity and other issues would never bother you.
Rust's flow-based control of mutability is strictly more expressive than the monad system of Haskell. If you don't like that expressivity, don't use it.