
12 Sep
2013
12 Sep
'13
9:21 a.m.
Hello all, Something's always bothered me about map and zipWith for ByteString. Why is it map :: (Word8 -> Word8) -> ByteString -> ByteString but zipWith :: (Word8 -> Word8 -> a) -> ByteString -> ByteString -> [a] ? Obviously they can be transformed into each other with pack/unpack, and as I understand it, the compiler performs sufficient optimizations so that there's no performance hit to doing things like (pack $ zipWith xor a b), but it still seems inconsistent. Is there a deep reason for this? -- Scott Lawrence Linux baidar 3.10.9-1-ARCH #1 SMP PREEMPT Wed Aug 21 13:49:35 CEST 2013 x86_64 GNU/Linux