Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Zheng Li <li@p...>
Subject: Re: type constraints involving variant types

Not sure if this is what you want:

# module type C = sig
    module A: A
    module B: B with module A = A
  end;;
module type C =
  sig
    module A : A
    module B : sig module A : sig type t = A.t = A of int | B of string end end
  end

Christian Sternagel <christian.sternagel@uibk.ac.at> writes:
> module type A = sig
>  type t = A of 'a | B of 'b
> end
>
> module type B = sig
>  module A : A
> end
>
> 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
> end
>

-- 
Zheng Li
http://www.pps.jussieu.fr/~li