
2009/11/04 Philippos Apolinarius
Let me see whether I understoodnd you correctly... If I read the contents of a file, the string will may be lazy (or something like that) and not consume memory?
A `String` or a lazy `ByteString` will be lazy and consume minimal memory. You can parse lazy `ByteString`s with AttoParsec. To the best of my knowledge, the most patched up and version of that parser is here: http://hackage.haskell.org/package/bytestringparser-temporary/ It is really in your best interest to parse with `ByteString`s instead of `String`s. Disclosure of conflict of interest: The package I mention is my own fork of Bryan O'Sullivan's AttoParsec (which is a little broken in places).
In fewer words, will the string behave like the infinite list of random numbers that I have used in the examples I posted?
In so far as it is lazy, yes. Lazy IO. A terrible idea, except when it's a good idea. -- Jason Dusek