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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id DEEA1BC57 for ; Thu, 16 Dec 2010 15:23:30 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjUBAJOvCU2LEwExe2dsb2JhbACkSwEBFiIFH7MgAY43BYVKiwE X-IronPort-AV: E=Sophos;i="4.59,355,1288566000"; d="scan'208";a="84058565" Received: from infao0809.mpi-sb.mpg.de (HELO hera.mpi-sb.mpg.de) ([139.19.1.49]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 16 Dec 2010 15:23:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=Message-ID:In-Reply-To: References:Date:Subject:From:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=P2c9YcULynYgQNJfkwCQbWtkc/mo8NvjuO v2mBn3J6E=; b=T75CYG2YyPVXDiDPP26GN4tPANt59z00UW4JcOiEj2e79UzFzG znHQz/jVAUnFXTHEM0cm4z//u7SpJUwyfIe/VhSjHzO6nLfvYJcr4MuX/ixh7EdF lO5+UAGcUKqIVpbSlvmVJo/8ClEQBit/i8J+DIo7hdR0eoEPo+ylKYgj4= Received: from infao0525.mpi-klsb.mpg.de ([139.19.1.26]:43181 helo=maniac.mpi-klsb.mpg.de) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1PTEjv-00049j-5S; Thu, 16 Dec 2010 15:23:29 +0100 Received: from local by maniac.mpi-klsb.mpg.de (envelope-from ) with local (Exim 4.69) id 1PTEju-0000Vl-Kz; Thu, 16 Dec 2010 15:23:26 +0100 Received: from 74.125.57.233 (SquirrelMail authenticated user rossberg) by mail.mpi-sws.org with HTTP; Thu, 16 Dec 2010 15:23:26 +0100 (CET) Message-ID: <90ed143b591fb6560925e0558ad7c18d.squirrel@mail.mpi-sws.org> In-Reply-To: <4D0A14BE.9080305@mlstate.com> References: <4D0A14BE.9080305@mlstate.com> Date: Thu, 16 Dec 2010 15:23:26 +0100 (CET) Subject: Re: [Caml-list] Implicitely abstracted type From: rossberg@mpi-sws.org To: "Louis Gesbert" Cc: caml-list@inria.fr User-Agent: SquirrelMail/1.4.15 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam: no; 0.00; abstracted:01 rossberg:01 ocaml:01 bug:01 sig:01 struct:01 struct:01 sig:01 abstract:01 abstract:01 andreas:01 caml-list:01 argument:02 inferred:02 defined:02 > Yesterday I encountered an ocaml error that, if I can now make some > sense out of it -- it's not properly speaking a bug -- was quite > confusing at first and took me some time to figure out. > > What happens is that a sum-type defined in a module can implicitely be > turned into abstract because of its inner contents. > > Here is a small example: > ------ > module F (A : sig type a end) = struct > type a = A.a > type t = X of A.a > end > > (* if A.a is abstract, the type F.t is made abstract *) > module A = F (struct type a end) > (* > The inferred interface is: > module A : sig type a type t end That is a well-known limitation. The fix is to name the argument module: module TA = struct type a end module A = F (TA) /Andreas