caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Stupid question re:modules
@ 2007-08-24  0:32 Brian Hurt
  2007-08-24  2:56 ` [Caml-list] " Jacques Garrigue
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Brian Hurt @ 2007-08-24  0:32 UTC (permalink / raw)
  To: caml-list


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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-23  9:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-24  0:32 Stupid question Brian Hurt
2007-08-24  2:56 ` [Caml-list] " Jacques Garrigue
2007-08-24  4:31 ` Julien Moutinho
2007-08-24 10:16 ` Vincent Aravantinos
2007-09-23  9:37   ` David Teller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).