From: Nick Lucaroni <nicholas.r.lucaroni@gmail.com>
To: "Christoph Höger" <christoph.hoeger@tu-berlin.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] record update-apply
Date: Wed, 28 Jan 2015 16:51:59 -0500 [thread overview]
Message-ID: <CAADdkeLUo5ePBayZ38jFhBH0axbZ5RrB82+w_WkF3Nm6xAo-7w@mail.gmail.com> (raw)
In-Reply-To: <54C9166E.6080609@tu-berlin.de>
[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]
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
>
[-- Attachment #2: Type: text/html, Size: 2543 bytes --]
next prev parent reply other threads:[~2015-01-28 21:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 17:03 Christoph Höger
2015-01-28 21:51 ` Nick Lucaroni [this message]
2015-01-29 3:08 ` Yaron Minsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAADdkeLUo5ePBayZ38jFhBH0axbZ5RrB82+w_WkF3Nm6xAo-7w@mail.gmail.com \
--to=nicholas.r.lucaroni@gmail.com \
--cc=caml-list@inria.fr \
--cc=christoph.hoeger@tu-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox