Jon Mountjoy <[EMAIL PROTECTED]> writes:

> In Hugs(January 1998), one gets
> 
>      ERROR "hugs.hs" (line 32): Unresolved top-level overloading
>      *** Binding             : happyReduce_1
>      *** Outstanding context : Functor b
> 
> where line 32 is the one marked -- ##
> 
> It compiles in ghc-3.00.

Taking a look at the offending code:

> happyReduce_1 = happySpecReduce_1 1 reduction where {    -- ##
>   reduction
>       (HappyAbsSyn2  happy_var_1)
>        =  HappyAbsSyn1
>                (\p -> let q = map (\(x,y) -> (x,y p)) happy_var_1 in  (10.1));
>   reduction _  = notHappyAtAll }

It appears that this *is* ambiguous, so ghc should complain.  map has
type 
        Functor f => (a -> b) -> f a -> f b

and there's nothing to bind the type variable 'f'.  It would probably
help if you used 'q' in the result of the function, or gave type
signatures to the productions in the grammar.

In any case, this look like a bug.  I'll investigate in more detail
next week.

-- 
Simon Marlow                                             [EMAIL PROTECTED]
University of Glasgow                       http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key

Reply via email to