OCaml Mutable record fields

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


Like most OCaml values, records are immutable by default. However, since OCaml also handles imperative programming, it provides a way to make individual fields mutable. Mutable fields can be modified in-place by assignment, rather than having to resort to usual functional techniques, such as functional update.

While introducing side-effects, mutable fields can result in an improved performance when used correctly.

Got any OCaml Question?