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 9B20C7EEB4 for ; Thu, 7 Feb 2013 07:48:56 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jacques.garrigue@gmail.com) identity=pra; client-ip=209.85.212.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jacques.garrigue@gmail.com designates 209.85.212.180 as permitted sender) identity=mailfrom; client-ip=209.85.212.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@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-wi0-f180.google.com) identity=helo; client-ip=209.85.212.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="postmaster@mail-wi0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuAFAAhOE1HRVdS0jWdsb2JhbABFrXCJQwGJFAgWDgEBAQEJCQsJEgYjgh8BAQQBJxkBOAEDAQsBBQUEAQY7IQESAQUBHAYTh38DCQYMnmaPL4RuJw1MiQQBBQyMCIVFA4hki2WBWIEdiiKDMRYpgVmCVw X-IPAS-Result: AuAFAAhOE1HRVdS0jWdsb2JhbABFrXCJQwGJFAgWDgEBAQEJCQsJEgYjgh8BAQQBJxkBOAEDAQsBBQUEAQY7IQESAQUBHAYTh38DCQYMnmaPL4RuJw1MiQQBBQyMCIVFA4hki2WBWIEdiiKDMRYpgVmCVw X-IronPort-AV: E=Sophos;i="4.84,619,1355094000"; d="scan'208";a="1738517" Received: from mail-wi0-f180.google.com ([209.85.212.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 07 Feb 2013 07:48:56 +0100 Received: by mail-wi0-f180.google.com with SMTP id hi8so2459630wib.7 for ; Wed, 06 Feb 2013 22:48:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=A6BnGYuiTiTJIiMTdZ3e1DnAzeow8uVu9/4SQGGueqM=; b=h3oxJTjkO0xVu+Huaa8wfOyYstjcIv33ETrh12CoxSx/5iOtTycLqiVZLbxaKpfean 0vAhM8Njm8oVfM6UbnTIT/T9AqTy+NxJgAXYjw2ZhCAzyzBXHPy63hYb6xw9Lh4TgDMu IeaKppk3G8VYyfVYde3DzqF3zFjmlnWqhlLqOZIllZa2AhnSlx1E2Aq35lSUykWE/90H RS5Qvxo65/VRDe5gvFSKtECEgW4Yd8kckwoL3YqMtflscEEnKhklqWdkqJitS+39au+v eHUqrTzhXOyPhvj3KNEQKqyy611YOH7RTSEFWj1o92Zag554/n7Gn52+ip/L6Wbphe3J Hrkg== MIME-Version: 1.0 X-Received: by 10.194.178.33 with SMTP id cv1mr261775wjc.46.1360219735793; Wed, 06 Feb 2013 22:48:55 -0800 (PST) Sender: jacques.garrigue@gmail.com Received: by 10.227.196.74 with HTTP; Wed, 6 Feb 2013 22:48:55 -0800 (PST) In-Reply-To: References: Date: Thu, 7 Feb 2013 15:48:55 +0900 X-Google-Sender-Auth: NJXkVQdcKGN1NT7LiwYywUKj1MA Message-ID: From: Jacques Garrigue To: Christophe Papazian Cc: Caml List Content-Type: multipart/alternative; boundary=089e0122f4182b20c804d51cd6c9 Subject: Re: [Caml-list] Syntax of types --089e0122f4182b20c804d51cd6c9 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Feb 7, 2013 at 3:21 PM, Christophe Papazian < christophe.papazian@gmail.com> wrote: > Hi > > I'm not sure to understand the difference between : > > let f (type s) : s t -> s = ... > let f : type s . s t -> s = ... > > except it seems I can use the second one in place of the first one, but > sometimes I can't use the first one and need the second one. > So I feel I only need the second one. > As explained in the manual, they are not strictly equivalent. http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual021.html#toc80 In particular the second syntax guarantees that the type is polymorphic, and syntactically it can only used just after the defined identifier. This said, in practice the second one mostly subsumes the first one (but it is just syntactic sugar). Jacques Garrigue --089e0122f4182b20c804d51cd6c9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Feb 7, 2013 at 3:21 PM, Christophe Papazian <<= a href=3D"mailto:christophe.papazian@gmail.com" target=3D"_blank">christoph= e.papazian@gmail.com> wrote:
Hi

I'm not sure to understand the difference between :

let f (type s) : s t -> s =3D ...
let f : type s . s t -> s =3D ...

except it seems I can use the second one in place of the first one, but som= etimes I can't use the first one and need the second one.
So I feel I only need the second one.

A= s explained in the manual, they are not strictly equivalent.

=

In particular the second syntax guarantees that the typ= e is polymorphic, and syntactically it can only used just after the defined= identifier.

This said, in practice the second one= mostly subsumes the first one (but it is just syntactic sugar).

Jacques Garrigue
--089e0122f4182b20c804d51cd6c9--