Indeed classes are great for these kinds of encodings. It is one of the use cases for which classes are the nicest approach in OCaml.
For example, see this section of Real World OCaml:
https://realworldocaml.org/v1/en/html/classes.html#open-recu...
For example, see this section of Real World OCaml:
https://realworldocaml.org/v1/en/html/classes.html#open-recu...
No comments yet.