streaming-bytestring
streaming-bytestring copied to clipboard
Does 'lines' work on Windows?
I was reading the code of lines in connection to #3 and noticed that it only cares about \ns.
I call lines on the result of getContents, which requires binary mode. That in turn means that the automatic newline conversion won't be happening.
So, if I'm reading this right, the code will not work correctly on Windows, will it?
FYI, I started working on this in my fork (as you can see above).
I'll let you know once I finish.
Sorry, I'm just getting to these. I was trying in these modules to replicate Data.ByteString.Lazy(.Char8) as much as possible. In bytestring, no account is taken of line endings other than \n it seems. http://hackage.haskell.org/package/bytestring-0.10.6.0/docs/src/Data.ByteString.Lazy.Char8.html#lines
Yes, I also noticed that. But I don't think we should regard that as a standard; see e.g. this stackoverflow discussion.
Another question is whether unlines should be changed, too... While the conversion in lines hardly has any downsides, it's much trickier with unlines.