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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 083EBBC57 for ; Wed, 21 Jul 2010 17:49:15 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlQBAF2zRkyLEwExhWdsb2JhbACTM4w9FQEBAQoLChgFHbI4AY8HBYUyiF0 X-IronPort-AV: E=Sophos;i="4.55,239,1278280800"; d="scan'208";a="66769623" Received: from hera.mpi-sb.mpg.de ([139.19.1.49]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 21 Jul 2010 17:49:14 +0200 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=aVCDNKbmSV7H+rda0UncPVSd11MaSH6e+J F84J6m1DQ=; b=ngf5VxU+bO1UGVdwOAfo6HdrCNaq/6ks2iEfDyZy95zjNAzKO6 3N9RFrwbhfquvYDCkMuKH2WLz9zOgCVvLYuGTJreKE2CnOjzXUhwg0/dD43gl4CQ kKoqPtQswBXOvjy1pym6uKB5hSP7D/HQEzX9SecAuQKGWs+dUOSTMPlxA= Received: from infao0710.mpi-klsb.mpg.de ([139.19.1.27]:55576 helo=zak.mpi-klsb.mpg.de) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1ObbXj-0003z2-GV; Wed, 21 Jul 2010 17:49:13 +0200 Received: from local by zak.mpi-klsb.mpg.de (envelope-from ) with local (Exim 4.69) id 1ObbXi-0006qr-VL; Wed, 21 Jul 2010 17:49:11 +0200 Received: from 80.146.185.83 (SquirrelMail authenticated user rossberg) by mail.mpi-sws.org with HTTP; Wed, 21 Jul 2010 17:49:11 +0200 (CEST) Message-ID: In-Reply-To: References: <4C46F866.9050900@inria.fr> Date: Wed, 21 Jul 2010 17:49:11 +0200 (CEST) Subject: Re: [Caml-list] Bug in the module system of version 3.12.0+beta1 From: rossberg@mpi-sws.org To: caml-list@inria.fr Cc: dumitru.potop@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; bug:01 rossberg:01 functor:01 sig:01 val:01 functor:01 struct:01 sig:01 val:01 wrote:01 wrote:01 signatures:01 signatures:01 opaque:01 andreas:01 "Jeremy Yallop" wrote: > On 21 July 2010 14:38, Dumitru Potop-Butucaru > wrote: >> module type Abc = >>   functor (M:Simple) -> >>   sig >>      val x : M.t >>   end > > You're trying to treat Abc as a functor from signatures to signatures > (i.e. as a parameterised signature). In fact, it's something quite > different: it's the *type* of a functor from structures to structures. > > You can emulate a parameterised signature using a signature with some > opaque components, which are later specified using substitution. Or just write a functor that returns a structure containing the desired signature. This requires no new features: module Abc (M:Simple) = struct module type S = sig val x : M.t end end Use it as follows: module MyModule : sig include Abc(IntSet).S val y : int end = ... /Andreas