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
[Caml-list] opaque polymorphism
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-09-10 (07:02)
From: Francois Pottier <Francois.Pottier@i...>
Subject: Re: [Caml-list] opaque polymorphism

Hello Charles,

You can write:

  type ('a, 'b, 'c) internal_t = { ... }

  type ('a, 'c) t = ('a, <some type>, 'c) internal_t

  type ('a, 'c) t

So ``hiding the polymorphism in 'b'' can be done, but you have to tell
the compiler which internal type should be used instead of 'b, i.e. you
have to choose <some type>. I guess the unit type will do in most

Hope this helps,

François Pottier
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr