English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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?