<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [Haskell-cafe] [] == []</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>f''' = ([]::[()]) == ([]::[()])<BR>
<BR>
(Very pretty.)<BR>
<BR>
So why doesn't ghc have 'default' instances?<BR>
<BR>
-----Original Message-----<BR>
From: Eugene Kirpichov [<A HREF="mailto:ekirpichov@gmail.com">mailto:ekirpichov@gmail.com</A>]<BR>
Sent: Fri 29/05/2009 10:51<BR>
To: Paul Keir<BR>
Cc: haskell-cafe@haskell.org<BR>
Subject: Re: [Haskell-cafe] [] == [][MESSAGE NOT SCANNED]<BR>
<BR>
2009/5/29 Paul Keir &lt;pkeir@dcs.gla.ac.uk&gt;:<BR>
&gt; Hi all,<BR>
&gt;<BR>
&gt; GHC is not happy with this:<BR>
&gt;<BR>
&gt; f = [] == []<BR>
<BR>
This fails because GHC doesn't know which 'a' you mean, and can't<BR>
choose an Eq instance.<BR>
<BR>
&gt;<BR>
&gt; nor this:<BR>
&gt;<BR>
&gt; f' = ([]::(Eq a) =&gt; [a]) == ([]::(Eq a) =&gt; [a])<BR>
&gt;<BR>
<BR>
This fails for the same reason.<BR>
<BR>
&gt; but this is OK:<BR>
&gt;<BR>
&gt; f'' = ([]::[Integer]) == ([]::[Integer])<BR>
&gt;<BR>
&gt; GHCI is comfortable with [] == [], so why not GHC? 'Just curious.<BR>
<BR>
Because GHCI has some 'default' instances, whereas GHC doesn't. This<BR>
time, it probably chooses a=().<BR>
<BR>
&gt;<BR>
&gt; Cheers,<BR>
&gt; Paul<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; Haskell-Cafe mailing list<BR>
&gt; Haskell-Cafe@haskell.org<BR>
&gt; <A HREF="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</A><BR>
&gt;<BR>
&gt;<BR>
<BR>
<BR>
<BR>
--<BR>
Eugene Kirpichov<BR>
Web IR developer, market.yandex.ru<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>