Version française
Home     About     Download     Resources     Contact us    
Browse thread
Stupid question re:modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Hurt <bhurt@s...>
Subject: Stupid question re:modules

I should just know this.  So let's say I have two module types defined:

module type Foo = sig
 	type 'a t
 	val foo : 'a -> 'a t
end;;

module type Bar = 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 
cutting and pasting the module definitions around.  I've been trying to 
do:

module Baz : sig
 	type 'a baz
 	include Foo with type 'a t = 'a baz
 	include Bar with type 'a t = '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 what it 
is.  Hints would be appreciated.

Brian