I encountered the following code :<br><br>-- B == Data.ByteString ; L == Data.ByteString.Lazy<br>contents' = B.intercalate B.empty $ L.toChunks contents<br><br>with a previously unencountered function intercalate. A quick google query later i knew that it's just intersperse & concat nicely bundled and started wondering why anybody would do this, as simple <br>
<br>contents' = B.concat $ L.toChunks contents<br><br>would do (probably nearly) the same. The only thing I am able to come up with is that it somehow helps streamline the memory usage (if it has some meaning).<br><br>
Is there some reason to use intercalate <empty> <list> instead of concat <list> (probably when dealing with non-lazy bytestrings) ?<br><br>Thx, wman.<br>