So...there&#39;s just no good way to avoid the duplication?<br><br><div class="gmail_quote">On Tue, Jan 20, 2009 at 11:10 PM, wren ng thornton <span dir="ltr">&lt;<a href="mailto:wren@freegeek.org">wren@freegeek.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Andrew Wagner wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
Strange little bit of code:<br>
<a href="http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=829#a829" target="_blank">http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=829#a829</a><br>
<br>
If I do any of the following, all of which seem natural to me, it fails to<br>
typecheck:<br>
<br></div>
 &nbsp; 1. move f out of the &#39;where&#39; clause (with or without a type signature)<br>
 &nbsp; 2. put the same type signature on f as is on (/\)<br>
 &nbsp; 3. replace f with (/\) completely<div class="Ih2E3d"><br>
<br>
What&#39;s going on here?<br>
</div></blockquote>
<br>
 &nbsp; &nbsp;&gt; :t (nub .) . (++)<br>
 &nbsp; &nbsp;(nub .) . (++) :: (Eq a) =&gt; [a] -&gt; [a] -&gt; [a]<br>
<br>
 &nbsp; &nbsp;&gt; :t foldr (map . (nub .) . (++))<br>
 &nbsp; &nbsp;foldr (map . (nub .) . (++)) :: (Eq a) =&gt; [[a]] -&gt; [[a]] -&gt; [[a]]<br>
<br>
The type you give to (/\) is more restrictive than the type of the expression, and f uses the generality of the expression.<br><font color="#888888">
<br>
-- <br>
Live well,<br>
~wren<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</font></blockquote></div><br>