From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id D2A52BBC4 for ; Wed, 15 Apr 2009 14:48:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au8CAJt05UnRVdq0kGdsb2JhbACCJDGSfD8BAQEBCQkMBxEDq2qQNwEEg34 X-IronPort-AV: E=Sophos;i="4.40,192,1238968800"; d="scan'208";a="38523047" Received: from mail-bw0-f180.google.com ([209.85.218.180]) by mail4-smtp-sop.national.inria.fr with ESMTP; 15 Apr 2009 14:48:26 +0200 Received: by bwz28 with SMTP id 28so3425866bwz.27 for ; Wed, 15 Apr 2009 05:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=omnVX4Ee8H5QOK8HbRBdICptx6mOn8rDYtvQ7uVpxTQ=; b=JXmgrcZezR8j9LEKSmcB8DxeVU6iYwECTBm0Z+15V60iktNhYctetEk+m8cyUFJEP8 8A8PJAu5c1m4yad1qReqh3VOODaPbRB4CFNkQp5qnXRH58mVdW4yKwzqY5mndrMegTPu Gx/nlvE0j57gRZn0MBskJvGpqO1UBtLMeBFJk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=GejbPaSFuZBDPfhJKI/Y3O78mlxSsaiJgu9KHHwyoZJAgM7c2MiwikfgC53CxPlPeN VvNdL6rUEvbqfB5WaBWEWuY3z/js3zpGIbF22vPVMnLPvyU2xgDTb/cBqP3AV/gh/7eC U0eSTN1VkBipzxDLVzqyRgcIcdcpxcujwfIgk= MIME-Version: 1.0 Received: by 10.223.113.9 with SMTP id y9mr47314fap.61.1239799705544; Wed, 15 Apr 2009 05:48:25 -0700 (PDT) Date: Wed, 15 Apr 2009 14:48:25 +0200 Message-ID: <721f7f5a0904150548o7351d50fm44aaf29b249b67f6@mail.gmail.com> Subject: Typing of polymorphic variants From: Philippe Veber To: caml-list@yquem.inria.fr Content-Type: multipart/alternative; boundary=001636c923d70aa8ef0467975de2 X-Spam: no; 0.00; variants:01 polymorphic:01 typing:01 int:01 int:01 behaviour:01 behaviour:01 caml:02 caml:02 objective:02 objective:02 explanation:06 explanation:06 definition:07 definition:07 --001636c923d70aa8ef0467975de2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi list, I don't understand the following behaviour: Objective Caml version 3.11.0 # type t = [`A | `B of int u] and 'a u = 'a * t;; Error: In the definition of t, type int u should be 'a u # type t = A | B of int u and 'a u = 'a * t;; type t = A | B of int u and 'a u = 'a * t Anyone's got a simple explanation for this ? ph. --001636c923d70aa8ef0467975de2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi list,

I don't understand the following behaviour:

=A0= =A0=A0=A0=A0=A0=A0 Objective Caml version 3.11.0

# type t =3D [`A | = `B of int u] and 'a u =3D 'a * t;;
Error: In the definition of t= , type int u should be 'a u
# type t =3D A | B of int u and 'a u =3D 'a * t;;
type t =3D A = | B of int u
and 'a u =3D 'a * t

Anyone's got a simpl= e explanation for this ?

ph.


--001636c923d70aa8ef0467975de2--