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 BED287EEFA for ; Mon, 9 Nov 2015 23:57:33 +0100 (CET) IronPort-PHdr: 9a23:wFNckRYx8deU4zFae8N7mSH/LSx+4OfEezUN459isYplN5qZpcu9bnLW6fgltlLVR4KTs6sC0LqL9fy8EjRdqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh730p8GYO1gArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIZoGJ/3dKUgTLFeEC9ucyVsvJWq5lH/Sl6m4HcGX2wN2iBPGBPP4Qv1FsPrtTDhvOdn1wGfJcyzVq8vHzO44PE4ZgXvjXIlOiQ09XCfu8V0iKVD6Eawrhh7xJb8b4ScNf44daTYK4BJDVFdV9pcAnQSSri3aJECWq9YZb5V Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=yallop@gmail.com; spf=Pass smtp.mailfrom=yallop@gmail.com; spf=None smtp.helo=postmaster@mail-lb0-f169.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yallop@gmail.com) identity=pra; client-ip=209.85.217.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yallop@gmail.com designates 209.85.217.169 as permitted sender) identity=mailfrom; client-ip=209.85.217.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@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-lb0-f169.google.com) identity=helo; client-ip=209.85.217.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="postmaster@mail-lb0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0C9AACfI0FWm6nZVdFehH0GwCqGEAKBOAc8EAEBAQEBAQEBEAEBAQEBBgsLCSEuQREBgVuCCAEBBBIRBBkBGx0BAwwGBQsNAgImAgIhAQERAQUBHAYTGQmHdgEDEqMpgTE+MYtIgWqCeYZkChknDVaDcwEBAQEGAQEBARkBBQ5zilGCU4UigUQFlkiLMoF1lHKGBhIkgRc4gi8jgV0+NIJ+gmgBAQE X-IPAS-Result: A0C9AACfI0FWm6nZVdFehH0GwCqGEAKBOAc8EAEBAQEBAQEBEAEBAQEBBgsLCSEuQREBgVuCCAEBBBIRBBkBGx0BAwwGBQsNAgImAgIhAQERAQUBHAYTGQmHdgEDEqMpgTE+MYtIgWqCeYZkChknDVaDcwEBAQEGAQEBARkBBQ5zilGCU4UigUQFlkiLMoF1lHKGBhIkgRc4gi8jgV0+NIJ+gmgBAQE X-IronPort-AV: E=Sophos;i="5.20,267,1444687200"; d="scan'208";a="186831077" Received: from mail-lb0-f169.google.com ([209.85.217.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 09 Nov 2015 23:57:33 +0100 Received: by lbblt2 with SMTP id lt2so90922276lbb.3 for ; Mon, 09 Nov 2015 14:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VIM2TK/Dc6JfGCqnWJK+JRDaeA4lRyYi6QAKa0CWP0E=; b=SvOoiRehIvubkliO5pDVVbSKfC3EKXraAr9TYUtsGpM4GlvmwP7YzfbxZqM+eVk3NZ pOncgbVbNxJzoLcCwbk4HeRDLTlDQZh2tQ0PTffD1jOBCRdNrWUrzWyFCEjVNyKlhNwB GySiceaoOqD+Qhq841dgnWsgnA0h/VPS5uhLFLvQ76R6dXGSWlDTvLYk0aBUR+HB5xCN D5zQSarWEYzeEXBqk6ZBjNMTqs46iH7EZTlL7xIT8cviyx77nVfpDr2FcbR2/mS+RHBq O9ounvNlgxDtGWmUkwRjlxMcTzU2EjOKabhOspLwilolbFClidUTQ+gCv0qgw2lXQ3bY i6CA== MIME-Version: 1.0 X-Received: by 10.112.35.196 with SMTP id k4mr185296lbj.3.1447109852342; Mon, 09 Nov 2015 14:57:32 -0800 (PST) Received: by 10.25.39.145 with HTTP; Mon, 9 Nov 2015 14:57:31 -0800 (PST) In-Reply-To: <95AE93FB-4D5A-43E2-B72F-40C348403AA6@mpi-sws.org> References: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E070@IRSMSX102.ger.corp.intel.com> <87pozk6vjp.fsf@mid.deneb.enyo.de> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E747@IRSMSX102.ger.corp.intel.com> <56407297.2060309@frisch.fr> <564076EA.7020805@mpi-sws.org> <5640D8E0.6060102@lexifi.com> <5640E2EF.7070400@mpi-sws.org> <95AE93FB-4D5A-43E2-B72F-40C348403AA6@mpi-sws.org> Date: Mon, 9 Nov 2015 22:57:31 +0000 Message-ID: From: Jeremy Yallop To: Andreas Rossberg Cc: Gabriel Scherer , Alain Frisch , caml users Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Newbie comment on constructor syntax On 9 November 2015 at 22:27, Andreas Rossberg wrote: >> On Nov 9, 2015, at 22:11 , Gabriel Scherer wrote: >> I like the revised syntax choice of writing >> type t = A of int and int list >> instead of >> type t = A of int * int list >> which removes the beginner surprise without introducing other >> unpalatable design side-effects. (It is still awkward for GADTs, but >> such is life.) > > I am not fond of the revised syntax, because it does not explain why the term-level syntax for constructor application uses tuple notation. In fact, the revised syntax doesn't use tuple notation for constructor application! The revised type definition syntax also has a few additional differences, such as prefix type constructor application, besides the one Gabriel mentioned. Here's an example, showing how to define a data type with a multi-argument constructor and to construct and match against values, with curried notation: # type t = [ A of int and list int ]; type t = [ A of int and list int ] # value x = A 3 []; value x : t = A 3 [] # fun [ A x y -> (x, y) ]; - : t -> (int * list int) = However, partial application of constructors is not supported: # A 3; Characters 0-3: A 3; ^^^ Error: The constructor A expects 2 argument(s), but is applied here to 1 argument(s) Jeremy.