<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div bgcolor="#ffffff" text="#000000"><font size="+1">f1 = (zipWith ($)) . (mapĀ  (*)) <br>

<br>
f2 = sum</font></div></blockquote><div><br>First, f1 would be clearer as zipWith (*).<br><br>Second, look at the type of (.):<br><br>(.) :: (b -&gt; c) -&gt; (a -&gt; b) -&gt; (a -&gt; c)<br><br>Notice that (b -&gt; c) and (a -&gt; b) each take one argument, but f1 takes two arguments. That&#39;s why using (.) with f1 doesn&#39;t work.<br>
<br>You can do what you want by uncurrying f1 so it takes only one argument, which makes it easier to compose. You can then re-curry the result after you do the composition.<br><br>f1 :: [Integer] -&gt; [Integer] -&gt; [Integer]<br>
uncurry f1 :: ([Integer], [Integer]) -&gt; [Integer]<br>f2 . uncurry f1 :: ([Integer], [Integer]) -&gt; Integer<br>curry (f2 . uncurry f1) :: [Integer] -&gt; [Integer] -&gt; Integer<br><br>I&#39;m sure there are shorter versions that use more than just (.), curry, and uncurry.</div>
</div>