This is really the update function of a lens. Anil has taken a part of a project that had contained a lens package into its own library, https://github.com/avsm/ocaml-lens . Although a ppx library with lenses would be most appropriate (since this is all still manual). -- Nicholas Lucaroni On Wed, Jan 28, 2015 at 12:03 PM, Christoph Höger < christoph.hoeger@tu-berlin.de> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dear all, > > I often find myself writing code like this > > {foo with bar = f foo.bar} > > and would like to avoid the redundancy of typing 'bar'. So it would be > very convenient to have an applied-to operator: > > {foo with bar <- f} > > This would only need one additional syntactic sort at the very first > stage, since the operator can immediately be de-sugared into the > already-existing with-form. > > What do you think? > > > - -- > Christoph Höger > > Technische Universität Berlin > Fakultät IV - Elektrotechnik und Informatik > Übersetzerbau und Programmiersprachen > > Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin > > Tel.: +49 (30) 314-24890 > E-Mail: christoph.hoeger@tu-berlin.de > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > > iEYEARECAAYFAlTJFm4ACgkQhMBO4cVSGS+4igCgu2ANaWyr5ZehpvW6XODpKlpJ > 1vwAmQHCibACt3skuOOOrmlptZ95xg3p > =gqBi > -----END PGP SIGNATURE----- > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >