I want to read from stdin with #haskell and I want to use Data.Text.IO (getLine)
How do I process each line and then detect when to stop?
Can I use System.IO (isEOF) as I would when reading String via System.IO (getLine) ?
How about `lines <$> getContents`?
@dpwiz will that be lazy and allow me to process line by line to minimize memory?Each line of input has one chunk I can process.
Also, I don't have a notification for this reply, only noticed it accidentally. I wonder why?
@shapr It will be demand-driven. Whenever the next line is required for processing it will read it from a buffer, block until there's input, or stop.
It shouldn't retain previous lines unless you keep references to them somewhere.
QOTO: Question Others to Teach Ourselves An inclusive, Academic Freedom, instance All cultures welcome. Hate speech and harassment strictly forbidden.