
29 May
2009
29 May
'09
9:51 a.m.
2009/5/29 Paul Keir
Hi all,
GHC is not happy with this:
f = [] == []
This fails because GHC doesn't know which 'a' you mean, and can't choose an Eq instance.
nor this:
f' = ([]::(Eq a) => [a]) == ([]::(Eq a) => [a])
This fails for the same reason.
but this is OK:
f'' = ([]::[Integer]) == ([]::[Integer])
GHCI is comfortable with [] == [], so why not GHC? 'Just curious.
Because GHCI has some 'default' instances, whereas GHC doesn't. This time, it probably chooses a=().
Cheers, Paul
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Eugene Kirpichov Web IR developer, market.yandex.ru