Version française
Home     About     Download     Resources     Contact us    
Browse thread
type parameter of polymorphic variant types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Keiko Nakata <keiko@k...>
Subject: type parameter of polymorphic variant types
Hello.

Why I cannot have these type definitions?

#type ('a,'b) t = ['a | 'b] constraint 'a =[>] constraint 'b = [>];;
#type ('a,'b) t = A of 'a * 'b constraint 'a = [>'b];;


Moreover, for the type definition 

#type ('a, 'b) u = 'a constraint 'a = [>`A | 'b] ;;

the type checker reports an error 

  Characters 48-50:
    type ('a,'b) t = A of 'a * 'b constraint 'a = [>'b];;
                                                    ^^
  The type 'a is not a polymorphic variant type

Is this a kind of typo of 'a for 'b or an intention?


Regards,
Keiko.