From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id oBQ5JqEq015963 for ; Sun, 26 Dec 2010 06:19:52 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au0AAMdfFk3RVdY2kWdsb2JhbACkKQgVAQEBAQkLCgcRBCClL4l3ghiDUi6IVwEBAwWFRQSEZYYfhhI X-IronPort-AV: E=Sophos;i="4.60,230,1291590000"; d="scan'208";a="93195708" Received: from mail-bw0-f54.google.com ([209.85.214.54]) by mail1-smtp-roc.national.inria.fr with ESMTP; 26 Dec 2010 06:19:47 +0100 Received: by bwz12 with SMTP id 12so2015794bwz.27 for ; Sat, 25 Dec 2010 21:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=BE+SljYRGhOiR83NkgF6rgiT7EzrhKRiOBeKIVmp+k4=; b=TVgrfRcsgSBkdvQzVTGaztkIE8MQmnfUZ2fT80197S5FLXOEKIjs9oWyWP1CQr0JfO TbRjbUd+K9N1oQugsMiDXhnUH6I6V+XBIJ89WyAFCPntXhjFZnUsXZqMRwUJEPMyozwc kqitgrKKZOwZmSn8VVn7wUp7ksNExLWgE3Snc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=qTsNz97BGByaUJnwvLbVg5ISC+QflIGNYdwc3pZ+i7ChpaJysqyPaUIfElzvZX0ZaW ZYeoSehDXvVmesg3leePuGndu3uOefqNX7RDqI1IRgpODQvDYSLb/78YIvCvX1pQYll/ 13zsIhEzMBlREjivVmkNH/AtGoY6qfZoxkWJE= MIME-Version: 1.0 Received: by 10.204.77.199 with SMTP id h7mr9241204bkk.79.1293340786072; Sat, 25 Dec 2010 21:19:46 -0800 (PST) Received: by 10.204.71.3 with HTTP; Sat, 25 Dec 2010 21:19:46 -0800 (PST) Date: Sun, 26 Dec 2010 00:19:46 -0500 Message-ID: From: Markus Mottl To: OCaml List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id oBQ5JqEq015963 Subject: [Caml-list] Manifest types in module type inclusions Hi, please consider the following code: ------------------- module M = struct type t = A | B end module X : sig (* type t = M.t = A | B *) include module type of M (* include module type of M with type t = M.t = A | B *) end = struct include M end let () = assert (M.A = X.A) ------------------- This will fail, because M.A is not of the same type as X.A. But I would really like to make the types equivalent. Using the first commented out line instead of the module type inclusion will succeed, but then I would not be able to automatically include any functions potentially contained in module M. The last commented out line won't work, because one cannot establish a type equivalence via a manifest type definition after "with type". Even if, I don't think one could override anything else but an abstract type that way, and we are including a sum type here already. Does anybody have any suggestions for a workaround? I suspect this may be a missing feature. Regards, Markus -- Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com