Why is mutability something you want?
The only practical use I have is in-place mutation of data structures. So e.g. in
Array.set 10000 2 myArray
that would modify the underlying array directly, instead of first copying it and then modifying the copy. That would be much faster, but without some way of proving that myArray
is not shared (i.e. other live references to it exist) mutably updating is very unsafe. But I don’t think that’s what you’re thinking about.
Rather it seems like you want mutable references. Now that looks a lot like elm 0.15’s Mailbox
es or haskell’s IORef
. Looking into those may help you learn what you want to know.