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

Detect silly error with S.lines on a stream that is already lines. #9

Open
rrnewton opened this issue Apr 2, 2013 · 1 comment
Open

Comments

@rrnewton
Copy link

rrnewton commented Apr 2, 2013

Ok, I confess, I committed this silly error. No stream output ever emerges because it keeps accumulating an infinitely long line.

It might help to have a version of "lines" that at least throws an error if the line size gets over a certain length (or split after that length). Or perhaps there is some better way to help debug this silliness... I guess I kind of want a newtype for InputStream ByteStrings that represent lines (implicit newline) vs. those that don't.

@gregorycollins
Copy link
Member

I am also not especially comfortable with the fact that there are functions like lines that can collect an unbounded amount of input. Probably lines should call lines' :: Int -> InputStream ByteString -> IO (InputStream ByteString) which stipulates a maximum line length.

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