Functional dependencies
Josef Svenningsson
josefs@cs.chalmers.se
Fri, 30 Nov 2001 12:03:38 +0100 (MET)
Hi!
It seems as the functional dependencies are not working as well as they
should.
Suppose I have the following class:
\begin{code}
class A a b | a -> b where
foo :: a b
\end{code}
and then I declare the following type:
\begin{code}
newtype Foo = Bar (forall a b. A a b => a Int)
\end{code}
Loading this in hugs gives the following error message:
ERROR HugsBug.lhs:9 - Ambiguous type signature in type component
*** ambiguous type : A a b => a Int
But the type is clearly not ambiguous since the functional dependency
determines b whenever a is known.
/Josef