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
type constraints involving variant types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-16 (10:43)
From: Christian Sternagel <christian.sternagel@u...>
Subject: type constraints involving variant types
Is it possible to give type constraints involving variant types?
If there is e.g.

module type A = sig
 type t = A of 'a | B of 'b

module type B = sig
 module A : A

Can I then do something like

module type C = sig
 module B : B
 module A : A
  with type t = B.A.t = A of 'a | B of 'b

The above yields a syntax error, but there should be a way of doing
that or not?