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

Haskell doesn't stop you from mutation, it just makes you explicitly mark it, like types of inputs/output are explicit in statically typed languages instead of being implicit or borrowing is explicit in Rust.

Mutations becomes first class values like numbers or arays, and hence can be primitives for more complex mutations, whose types can be inferred from the types of primitive mutations.

This means that the we have compile time guarantees that certain piece of code wont change anything in certain part of the state - This function wont change anything in that part of the data.

It is no joke, though not strictly true, that Haskell has been called the world's best imperative language.



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

Search: