From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 1E95ABC69 for ; Fri, 24 Aug 2007 12:16:58 +0200 (CEST) Received: from smtp005.mail.ukl.yahoo.com (smtp005.mail.ukl.yahoo.com [217.12.11.36]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id l7OAGvcx005052 for ; Fri, 24 Aug 2007 12:16:57 +0200 Received: (qmail 82865 invoked from network); 24 Aug 2007 10:16:57 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Received:X-YMail-OSG:In-Reply-To:References:Mime-Version:Content-Type:Message-Id:Cc:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=rHD+iJV1r8U7VJnjjecgqu8VJXT5669MysBX92n7PPzbqq47ap7MQm+LRpfikP51aBp2PMFLINs9futsIUSlyIYeYD+GhJZVpqdJRYVPIj16hlupYQgBbdU2PIET8ZtqD0NLOucyDO1sbdWDHBwqsPLnXkkI3YHqoRv5TDS/Vq8= ; Received: from unknown (HELO ?192.168.1.3?) (vincent.aravantinos@84.101.150.13 with plain) by smtp005.mail.ukl.yahoo.com with SMTP; 24 Aug 2007 10:16:57 -0000 X-YMail-OSG: k2OiaTwVM1kzjmAaqaT2Kcbi9XQ9gKUHhKG.fUFOMByHcpbPoIfDsN3e4svWitLrXgZukpCKTwWHqAGRoO9VUhtZaUHscT0HaFTyWDTokXPNGks7 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Cc: caml-list Content-Transfer-Encoding: quoted-printable From: Vincent Aravantinos Subject: Re: [Caml-list] Stupid question re:modules Date: Fri, 24 Aug 2007 12:16:55 +0200 To: Brian Hurt X-Mailer: Apple Mail (2.752.2) X-Miltered: at discorde with ID 46CEB019.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; foo:01 sig:01 val:01 foo:01 sig:01 val:01 baz:01 baz:01 mixin:01 ocaml:01 imho:01 caml-list:01 caml-list:01 define:02 modules:02 Le 24 ao=FBt 07 =E0 02:32, Brian Hurt a =E9crit : > > I should just know this. So let's say I have two module types =20 > defined: > > module type Foo =3D sig > type 'a t > val foo : 'a -> 'a t > end;; > > module type Bar =3D sig > type 'a t > val bar : 'a -> 'a t > end;; > > Now, I want to define a module that is both a Foo and a Bar without =20= > cutting and pasting the module definitions around. I've been =20 > trying to do: > > module Baz : sig > type 'a baz > include Foo with type 'a t =3D 'a baz > include Bar with type 'a t =3D 'a baz > end;; > > but this blows up on the Bar line (multiple definitions of 'a t). > > There is a solution to this, I'm just being stupid and forgetting =20 > what it is. Hints would be appreciated. > > Brian See also : http://caml.inria.fr/pub/ml-archives/caml-list/2006/12/=20 c7461312202053f2213a9bb33206fcb8.en.html BTW, I thought there was some kind of research about inheritance and =20 modules (heard about "mixin modules"), is there any plan to implement =20= this one day in ocaml ? The lack of real inheritance with modules is a major restriction IMHO... -- Vincent Aravantinos PhD Student - LIG - CAPP Team