
18 Sep
2007
18 Sep
'07
3:23 p.m.
haskell@list.mightyreason.com wrote:
Users may very well need the offsets, though. That means one needs to call some "length" function to get the offsets.
'length' of a ByteString is extremely cheap.
This requires forcing the whole input string to get the length of the second found location.
I don't see why it should force the whole input: only as much as is needed to find the desired substring. There is no need to call 'length' on the tail, since it doesn't yield any interesting information. Regards, Malcolm