[Haskell-cafe] Puzzled by error with forall quantifier.

Theodore S. Norvell theo at engr.mun.ca
Mon Feb 2 15:59:18 EST 2004

Can anyone explain the following error message from Hug98
(with extensions enabled)?

I have

 > class Space t
 > class Space t => HasY v t
 >   where
 >     assignY :: v -> t -> t
 >     getY :: t -> v
 >     varY :: forall w . Space w => v -> (t->t) -> (w->w)

I get an error on the last definition "quantifier does not
mention type variable v" (and if I quantify v, then it complains
that t is not quantified).

The idea I'm trying to express is that for any instance of HasY v t
there should be a function varY with type
              v -> (t->t) -> (w->w)
for some type w of class Space.

Any help much appreciated.

Is there any kind of tutorial introduction to "forall" out there?

Theo Norvell

More information about the Haskell-Cafe mailing list