Reason also provides two important parameterized types that allow their values to be mutated in place. This mutability brings efficiency gains for certain types of algorithms, but generally needs to be used carefully because, as we'll see, it may be a source of bugs.
Mutable parameterized types – ref and array
Managing a reference to a value
We've already seen an example of mutability, in the Mutable record fields section of Chapter 4, Grouping Values Together in Types. Sometimes, we need to manage just one or two mutable values, and we might not want to go through the ceremony of declaring a new record type with mutable fields. For these situations, we can take advantage of the built-in ref type. The ref...