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?

Cheers,
Theo Norvell

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to