[Haskell] ghc question

Jurriaan Hage jur at cs.uu.nl
Wed Mar 17 16:34:34 EST 2004


Hello,

Given the fact that Haskell 98 demands that class constraints in an 
explicit type are
in a normal form (either a variable, or a type variable applied to a 
list of types), it struck me
that in the following (not very useful) program ghci yields a type 
which is not of that form.

class X a where
   (><) :: a -> a -> Bool

class Y a where
   (<>) :: a -> a -> Bool
   _ <> _ = True

instance Y a => X [a] where
   x >< y = not(head x  <> head y)

--f :: Y a => a -> a -> Bool
f g h = [g] >< [h]

Now, in ghci
:t f yields f :: forall t. (X [t]) => t -> t -> Bool

Hugs does reduce the type of f to the explicit type in comments.

My question is: is there any special reason for this behaviour?

Jur
--
http://www.cs.uu.nl/people/jur/progrock.html -- jur at cs.uu.nl
If e-mail does not work try jurriaanhage at hotmail.com



More information about the Haskell mailing list