Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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

module type Bar = sig
 	type 'a t
 	val bar : 'a -> 'a t

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 

module Baz : sig
 	type 'a baz
 	include Foo with type 'a t = 'a baz
 	include Bar with type 'a t = 'a baz

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.