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 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: 2005-07-14 (04:03)
From: Keiko Nakata <keiko@k...>
Subject: type parameter of polymorphic variant types

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?