First, I acknowledge the possibility that this question could be a duplicate; just let me know.
I\'m curious what the general \"best practice\" is for those situatio
You may want to take a look at the Mutable Data section in the wikibook.
For convenience, here are some relevant quotes:
The mutable keyword is frequently used with record types to create mutable records
Mutable variables are somewhat limited: mutables are inaccessible outside of the scope of the function where they are defined. Specifically, this means its not possible to reference a mutable in a subfunction of another function.
Ref cells get around some of the limitations of mutables. In fact, ref cells are very simple data type which wrap up a mutable field in a record type.
Since ref cells are allocated on the heap, they can be shared across multiple functions