Existential types tend to be most useful when combined with
typeclasses.  This is because you don't know what type is being
returned, however you do know an interface which can be used with this
type.

We use existential types in our mapping from CORBA to Mercury.  Please
see the paper "MCORBA: A CORBA Binding for Mercury" from our papers
page <http://www.cs.mu.oz.au/research/mercury/information/papers.html>
for more details.

The basic idea is that the IDL (interface description language) compiles
to a typeclass, which specifies that interface.  You ask the ORB (object
request broker) for an object that implements that interface, and you
get back *some* type, T, which implements that interface.  However you
do know that you can call any of the typeclass methods on that type, T.

Pete

Reply via email to