[Haskell-cafe] Principal type in Haskell

william kim haskelllist at hotmail.com
Thu Jun 22 05:22:32 EDT 2006


Hi All,

I am confused by the notion of principal type in Haskell with type classes. 
Consider a simple example:

f x y = [x] == [y]

GHCi yields type f :: (Eq [a]) => a -> a -> Bool.

But according to the paper "Type classes: an exploration of the design 
space", predicate Eq [a] should be reduced to Eq a. Is this reduction 
performed here? What should be the principal type of f?

Thanks.

william

_________________________________________________________________
Get an advanced look at the new version of MSN Messenger. 
http://messenger.msn.com.sg/Beta/Default.aspx



More information about the Haskell-Cafe mailing list