Lenses
Lenses are a modular, functional method to update and read immutable record fields. They were developed originally by the Haskell community but have now been ported to other languages, including OCaml. If you’re writing a functional application with deeply-nested immutable records, Lenses are very helpful.
- Lens: A lens implementation in OCaml. Includes a PPX rewriter for boilerplate lens accessors.
- Accessor:
Jane Street’s version of Lenses.
Compiles against either
Base,CoreorAsync. Also includes a PPX rewriter, as well as a TON of features. - Optics: Experimental library supporting both Lenses and their cousins, Prisms for variants.