Nigel Perry wrote:

> At 10:11 pm +0000 5/11/99, Marcin 'Qrczak' Kowalczyk wrote:
> >Fri, 5 Nov 1999 22:26:17 +1300, Nigel Perry <[EMAIL PROTECTED]> pisze:
> >
> > > I missed the start of this and am a bit confused - I keep seeing
> > > "forall", which is universal, not "there exists", which is
> > > existential - at least as I know them. Are the existentials talked
> > > about in relation to Haskell something different, or has the notation
> > > just got confused?
> >
> >A value of type
> >    data Action = forall b. Act (IORef b) (b -> IO ())
> >is something like "there exists some type b, such that this is a pair
> >of IORef b and b -> IO ()".
>
> OK, we are talking about the same thing.
>
> >Instead of providing separate pack+open constructs, GHC/Hugs extend
> >the syntax of declarations of datatypes, so that building and using
> >values of quantified types simply looks like using constructors and
> >pattern matching, modulo those non-obvious rules about what is actually
>
> Which is what we did in Hope+C (you have to say it out loud ;-)) as well.
>
> So that's good, I was concerned my earlier answer and reference to a paper on 
>implementation was talking about the wrong thing when I kept seeing the "forall". 
>Implementing existentials in Hope+C was not hard, I wonder why it was hard in GHC? 
>(Rhetorical musing, I'll go find the answer myself.)

Implementing existentials without a context is very easy.  It took less than a
day in hbc.  But when you want to handle a context on the type variable
as well, which is when it gets interesting, is more complicated.


--

        -- Lennart



Reply via email to