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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id F19337ED26 for ; Fri, 8 Jun 2012 22:26:41 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgBAM1f0k/RVaA0kGdsb2JhbABFDoVGrnsIIgEBAQEJCQ0HFAQjghgBAQEEEgIPHQEbHQEDDAYFCw0CAiYCAiIBEQEFARwGEyKHWgEDC5pVCQOLUlCCcIRmChknDVeIcQEFDIEXigOEboESA5Uejh4+g0ZV X-IronPort-AV: E=Sophos;i="4.75,738,1330902000"; d="scan'208";a="161988659" Received: from mail-pb0-f52.google.com ([209.85.160.52]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 08 Jun 2012 22:26:14 +0200 Received: by pbbro8 with SMTP id ro8so3678583pbb.39 for ; Fri, 08 Jun 2012 13:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=04RhY9vF14wbCzuJgg2LcXx0wAou5VJYAZDFhfatjHg=; b=nW+WPs5gz+hG3JqvPVguy6OL5EHUtSjTf5gAJpMerOg3kRb8AAIhvbUClxEPGMmnuy YdbQf1x94l3qAfSMe+l2zu4wcxdXjvKMDVvLKHbXlU4cy0S90iXvewhehYBv+Ot6XA7i vKax+OAswlyGPIs4TYXRbm+oMsaTXXgoCNmAXkiS1dEFO98Ux17RQBAaBd+2RqYjrPO6 X1pfXV3CzKbhXktkm2GUeoW4AcpQoJyZWjR2p6SwZVnp0+oPAwHfx5rRg9FxY3aZRq90 Bv1QpWVbrnuftScnAG3cCQyWAdCmmPkA16keOModS2QGCXD8tcjB+a1Ak8NYGE7HcvwS BxDw== Received: by 10.68.200.102 with SMTP id jr6mr25554542pbc.0.1339187172296; Fri, 08 Jun 2012 13:26:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.55.36 with HTTP; Fri, 8 Jun 2012 13:25:32 -0700 (PDT) In-Reply-To: <8D5E880B-79AC-45E1-B866-B83C3D725E36@math.nagoya-u.ac.jp> References: <4FD164E2.4050807@gmail.com> <8D5E880B-79AC-45E1-B866-B83C3D725E36@math.nagoya-u.ac.jp> From: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Date: Fri, 8 Jun 2012 16:25:32 -0400 Message-ID: To: Jacques Garrigue Cc: Hongbo Zhang , caml-list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] First Class modules -A bug in 4.00? On Thu, Jun 7, 2012 at 11:22 PM, Jacques Garrigue wrote: > On 2012/06/08, at 11:35, Hongbo Zhang wrote: > >> Hi, List >> =C2=A0I am not sure this is a bug or not? >> >> =C2=A0Below is a contrived example: >> ------------------ >> =C2=A0module type S =3D sig >> =C2=A0 =C2=A0type t=3Dint >> =C2=A0 =C2=A0module =C2=A0X : sig type u =C2=A0 end >> =C2=A0end >> >> =C2=A0let f ( module X : S) =C2=A0(y:X.X.u) =3D >> =C2=A03 >> -------------------- >> Error: This pattern matches values of type X.X.u >> =C2=A0 =C2=A0 =C2=A0but a pattern was expected which matches values of t= ype X.X.u >> =C2=A0 =C2=A0 =C2=A0The type constructor X.X.u would escape its scope >> -- Thanks > > Definitely, this is not a bug. > Type X.X.u is abstract, and showing it outside (as by taking an argument > of that type) would be meaningless. What do you mean by "abstract type" here? For example, I'd call X.t in the following example abstract and it is perfectly fine to use it as argument. module X : sig type t end =3D struct type t =3D int end let f (x : X.t) =3D 3 But I guess you mean something else by abstract? Is my terminology completely wrong?