4 ms·
Mutability and immutability aren't really on a continuum. They represent different semantics. Haskell embeds mutability semantics within immutability semantics
by cia_plant 17y ago
Mutability and immutability aren't really on a continuum. They represent different semantics. Haskell embeds mutability semantics within immutability semantics by using monads. So mutability is "100% available" in Haskell, you just have to tag it as mutability.
- jrockway 17y agoSort of true; monads like Reader/Writer/State can make pure computations appear impure. Making impure computations appear pure is another issue, to which monads are orthogonal. (It boils down to making sure the program can only ever see the "current" state; then it doesn't matter whether something is actually mutable. I don't have a good bite-sized explanation, but I will try to find some relevant papers for you.)