3 ms·
OCaml has a nice solution: Functional Objects[1]. Instead of a member mutating something in an object, it just returns a copy of the object with the relevant ch
by sparkie 4y ago
OCaml has a nice solution: Functional Objects[1]. Instead of a member mutating something in an object, it just returns a copy of the object with the relevant changes.
[1]:https://v2.ocaml.org/manual/objectexamples.html#s%3Afunctional-objects https://v2.ocaml.org/manual/objectexamples.html#s%3Afunction...