From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 18E14BC57 for ; Mon, 6 Sep 2010 11:39:21 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtMBAApUhEzRVdg2kGdsb2JhbACDGJ1zCBUBAQEBCQkMBxEDH6FXiHeCUYVaiGYBAQMFgR2DJ3QEihiIZw X-IronPort-AV: E=Sophos;i="4.56,324,1280700000"; d="scan'208";a="66983034" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail1-smtp-roc.national.inria.fr with ESMTP; 06 Sep 2010 11:39:20 +0200 Received: by mail-qw0-f54.google.com with SMTP id 5so4623509qwg.27 for ; Mon, 06 Sep 2010 02:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=xaeftF/3EIajTvZ/mSODL/XYu1+fO61eRK3y9+MA+50=; b=uThMNoeLbXDPzdknrx1D8IaxlpzwjEVwPWfOBfI5TydPdLM2P/DXOSjbJZXAwfb4E7 ycQmaGXJ+8lg7pjItvRlc+Zbu6yh158Hnj9JFM5/pDL3jyVNme9eY1RJc53VPZGiu1hm lQOMsTfBE6OlaRDjhiIlnhORtCG1N1FDYfTBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=mfM1Zsfhxbwtkq9ytIRVlFUgXV5JxMQ2fZsDtrVUVOE003fR6bPyzK/rjWiZ0wP7Ul ejQZXdjt+qaDHGjPswkecxotJoP3DrGshUCPoLfJY2O//W89uW2naRR789NkGARlkWAv LAwHEHLt0nNNT8eYZ+uX2wlZ5QsT3g/fL2YVA= MIME-Version: 1.0 Received: by 10.229.225.211 with SMTP id it19mr3154947qcb.87.1283765960447; Mon, 06 Sep 2010 02:39:20 -0700 (PDT) Sender: daniel.c.buenzli@gmail.com Received: by 10.229.223.208 with HTTP; Mon, 6 Sep 2010 02:39:20 -0700 (PDT) In-Reply-To: <19588.45205.199003.965321@blau.inf.tu-dresden.de> References: <19588.45205.199003.965321@blau.inf.tu-dresden.de> Date: Mon, 6 Sep 2010 11:39:20 +0200 X-Google-Sender-Auth: xwUMDfQoyAPho_q0qU3HyPIlAeo Message-ID: Subject: Re: [Caml-list] functor substitution gives error From: =?UTF-8?Q?Daniel_B=C3=BCnzli?= To: Hendrik Tews Cc: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; functor:01 buenzli:01 sig:01 sig:01 struct:01 struct:01 compile:01 compiles:01 caml-list:01 int:01 int:01 substitution:01 match:02 string:02 string:02 I think I just hit the same kind problem. This doesn't compile : ---- module A : sig type m module M : sig type t = m end end = struct module M = struct module S = String module Smap = Map.Make(S) type t = int Smap.t end type m = M.t end ---- Type declarations do not match: type t = int Smap.t is not included in type t = m However if I put S outside M, or if I specify the type of Smap it compiles : ---- module A : sig type m module M : sig type t = m end end = struct module S = String module M = struct module Smap = Map.Make(S) type t = int Smap.t end type m = M.t end ---- ---- module A : sig type m module M : sig type t = m end end = struct module M = struct module S = String module Smap = (Map.Make(S) : Map.S with type key = S.t) type t = int Smap.t end type m = M.t end ---- Daniel