Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Francois Pottier <Francois.Pottier@i...>
Subject: Re: [Caml-list] opaque polymorphism

Hello Charles,

You can write:

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

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

 
  foo.mli:
  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
situations.

Hope this helps,

-- 
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/
-------------------
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