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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id BAD607F6CB for ; Thu, 29 Jan 2015 04:08:30 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BhAQDJo8lUnHDIaSZag1hZBIJ9shGPQQqFcQKBEQdDAQEBAQERAQEBAQEGFglChA0BAQQSER0BASwGBQEPCwsDCgICCR0CAiEBEgEFAQoSBhMSEId2AxEDCrNePjGKPnCEYgEFi2MDCoUvAQEBAQEBAQEBAQEBAQEBAQEBARMGCoEXjC2CKgeCLQwvEYEwhEoKhT6IMoQRgUaBFzaKQz2ELxIjgRWCIx2BblEBgkEBAQE X-IPAS-Result: A0BhAQDJo8lUnHDIaSZag1hZBIJ9shGPQQqFcQKBEQdDAQEBAQERAQEBAQEGFglChA0BAQQSER0BASwGBQEPCwsDCgICCR0CAiEBEgEFAQoSBhMSEId2AxEDCrNePjGKPnCEYgEFi2MDCoUvAQEBAQEBAQEBAQEBAQEBAQEBARMGCoEXjC2CKgeCLQwvEYEwhEoKhT6IMoQRgUaBFzaKQz2ELxIjgRWCIx2BblEBgkEBAQE X-IronPort-AV: E=Sophos;i="5.09,484,1418079600"; d="scan'208";a="98058490" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Jan 2015 04:08:29 +0100 Received: from tot-qpr-mailcore2.delacy.com ([172.27.56.106] helo=tot-qpr-mailcore2) by mxout1.mail.janestreet.com with smtp (Exim 4.82) (envelope-from ) id 1YGfT1-0002VQ-Sz for caml-list@inria.fr; Wed, 28 Jan 2015 22:08:27 -0500 X-JS-Flow: external Received: by tot-qpr-mailcore2 with JS-mailcore (0.1) (envelope-from ) id BUyaQr-AAACZQ-bt; 2015-01-28 22:08:27.887664-05:00 Received: from mail-lb0-f179.google.com ([209.85.217.179]) by mxgoog1.mail.janestreet.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.72) (envelope-from ) id 1YGfT1-0000Ys-Hv for caml-list@inria.fr; Wed, 28 Jan 2015 22:08:27 -0500 Received: by mail-lb0-f179.google.com with SMTP id 10so23625746lbg.10 for ; Wed, 28 Jan 2015 19:08:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=4vKqkiXeJjBlaJLCw8T0YgrEENDzifV5ISYykAZ151Y=; b=ijhjyO+i+4nmMIBYb4kotbgloFKkjArQwPSFvi3xJXbBFuC1urcFdbWC2hMxrcmdJp jioVJgNkEiOcG0OPs4t97ofx9Jd0P6xcv4lhRE2LJnTeWgmjX2PD8g5PAV6HoROmMfY3 xe5ryHOAHgJb3mOju5wenGCh/uyZVwdKzoB1A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=4vKqkiXeJjBlaJLCw8T0YgrEENDzifV5ISYykAZ151Y=; b=edkH8ujJumm9lfog+/v2ST2wyqRVsuV8LP9dq++nqcUjcdDP9h8sN7IAGoG1eXSE/0 LxyZI6FHeT6yNjiix++CuverIG8TgnuQ5k/3DuETrAb5TIPvBMONsff5rvreoVBAT9JP ifYnso+STO87RMhfMaoiyCoQL986WfPH8l2KqtYCqjcqxZRXwMVr7aNx49jMLuRWBbIT EANSTAuE6hS4wxE18rCc+coU8qQ84jjkawgOfPofapdFe8u0re8sdbLLH0jbRpBJk36g jPaCnCVS5TCvDg7K5KuQsWDIMQqdLC3zNSN0l/VeCzROg7Gc8OZKkda9NKPfDeaINIED lJLQ== X-Gm-Message-State: ALoCoQna54Ya8g9UUOTRXHhL8rMfvNSk04cmROzOpMFWWhIfjjPl24FBHlqI0I+T5ZQECa0sWDtqf7FS1xTKaWSF1yGU7isNY5v1gsRNwbmHdMzl2zLzGDzcde8k81LFbqSB7Dt5oljQ X-Received: by 10.112.132.2 with SMTP id oq2mr11897011lbb.11.1422500906366; Wed, 28 Jan 2015 19:08:26 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.132.2 with SMTP id oq2mr11897007lbb.11.1422500906270; Wed, 28 Jan 2015 19:08:26 -0800 (PST) Received: by 10.113.5.40 with HTTP; Wed, 28 Jan 2015 19:08:26 -0800 (PST) In-Reply-To: References: <54C9166E.6080609@tu-berlin.de> Date: Wed, 28 Jan 2015 22:08:26 -0500 Message-ID: From:Yaron Minsky To:Nick Lucaroni Cc:=?UTF-8?Q?Christoph_H=C3=B6ger?= , "caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-JS-Processed-by: mailcore Subject: Re: [Caml-list] record update-apply 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 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=C3=B6ger > 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 > >