Scott: benchmark the two and you&#39;ll see why we have both :-)<span></span><br><br>On Thursday, September 12, 2013, Scott Lawrence  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, 12 Sep 2013, Tom Ellis wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Sep 12, 2013 at 09:21:20AM -0400, Scott Lawrence wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Something&#39;s always bothered me about map and zipWith for ByteString. Why is it<br>
<br>
    map :: (Word8 -&gt; Word8) -&gt; ByteString -&gt; ByteString<br>
<br>
but<br>
<br>
    zipWith :: (Word8 -&gt; Word8 -&gt; a) -&gt; ByteString -&gt; ByteString -&gt; [a]<br>
</blockquote>
<br>
Well, what if you wanted to zipWith a function of type &quot;Word8 -&gt; Word8 -&gt;<br>
Foo&quot; instead of &quot;Word8 -&gt; Word8 -&gt; Word8&quot;?<br>
</blockquote>
<br>
Then I would do what I do with map, and call `unpack` first.<br>
<br>
Either of the two options is usable:<br>
<br>
 map :: (Word8 -&gt; Word8) -&gt; ByteString -&gt; ByteString<br>
 zipWith :: (Word8 -&gt; Word8 -&gt; Word8) -&gt; ByteString -&gt; ByteString -&gt; ByteString<br>
   (or)<br>
 map :: (Word8 -&gt; a) -&gt; ByteString -&gt; [a]<br>
 zipWith :: (Word8 -&gt; Word8 -&gt; a) -&gt; ByteString -&gt; ByteString -&gt; [a]<br>
<br>
I just don&#39;t understand why we have one from each.<br>
<br>
-- <br>
Scott Lawrence<br>
______________________________<u></u>_________________<br>
Haskell-Cafe mailing list<br>
<a>Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/haskell-cafe</a><br>
</blockquote>