functional dependency problem

Till Mossakowski
Wed, 10 Jul 2002 08:14:38 +0200

I wish to add to Christian's question:

why is it not possible to annotate v with its full type:

info :: (Collects e ce, Show e) => ce -> String
info (v::(Collects e ce, Show e) => ce) = show ((one v)::e) 

I then get the error message

    All of the type variables in the constraint `Collects e
							  ce' are already in scope
	(at least one must be universally quantified here)
    In the type: (Collects e ce) => ce
    While checking a pattern type signature
    When checking the pattern: v :: forall. (Collects e ce) => ce
    In the definition of `info':
	info (v :: forall. (Collects e ce) => ce) = show ((one v) :: e)

(and a similar message for the constraint Show e),
which I do not understand - why should e and ce be already in scope?

(I think that this question is actually independent of functional
dependencies - it is about type class constraints).

Till Mossakowski                Phone +49-421-218-4683
Dept. of Computer Science       Fax +49-421-218-3054
University of Bremen             
P.O.Box 330440, D-28334 Bremen