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 D05A582355 for ; Mon, 11 Dec 2017 01:09:49 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=yawar.amin@gmail.com; spf=Pass smtp.mailfrom=yawar.amin@gmail.com; spf=None smtp.helo=postmaster@mail-it0-f49.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yawar.amin@gmail.com) identity=pra; client-ip=209.85.214.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yawar.amin@gmail.com"; x-sender="yawar.amin@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yawar.amin@gmail.com designates 209.85.214.49 as permitted sender) identity=mailfrom; client-ip=209.85.214.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yawar.amin@gmail.com"; x-sender="yawar.amin@gmail.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@mail-it0-f49.google.com) identity=helo; client-ip=209.85.214.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yawar.amin@gmail.com"; x-sender="postmaster@mail-it0-f49.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AokWoSRc/snYURYPi9Qr9n+07lGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc2zbR7h7PlgxGXEQZ/co6odzbGJ4+a9ASQp2tWojjMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpRZbIBj0NBJ0?= =?us-ascii?q?K+LpAcaSyp3vj6Hhs6HUNj9PjjenfftXMRGyoB+Z4tMRi4Z4NuA01x/Nr2ESU+?= =?us-ascii?q?tTzGJsY1mUmkCvyN23+ctS+jtZoboI8s9GGfHrdrsxV/pRCTUgG28w7czv8xLE?= =?us-ascii?q?SF3ctTMnTmwKn08QUED+5xbgU8K063Oiuw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CpAwBnzC1ahjHWVdFbHAEBAQQBAQoBA?= =?us-ascii?q?YNlAT50FBMHg3uBNlCXF4F9kUGHYAojgzqBXgKEWAdDFAEBAQEBAQEBAQESAQE?= =?us-ascii?q?BCAsLCCgvgjgFAR4BBYJBAQICASMEGQEbHQEDAQsGAwIEBzcCAiEBAREBBQEcB?= =?us-ascii?q?hMUColxAQMNCBCJIJEcQIwQgW0YBQEcgwoFg1cKGScNWYJNAQEBAQEBAQEBAQE?= =?us-ascii?q?BAQEBAQEBARcCAQUSg1aCC4FWhRSCaoJigmiCYwWIV4ILiEGPMT2COYRFe4gsh?= =?us-ascii?q?HyTY40KPYkDFAUfgRc2gXEyGiNPMoF3gkMfghEjN4gMgVkBAQE?= X-IPAS-Result: =?us-ascii?q?A0CpAwBnzC1ahjHWVdFbHAEBAQQBAQoBAYNlAT50FBMHg3u?= =?us-ascii?q?BNlCXF4F9kUGHYAojgzqBXgKEWAdDFAEBAQEBAQEBAQESAQEBCAsLCCgvgjgFA?= =?us-ascii?q?R4BBYJBAQICASMEGQEbHQEDAQsGAwIEBzcCAiEBAREBBQEcBhMUColxAQMNCBC?= =?us-ascii?q?JIJEcQIwQgW0YBQEcgwoFg1cKGScNWYJNAQEBAQEBAQEBAQEBAQEBAQEBARcCA?= =?us-ascii?q?QUSg1aCC4FWhRSCaoJigmiCYwWIV4ILiEGPMT2COYRFe4gshHyTY40KPYkDFAU?= =?us-ascii?q?fgRc2gXEyGiNPMoF3gkMfghEjN4gMgVkBAQE?= X-IronPort-AV: E=Sophos;i="5.45,391,1508796000"; d="scan'208,217";a="247857975" Received: from mail-it0-f49.google.com ([209.85.214.49]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 11 Dec 2017 01:09:48 +0100 Received: by mail-it0-f49.google.com with SMTP id o130so10460172itg.0 for ; Sun, 10 Dec 2017 16:09:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GMidGhRHiHxBFr/l3tWE1Z3ReY6ZNBojsjo9WJx7xxY=; b=RrcntYQg2r0JZs07NPdoUOqJClLVSZyV7jH4v6TOZldhFgEEjf4r+XOHbl9YtXmboO Okku4dY2WFEgdAkLzSyoxRhZ2nGednHjVOezHFMOk5Hpv4WqWSaT53baMZRgWZFMQaZ9 wVI2g3O5EawxU95FQ19O+al8HjIZejRMhb9pzWGyAsTzu00oLF+rJlrBWvgE5Kh2B6Sj zzhMcv9hlGzo5eGMsrm5OhXh5w2Kt24vAPYX8qyCHuq4mI/JZS4vG4tsN7nAhGzt/YOy JWlgXIy5kcSPaPleZFwdT4/kaNkln+e+yolDf3kMRmsIvwNqEcLu0qg7lb1bMbY8sH8Q Qf0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GMidGhRHiHxBFr/l3tWE1Z3ReY6ZNBojsjo9WJx7xxY=; b=jqbbuGZ/wBy2J2XlPtwumJlstD8EIyYn0zl5NTJHhK/HzmRNmf/TlyCYDupZotV/Dq QbbPhY8TyIesnBgiLJFUaoBTKw7Xq2GGD/8FP4qjvQTwIfYiruzPGmE2z7ZsnXjvVUEK 1PiaCawiKGY6LbLy+tb1RQFmoUlnqIJCBh1UAoDArpoXZfaJJXr4eKAvbLK9LFSXHDI3 MiA3iTDuLticYUUQQBdgdp/oNAZ0EoTyhwOQgF8cXChW2ddhf6yM6M1QfBvo5litJV3M kmQDTgDLO2UDBMOWTs91Bzr28MH6v4AVDuL+239Ugn1qro6Nc+Z3nGsBBA7A7eAo+N68 Qc1w== X-Gm-Message-State: AKGB3mLhupHt7Q8uEGDYyDG+5MSPSV9dKN8xjkxbKEitA9YZY+NThsZY 3yc17U3ZU6t1gWutNZh+rhsEmJiFLiDqqITChg== X-Google-Smtp-Source: AGs4zMbESzPX4JoxL4aPwZvDPq5xITTGsOXDGJvXFlU8qvIgEnSUuhZ9E/dKT4obs13iRy+f7f8rogVHzzHioWp/CbA= X-Received: by 10.107.97.16 with SMTP id v16mr11652458iob.263.1512950986795; Sun, 10 Dec 2017 16:09:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.181.19 with HTTP; Sun, 10 Dec 2017 16:09:26 -0800 (PST) In-Reply-To: References: From: Yawar Amin Date: Sun, 10 Dec 2017 19:09:26 -0500 Message-ID: To: Robert Muller Cc: Ocaml Mailing List Content-Type: multipart/alternative; boundary="089e0825a6582173420560055af6" Subject: Re: [Caml-list] ReasonML concrete syntax --089e0825a6582173420560055af6 Content-Type: text/plain; charset="UTF-8" Hi Bob, you can find more details about the syntax change and discussion in this slightly outdated PR: https://github.com/facebook/reason/pull/1299 Long story short, you can write let add((m, n)) = m + n. Note that the ReasonML project actually includes several long-time members of the OCaml community. I feel that the new syntax has very well received in the JavaScript community and it will lead to wider OCaml adoption. It's a win-win situation. Regards, Yawar On Sun, Dec 10, 2017 at 1:12 PM, Robert Muller wrote: > The team developing ReasonML seems to be experimenting with concrete > syntax in an effort to make it feel as familiar and natural as possible to > JavaScript programmers. Seems like a good idea. But the present version > seems to hardwire parentheses awkwardly for function definitions and calls. > Parentheses are required for both function definitions and calls. So one > writes > > let incr(n) = n + 1 and incr(5) > > but not > > let incr n = n + 1 or incr 5 > > Fair enough, but for multi-argument functions the parser seems to unroll > the parenthesized items (both parameters & arguments) to leave curried > functions. E.g., > > let add(m, n) = m + n or equivalently let add = (m, n) => m + n > > then add(5, 3) is 8 as one would expect. But the (m, n) in let add(m, n) = > ... isn't a pattern matching a pair, it's the JS-style sequence of input > parameters and the definition unrolls to let add = (m) => (n) => ... . So > add(5) : int -> int and all three of add(5, 3), add(5)(3) and { let add5 = > add(5); add5(3) } are 8. There's probably a way to write an add function > of type int * int -> int, but I don't know how to write it. > > I'm wondering what the OCaml community makes of this. I find it awkward. > Bob Muller > > > --089e0825a6582173420560055af6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Bob, you can find more details about the syntax change = and discussion in this slightly outdated PR:=C2=A0https://github.com/facebook/reason/pull/129= 9

Long story short, you can write let add((m, n)) = =3D m + n.

Note that the ReasonML=C2=A0project act= ually includes several long-time members of the OCaml community. I feel tha= t the new syntax has very well received in the JavaScript community and it = will lead to wider OCaml adoption. It's a win-win situation.
=
Regards,

Yawar

On Sun, Dec 10, 2017 at 1:= 12 PM, Robert Muller <robert.muller2@gmail.com> wrote= :
The team developing Re= asonML seems to be experimenting with concrete syntax in an effort to make = it feel as familiar and natural as possible to JavaScript programmers. Seem= s like a good idea. But the present version seems to hardwire parentheses a= wkwardly for function definitions and calls. Parentheses are required for b= oth function definitions and calls. So one writes

l= et incr(n) =3D n + 1=C2=A0 =C2=A0 =C2=A0 =C2=A0and=C2=A0 =C2=A0incr(5)

but not

let incr n =3D n + 1= =C2=A0 =C2=A0 =C2=A0 =C2=A0 or=C2=A0 =C2=A0 incr 5

Fair enough, but for multi-argument functions the parser seems to unroll t= he parenthesized items (both parameters & arguments) to leave curried f= unctions. E.g.,

let add(m, n) =3D m + n=C2=A0 or e= quivalently let add =3D (m, n) =3D> m + n

then = add(5, 3) is 8 as one would expect. But the (m, n) in let add(m, n) =3D ...= isn't a pattern matching a pair, it's the JS-style sequence of inp= ut parameters and the definition unrolls to let add =3D (m) =3D> (n) =3D= > ... . So add(5) : int -> int and all three of add(5, 3), add(5)(3) = and { let add5 =3D add(5);=C2=A0 add5(3) } are 8. There's probably a wa= y to write an add function of type int * int -> int, but I don't kno= w how to write it.

I'm wondering what th= e OCaml community makes of this. I find it awkward.
Bob Muller



--089e0825a6582173420560055af6--