From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p5NGhNFn021376 for ; Thu, 23 Jun 2011 18:43:24 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgMCAO5sA07RVaC2kGdsb2JhbAA8AQMShEmiVwgUAQEBAQkJDQcUBCGpMIJKjAE+gkeEUzmIZwEBAwaBJYN4gQoEkXKMADyDUw X-IronPort-AV: E=Sophos;i="4.65,414,1304287200"; d="scan'208";a="85972808" Received: from mail-gy0-f182.google.com ([209.85.160.182]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Jun 2011 18:43:05 +0200 Received: by gyf3 with SMTP id 3so1237755gyf.27 for ; Thu, 23 Jun 2011 09:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=bnAH+u/BL/vDJPcnn3uH/TWqF7Vp95gAe4yFfZF0X/E=; b=vln/C2n+b7eKJgKmuKBlqbGUpchf//K9jUYx3WlZvQU24AFuvWI/gSsb8Yi2q+lWUk zIBT5RBDjv2YO/mGtguvm6pfotwS22ivKZChMBh7Xe1wNLy2lDETEs8Uk2JKohppBft0 9uOVvo8yTXPJJc9mWU7cEtf3rbnZVRWMyjBuI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=OIQZnEHTbUUsgzvWMicjRl8whKdY3X2DzZGXqgosr2uTJ8eDPzRXru0XdywFwp8o+H tGIOLDlE4xu8YxdDt5gfNlaht9CqX8x3WQgXm8kQzv34ih6+kFvbdtrQbduvLy7zMSXl Ue6+fsZHhWdW0r7P70y/xr//3HUxnyqQHB0wY= MIME-Version: 1.0 Received: by 10.101.194.10 with SMTP id w10mr2335745anp.141.1308847384516; Thu, 23 Jun 2011 09:43:04 -0700 (PDT) Received: by 10.100.215.20 with HTTP; Thu, 23 Jun 2011 09:43:04 -0700 (PDT) Date: Thu, 23 Jun 2011 17:43:04 +0100 Message-ID: From: Radu Grigore To: caml-list Content-Type: text/plain; charset=UTF-8 Subject: [Caml-list] module name alias and typing The following code compiles as expected. module Int = struct type t = int let compare = compare end module Util = struct module IntSet = Set.Make (Int) end let a = Util.IntSet.singleton 0 module U = Util let b = U.IntSet.mem 0 a However, if the definition of Int is moved inside Util then the type-checker complaints that Util.IntSet.t and U.IntSet.t are incompatible. module Util = module Int = struct type t = int let compare = compare end struct module IntSet = Set.Make (Int) end let a = Util.IntSet.singleton 0 module U = Util let b = U.IntSet.mem 0 a I thought that "module X = Y" makes the names X and Y refer to the same module. Is this correct? Could someone explain what is going on in this example? I tried with 3.11.2 and with 3.13.0+dev4 (2011-06-20).