
28 Aug
2012
28 Aug
'12
4:43 p.m.
On Tue, 2012-04-03 at 21:48 +0700, Mikhail Vorozhtsov wrote:
On 04/03/2012 08:50 PM, Simon Meier wrote:
2012/4/3 Duncan Coutts
: [snip] @mikkhail: Note that at least the runtime for Data.ByteString.Lazy.Char8 is wrong. It should be O(n/c) instead of O(1). Fixed.
Ok, I've applied this but with a simpler implementation of unsnoc for lazy bytestrings. The proposed implementation tries to work using a single traversal of the list of chunks, but it doesn't actually achieve this since it builds a chain of closures that's equivalent to the list of chunks. Doing it by accumulating and reversing would be equivalent. Given that we cannot actually avoid making two traversals I've gone for the simplest implementation: just call init and last. Duncan