From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1B8767FC18 for ; Mon, 16 Feb 2015 14:39:16 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of bmillwood@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bmillwood@janestreet.com"; x-sender="bmillwood@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of bmillwood@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bmillwood@janestreet.com"; x-sender="bmillwood@janestreet.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@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bmillwood@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CaAQCe8eFUnHDIaSZcgkOBbwSCf69elU0CgQ0HQwEBAQEBARABAQEBAQYWCUKEDQEBAwESEQQZAQE3AQQLCwQHNwICIhIBBQEKEgYTCBqHdwMJCAOpUz4xij5whGIBBZF4AQEBAQEBBAEBAQEBAQEBFAYKiwKCQ4IqB4JogUKEWwqDUo5EOYFAgRgQhUiGGYQ6EiOBFYQQb4JDAQEB X-IPAS-Result: A0CaAQCe8eFUnHDIaSZcgkOBbwSCf69elU0CgQ0HQwEBAQEBARABAQEBAQYWCUKEDQEBAwESEQQZAQE3AQQLCwQHNwICIhIBBQEKEgYTCBqHdwMJCAOpUz4xij5whGIBBZF4AQEBAQEBBAEBAQEBAQEBFAYKiwKCQ4IqB4JogUKEWwqDUo5EOYFAgRgQhUiGGYQ6EiOBFYQQb4JDAQEB X-IronPort-AV: E=Sophos;i="5.09,587,1418079600"; d="scan'208";a="121951309" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Feb 2015 14:39:15 +0100 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout1.mail.janestreet.com with smtp (Exim 4.82) (envelope-from ) id 1YNLtK-0003fQ-3V for caml-list@inria.fr; Mon, 16 Feb 2015 08:39:14 -0500 X-JS-Flow: external Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BU4fMC-AAACfY-C_; 2015-02-16 08:39:14.096332-05:00 Received: from mail-qg0-f41.google.com ([209.85.192.41]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1YNLtJ-0003Un-VY for caml-list@inria.fr; Mon, 16 Feb 2015 08:39:14 -0500 Received: by mail-qg0-f41.google.com with SMTP id i50so23314921qgf.0 for ; Mon, 16 Feb 2015 05:39:13 -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; bh=cA/S4PQ6Q4knp8LKYF/jYqR67sGd7in2x6ouflYeWCA=; b=QPpZ6VE4EP1i5m6oZ0n7grwJo7derjZ8RbWHGNsLdwHywCGAwoTDz/T/Q5DcYonAPP UAkItMhNoU4vhiPu18AmunNJ3zCNy5Ey7wEZEbO6CNuzJYCKbgED/QhPnPQzGxrMFrMw Hc3C+iNADAPHC4PhUUExMyRU/QaPPMoOGfy7g= 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; bh=cA/S4PQ6Q4knp8LKYF/jYqR67sGd7in2x6ouflYeWCA=; b=iwKo9nKoXpOtvj1r7aINV1uNwGh8UnIOXeJMMU0ARfcfhhp2sVuOrFxxV+dCJTZp2X 9qELpfC0oL/mgDLJSufIJr0QxOyVFsYe0xJ6FWzsvfR7RaXeJywAQe97IwAfrXyoHcQc ixERXzTz7PAo6rO3OU1rBgXdyvg2JuKrJABLkhlI9eBCfgBPlT63oNL6lwIZonx7imqK YwOWRadEprk1i4U8n8q5U8xLBhn8bzVVeD3ugY01W4pbLGnBtPWFVz91h1e2s7CLlHxG 1pgIzjgmSoI3BWtYOX4HswAEBzAoVNHBy+72vyznZDdFPaCfLj5WmuW5/jLJW9OQu7h9 UzRg== X-Gm-Message-State: ALoCoQk53DBjSuQHZ+1iXJtiZlYfUjma4F/FlybGsOss2tUcfMogDZ4Q5k103xSooiHxHnFsEOjyr5vJaoIIZis60K6aO5rRhZsBtLRXqXzLtUuvpciCsKKm/ubyRIWTPc3qOujQOSp2 X-Received: by 10.140.88.17 with SMTP id s17mr102292qgd.79.1424093953730; Mon, 16 Feb 2015 05:39:13 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.88.17 with SMTP id s17mr102278qgd.79.1424093953624; Mon, 16 Feb 2015 05:39:13 -0800 (PST) Received: by 10.140.104.9 with HTTP; Mon, 16 Feb 2015 05:39:13 -0800 (PST) In-Reply-To: <419599633.6386715.1424045192831.JavaMail.yahoo@mail.yahoo.com> References: <419599633.6386715.1424045192831.JavaMail.yahoo@mail.yahoo.com> Date: Mon, 16 Feb 2015 13:39:13 +0000 Message-ID: From:Ben Millwood To:Jean Saint-Remy Cc:"caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a11c13a663ba29b050f34b6c6 X-JS-Processed-by: mailcore Subject: Re: [Caml-list] explicit polymorphic types in record fields --001a11c13a663ba29b050f34b6c6 Content-Type: text/plain; charset=UTF-8 Gerd's reply covers most of the important points. I just wanted to add: On 16 February 2015 at 00:06, Jean Saint-Remy wrote: > I could not declare the fields for example as a polymorphic tuple for > instance: "type idref = { mutable 'a * 'b -> 'a }" nor "type idref = { > mutable 'a. 'b -> 'a }". The latter is just nonsense, the 'b is undefined. > But we could have a two field record by just repeating the type > definitions. "let idref = { mutable 'a. 'a -> 'a; mutable 'b. 'b -> 'b }". > The polymorphic type does not have any restriction, it appears we could > have any fundamental type we wanted. The type 'a variable must be repeated, > it is not enough to say "type idref = { mutable 'a. -> 'a };;" Is it > correct then to read the declaration in this way: the type 'a polymorphic > type as a polymorphic variable of type 'a. I know it sounds redundant, but > that is how I am reading the syntax. > All the pieces of record syntax in this quoted paragraph are missing a field name. Where you say things like "type idref = { mutable 'a * 'b -> 'a }", you probably mean something like "type idref = { mutable fst : 'a 'b . 'a * 'b -> 'a }" -- notice the name of the field, followed by the colon, which always comes before the type, including any 'a . -style variable bindings it might start with. --001a11c13a663ba29b050f34b6c6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Gerd's reply covers most of the important points. I ju= st wanted to add:

On 16 February 2015 at 00:06, Jean Saint-Remy <jeansaintremy@yah= oo.com> wrote:
I could not declare the fields for example as a polymorphic tuple for ins= tance: "type idref =3D { mutable 'a * 'b -> 'a }" = nor "type idref =3D { mutable 'a. 'b -> 'a }". The= latter is just nonsense, the 'b is undefined. But we could have a two = field record by just repeating the type definitions. "let idref =3D { = mutable 'a. 'a -> 'a; mutable 'b. 'b -> 'b }&= quot;. The polymorphic type does not have any restriction, it appears we co= uld have any fundamental type we wanted. The type 'a variable must be r= epeated, it is not enough to say "type idref =3D { mutable 'a. -&g= t; 'a };;" Is it correct then to read the declaration in this way:= the type 'a polymorphic type as a polymorphic variable of type 'a.= I know it sounds redundant, but that is how I am reading the syntax.
=

All the pieces of record syntax in t= his quoted paragraph are missing a field name. Where you say things like &q= uot;type idref =3D { mutable 'a * 'b -> 'a }", you prob= ably mean something like "type idref =3D { mutable fst : 'a 'b= . 'a * 'b -> 'a }" -- notice the name of the field, fo= llowed by the colon, which always comes before the type, including any '= ;a . -style variable bindings it might start with.
--001a11c13a663ba29b050f34b6c6--