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 EE7167ED26 for ; Fri, 8 Jun 2012 05:22:21 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0EAFVu0U+FBoIF/2dsb2JhbABFtVmCGAEBBAE6BgMBNQEBAwsLDiYSVwaIGQSlXoQ0AYV7iH0BBpBGYIhBjGCPe4Jv X-IronPort-AV: E=Sophos;i="4.75,734,1330902000"; d="scan'208";a="161850842" Received: from rabbit.math.nagoya-u.ac.jp (HELO mailhost.math.nagoya-u.ac.jp) ([133.6.130.5]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Jun 2012 05:22:20 +0200 Received: from mailhost.math.nagoya-u.ac.jp (localhost [127.0.0.1]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 2754D6308; Fri, 8 Jun 2012 12:22:18 +0900 (JST) Received: from mailhost.math.nagoya-u.ac.jp (camel-172.math.nagoya-u.ac.jp [172.16.254.4]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id E5A5D40C3; Fri, 8 Jun 2012 12:22:17 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=math.nagoya-u.ac.jp; h= subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=alpha; bh=CA9RKpU2EqOitcyP+fwlQS0RcWo=; b=X/5pyuFYJGj2Oy/ZWsXIZDWVarT0 uASSZT1Axz2zlbdOG7uML2iWVuow6dy6Itj0U7PaeuKAv3KuoS+mC0Pz9hi/kPKX IJeyeB1tyWUF2YYKDQ2mQYBmBPM+OHR8BfPrjgUMkg6gNXqUSscJVwzmaxkiIYvB TR1vVLL3paQndJ0= DomainKey-Signature: a=rsa-sha1; h=Received:Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=nZK7cdYgcRn9itKMauj3q/bLiKBOGtlO+KYIVMyB8/LGqDAmYL0EUX1JoHeUWn/vqbo3j8v3OEkZKU3vu86eaiwachTlHJ1LxPuu0AIokPv1fhJp1O/AAzSHFMAbAErFZTf+b8QrQY6cLDkXWKnGBJfUoJPRZaHsxGL0VBAynYI=; c=nofws; d=math.nagoya-u.ac.jp; q=dns; s=alpha Received: from tet.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTPSA id C7DC239A2; Fri, 8 Jun 2012 12:22:17 +0900 (JST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Jacques Garrigue In-Reply-To: <4FD164E2.4050807@gmail.com> Date: Fri, 8 Jun 2012 12:22:17 +0900 Cc: caml-list Content-Transfer-Encoding: 7bit Message-Id: <8D5E880B-79AC-45E1-B866-B83C3D725E36@math.nagoya-u.ac.jp> References: <4FD164E2.4050807@gmail.com> To: Hongbo Zhang X-Mailer: Apple Mail (2.1084) Subject: Re: [Caml-list] First Class modules -A bug in 4.00? On 2012/06/08, at 11:35, Hongbo Zhang wrote: > Hi, List > I am not sure this is a bug or not? > > Below is a contrived example: > ------------------ > module type S = sig > type t=int > module X : sig type u end > end > > let f ( module X : S) (y:X.X.u) = > 3 > -------------------- > Error: This pattern matches values of type X.X.u > but a pattern was expected which matches values of type X.X.u > The 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 you might have meant is: let f (type a) (module X : S with type X.u = a) (y : X.X.u) = 3 This is typable (but I'm not sure it means anything...) Jacques Garrigue