caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yaron Minsky <yminsky@janestreet.com>
To: Nick Lucaroni <nicholas.r.lucaroni@gmail.com>
Cc: "Christoph Höger" <christoph.hoeger@tu-berlin.de>,
	"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] record update-apply
Date: Wed, 28 Jan 2015 22:08:26 -0500	[thread overview]
Message-ID: <CACLX4jSNgO4b23O8jDid8_Ng+eVKYbNyy7K9sF=kptk=1O=Kjw@mail.gmail.com> (raw)
In-Reply-To: <CAADdkeLUo5ePBayZ38jFhBH0axbZ5RrB82+w_WkF3Nm6xAo-7w@mail.gmail.com>

Fieldslib uses camlp4, but basically gets the job done.  A Field.t is
more or less a lens (you can write a simple function that constructs a
lens from a Field.t), so that gives you the basic bits you need.
We're going to do a ppx rewrite soon.

y

On Wed, Jan 28, 2015 at 4:51 PM, Nick Lucaroni
<nicholas.r.lucaroni@gmail.com> wrote:
> 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
>
>

      reply	other threads:[~2015-01-29  3:08 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
2015-01-29  3:08   ` Yaron Minsky [this message]

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='CACLX4jSNgO4b23O8jDid8_Ng+eVKYbNyy7K9sF=kptk=1O=Kjw@mail.gmail.com' \
    --to=yminsky@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=christoph.hoeger@tu-berlin.de \
    --cc=nicholas.r.lucaroni@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).