"Frank A. Christoph" wrote:
> 
> > Lennart Augustsson wrote:
> > >
> > > Kevin Atkinson wrote:
> > >
> > > > I am sorry for the naive question but how do you fell about adding
> > > > dynamic binding to Haskell to make it possible to have heterogeneous
> > > > lists with out having to use a nasty union type which has a number of
> > > > problems.
> > > >
> > >
> > > What you want(?) is existential types.  Most implementations support
> > > this.
> >
> > Maybe?  What exactly are they.  I have not been able to find a good
> > guide which explains the forall and exists qualifier concepts.
> 
> There is a short explanation and an example or two in the GHC manual
> (section 5.7).

After reading it through several times I finally was able to get it.  It
would be nice if there was a more gentile guide.

> 
> > What I want to be able to do is store a bunch of objects with a common
> > base class in a list.  And I also want to be able to add types to this
> > heritage without having to modify a single line of the existing code.
> 
> The first is trivially possible; with existential types you can put any
> object of whatever type into a list with other objects. It's not clear to me
> exactly what you mean by the second.

Don't worry about it.  Its not important.

> This is explained in slightly more detail in the GHC manual. There are also
> papers about implementing existential types in functional languages (e.g.,
> Laufer & Odersky), and these usually include motivating examples, and papers
> about using existential types to represent OO-style objects (e.g., Pierce &
> Turner). Mail me if you want a full reference.

Thanks for the explanation.  I will see if I can track the papers down.
-- 
Kevin Atkinson
[EMAIL PROTECTED]
http://metalab.unc.edu/kevina/


Reply via email to