ambiguity problem

Martin Sulzmann <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
Hi,

I'm using -- Hugs Version February 2001.

hugs -98 reports ambiguity for the following program

class Bar a b | a -> b where
  bar :: a -> b

class Foo a b  where
  foo :: Bar b c => a -> b


Ambiguous type signature in class declaration
*** ambiguous type : (Foo a b, Bar b c) => a -> b
*** assigned to    : foo

This strange cause the functional dependency should uniquely
determine c!

Suprisingly,

class Bar a b | a -> b where
  bar :: a -> b

class Foo a b 

-- ok
f :: (Foo a b, Bar b c) => a->b
f = undefined

is accepted.

This seems like a bug.

Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.