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 D8F5882355 for ; Mon, 11 Dec 2017 06:51:34 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=vietlq85@gmail.com; spf=Pass smtp.mailfrom=vietlq85@gmail.com; spf=None smtp.helo=postmaster@mail-qt0-f175.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of vietlq85@gmail.com) identity=pra; client-ip=209.85.216.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="vietlq85@gmail.com"; x-sender="vietlq85@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of vietlq85@gmail.com designates 209.85.216.175 as permitted sender) identity=mailfrom; client-ip=209.85.216.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="vietlq85@gmail.com"; x-sender="vietlq85@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-qt0-f175.google.com) identity=helo; client-ip=209.85.216.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="vietlq85@gmail.com"; x-sender="postmaster@mail-qt0-f175.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3ACbM1YBMWgCZsMmH5xEsl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0K/T8rarrMEGX3/hxlliBBdydsK0UzbeO+4nbGkU+or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6aijSI4DUTAhTyMxZu?= =?us-ascii?q?bqSwQ9aKzpf/6+fnypTMah8ArT+8Z/smPRyppB+Xv8wXh6NtL68wzl3CpX4eKM?= =?us-ascii?q?pMwmY9G1Oeg17Y64/k4p9u7yBJ668J+MtJUKG8dKM9G+8LRA86Onw4sZW4/SLI?= =?us-ascii?q?ShGCsz5FCj0b?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AxBgCiHC5af6/YVdFbHAEBAQQBAQoBA?= =?us-ascii?q?YQkdBQThAKBNpdngX2IbYVQimQKI4UYAoRfRBMBAQEBAQEBAQEBEgEBCQsLCCY?= =?us-ascii?q?xgjgFAR4BBYJAAQEBAQIBIwQZARsdAQMBCwYDAgsNKgICIQEBEQEFARwGExQKi?= =?us-ascii?q?XEBAw0IEIkskRxAjBCBbRgFARyDCgWDVwoZJw1ZTYIAAQEBAQEBAQMBAQEBAQE?= =?us-ascii?q?BAQEXAgEFEoNWgguGaoJqgmKCaIJjBYEtAQGHKIILjmmJCTMIAQGBYQqFE3uIL?= =?us-ascii?q?IR8k2OIcIQaPYkDFCSBFzeBcG9PMlKBJYJDghJBN4gmgVkBAQE?= X-IPAS-Result: =?us-ascii?q?A0AxBgCiHC5af6/YVdFbHAEBAQQBAQoBAYQkdBQThAKBNpd?= =?us-ascii?q?ngX2IbYVQimQKI4UYAoRfRBMBAQEBAQEBAQEBEgEBCQsLCCYxgjgFAR4BBYJAA?= =?us-ascii?q?QEBAQIBIwQZARsdAQMBCwYDAgsNKgICIQEBEQEFARwGExQKiXEBAw0IEIkskRx?= =?us-ascii?q?AjBCBbRgFARyDCgWDVwoZJw1ZTYIAAQEBAQEBAQMBAQEBAQEBAQEXAgEFEoNWg?= =?us-ascii?q?guGaoJqgmKCaIJjBYEtAQGHKIILjmmJCTMIAQGBYQqFE3uILIR8k2OIcIQaPYk?= =?us-ascii?q?DFCSBFzeBcG9PMlKBJYJDghJBN4gmgVkBAQE?= X-IronPort-AV: E=Sophos;i="5.45,391,1508796000"; d="scan'208,217";a="304842516" Received: from mail-qt0-f175.google.com ([209.85.216.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 11 Dec 2017 06:51:09 +0100 Received: by mail-qt0-f175.google.com with SMTP id i40so35767942qti.8 for ; Sun, 10 Dec 2017 21:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gtx9PmFDWJkuFgLpCzwCOujgBP/1U05xEVT53I1QSmo=; b=Yoyb44VTMPHoI6QwPu8LIbvbmEwCNUUjkEBkKv5VgoXGPpwSwvQ5qddzcEe7k2vkEJ p5sITtcjiJdqVpHaL6aaEBBSeA/NyWjU5lkVYC7hiBHv6NCiteb3mRwCp+okNIBmYKs/ BCqrT2XouQQOpSLZEyALVNYiN4njtNz0AkpVaGp7XP36rruMZXKv99wJy9J8P3gqHxWS 04i10LaoaDKQkODazoBVbwtESgcCoAQipOJhNpfyJN7MZAefnJHj+w3q0KQ5YqCArMuQ rGiiHMw71b+m04n7YoQlMDxgO2GsI1KDh8528L5ILYC39MVoRc3N9Kc3rgOiY8TXBRMy ddIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gtx9PmFDWJkuFgLpCzwCOujgBP/1U05xEVT53I1QSmo=; b=ky6RTjZYNk93QijElmo8cgguR6SsNSuRmMuNi6kXDMEJ20herka/R9kl5dn6rh4anv hr2tZowhRenPWcO3HaVcm/WzM8K9cY0YxfQOKVMxvoXhTJwD9V6K6CXvzQTL1s6YysQj l1pFt1OjWZmrcN87R2zRwh7Q6AFsMLtjj/FQYPfka6DnOJ5h14u2baryvBU9/ab+O6vz RKh3SHE4YIOBtUEzlHFxgmFHcno66j5FVTRkV09s7RcazgkyCvtOHc0zY5DZHxxyWt9+ wybRzcebY1xEP6+6aHpfxD5LvQfBT0jI7ktlqv0QZD0fme0CPDafI5LX0SvdGkP0j5oi Zhiw== X-Gm-Message-State: AKGB3mLlT7RiVXzN4OqA8tGQqQkFqiZUy4wHfsOfpY05o5px6Q31+BF+ HUMxU5Jv5ivfvbUBH08AINkhOcVnqwekfSqTXx624Q== X-Google-Smtp-Source: AGs4zMY+VJ+2sMbHvYPn9Ytz/5O4BJBMzwksErcydIUj+reB/J4QGWTWqg6EuD0HhJ1e7pbclADMdCR9/spiFyw+TxM= X-Received: by 10.55.158.132 with SMTP id h126mr49611168qke.245.1512971468117; Sun, 10 Dec 2017 21:51:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Viet Le Date: Mon, 11 Dec 2017 05:50:57 +0000 Message-ID: To: Yawar Amin Cc: Ocaml Mailing List , Robert Muller Content-Type: multipart/alternative; boundary="94eb2c074f4ee99c5805600a1e43" Subject: Re: [Caml-list] ReasonML concrete syntax --94eb2c074f4ee99c5805600a1e43 Content-Type: text/plain; charset="UTF-8" Such a terrible way to cave in to appear more JS-esque. I really hope OCaml community doesn't adopt this style because it's confusing, inelegant and superficial. Viet. On Mon, 11 Dec 2017 at 00:11, Yawar Amin wrote: > 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 >> >> >> > -- Kind regards, Viet --94eb2c074f4ee99c5805600a1e43 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Such a terrible way to cave in to appear more JS-esque. I= really hope OCaml community doesn't adopt this style because it's = confusing, inelegant and superficial.

Viet.

On Mon, 1= 1 Dec 2017 at 00:11, Yawar Amin <yawar.amin@gmail.com> wrote:
https://github.com/facebook/reason/= pull/1299

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

Note that the ReasonML=C2=A0proje= ct actually includes several long-time members of the OCaml community. I fe= el that the new syntax has very well received in the JavaScript community a= nd 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:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
The team developing ReasonML seems to be= experimenting with concrete syntax in an effort to make it feel as familia= r and natural as possible to JavaScript programmers. Seems like a good idea= . But the present version seems to hardwire parentheses awkwardly for funct= ion definitions and calls. Parentheses are required for both function defin= itions and calls. So one writes

let 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 the parenthesized = items (both parameters & arguments) to leave curried functions. E.g.,

let add(m, n) =3D m + n=C2=A0 or equivalently let a= dd =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 patt= ern matching a pair, it's the JS-style sequence of input 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 way to write an a= dd function of type int * int -> int, but I don't know how to write = it.

I'm wondering what the OCaml communi= ty makes of this. I find it awkward.
Bob Muller



--
Kind re= gards,
Viet
--94eb2c074f4ee99c5805600a1e43--