Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does 'lines' work on Windows? #4

Open
UnkindPartition opened this issue Sep 22, 2016 · 3 comments
Open

Does 'lines' work on Windows? #4

UnkindPartition opened this issue Sep 22, 2016 · 3 comments

Comments

@UnkindPartition
Copy link
Contributor

UnkindPartition commented Sep 22, 2016

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?

@UnkindPartition
Copy link
Contributor Author

FYI, I started working on this in my fork (as you can see above).

I'll let you know once I finish.

@michaelt
Copy link
Owner

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

@UnkindPartition
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants