From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id AE2997F6CB for ; Wed, 28 Jan 2015 22:52:41 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of trigger0219@gmail.com) identity=pra; client-ip=209.85.192.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="trigger0219@gmail.com"; x-sender="trigger0219@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of trigger0219@gmail.com designates 209.85.192.47 as permitted sender) identity=mailfrom; client-ip=209.85.192.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="trigger0219@gmail.com"; x-sender="trigger0219@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qg0-f47.google.com) identity=helo; client-ip=209.85.192.47; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="trigger0219@gmail.com"; x-sender="postmaster@mail-qg0-f47.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D7AQCUWclUmy/AVdFag1hZBIJ9sg+NYoFphXGBGgdDAQEBAQERAQEBAQEGCwsJFC6EDQEBBBIRHQEbEgYFAQMMAQUFBAcaHQICIgERAQUBChIGExIQh3UBAxENtAM+MYsugWuCd4sQChknAwpUhFsBAQgCARkBBQ6PZoJzgUEFhEUKhT6IMoVXgRc2ikOEbBIjgQwJW4FIHYFuIDGCQgEBAQ X-IPAS-Result: A0D7AQCUWclUmy/AVdFag1hZBIJ9sg+NYoFphXGBGgdDAQEBAQERAQEBAQEGCwsJFC6EDQEBBBIRHQEbEgYFAQMMAQUFBAcaHQICIgERAQUBChIGExIQh3UBAxENtAM+MYsugWuCd4sQChknAwpUhFsBAQgCARkBBQ6PZoJzgUEFhEUKhT6IMoVXgRc2ikOEbBIjgQwJW4FIHYFuIDGCQgEBAQ X-IronPort-AV: E=Sophos;i="5.09,482,1418079600"; d="scan'208";a="119084718" Received: from mail-qg0-f47.google.com ([209.85.192.47]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 28 Jan 2015 22:52:40 +0100 Received: by mail-qg0-f47.google.com with SMTP id z60so20100959qgd.6 for ; Wed, 28 Jan 2015 13:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=qUvvia7nXgjG+9rw+A/oEkufLlO15pk6C0BuaSXyypg=; b=o5QdlqrS6tyfCP12V8k6wHfPqc/hjkejc5w+VYtEJolVe4oZgbZ+7Hj1Orc5qs2Xu6 4jSXppEH+4FKsHhu7b8Ao0yoFJ8w/5UYbWPvEXFNQ9v2IxJssSpIymL6tVrNut6zDGIg BBj0ud5eooc0Ssw/+zvjMIDrgiNSDU6uVB3VpDnbS7sOICPfm+POs7TEQaBBkZGkyYJI wK6gWSoKh7fSXMqzlmsjgJkmZ/7H12OY7cEuvF7uOr2ojs9NQHMbMyzyV/KaZst5cbx1 IfjQSlAbeYZ9uC/hVYrQ3re4p3WpPjJySj5FlmqEmMErJs6X0x11gXc6h+NNdgGUH8GE HGQw== X-Received: by 10.224.166.8 with SMTP id k8mr684247qay.82.1422481959519; Wed, 28 Jan 2015 13:52:39 -0800 (PST) MIME-Version: 1.0 Sender: trigger0219@gmail.com Received: by 10.229.82.138 with HTTP; Wed, 28 Jan 2015 13:51:59 -0800 (PST) In-Reply-To: <54C9166E.6080609@tu-berlin.de> References: <54C9166E.6080609@tu-berlin.de> From: Nick Lucaroni Date: Wed, 28 Jan 2015 16:51:59 -0500 X-Google-Sender-Auth: TVvQ0_Q2mE8r-kl-O-fk7bCEQ0Y Message-ID: To: =?UTF-8?Q?Christoph_H=C3=B6ger?= Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=001a11c22eeee58da9050dbd6347 Subject: Re: [Caml-list] record update-apply --001a11c22eeee58da9050dbd6347 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=C3=B6ger < 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 =3D 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=C3=B6ger > > Technische Universit=C3=A4t Berlin > Fakult=C3=A4t IV - Elektrotechnik und Informatik > =C3=9Cbersetzerbau 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 > =3DgqBi > -----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 > --001a11c22eeee58da9050dbd6347 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This is really the update function of a lens. Anil has tak= en a part of a project that had contained a lens package into its own libra= ry, https://github.com/avsm/= ocaml-lens . Although a ppx library with lenses would be most appropria= te (since this is all still manual).



<= /div>
--
Nicholas Lucaroni

=
On Wed, Jan 28, 2015 at 12:03 PM, Christoph H=C3= =B6ger <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 =3D 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=C3=B6ger

Technische Universit=C3=A4t Berlin
Fakult=C3=A4t IV - Elektrotechnik und Informatik
=C3=9Cbersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: +49 (30) 314-24890
E-Mail: christoph.hoeger@t= u-berlin.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlTJFm4ACgkQhMBO4cVSGS+4igCgu2ANaWyr5ZehpvW6XODpKlpJ
1vwAmQHCibACt3skuOOOrmlptZ95xg3p
=3DgqBi
-----END PGP SIGNATURE-----

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://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

--001a11c22eeee58da9050dbd6347--