
18 Sep
2009
18 Sep
'09
4:36 p.m.
Hello I run into problems with new binary package. Following function reads a list of elements one by one until end of stream. List is very long (won't fit into memory). In binary-0.5.0.1 and earlier it read list lazily. Now it seems that it tries to read whole list to memory. Program does not produce any output and memory usage steadily grows.
getStream :: Get a -> Get [a] getStream getter = do empty <- isEmpty if empty then return [] else do x <- getter xs <- getStream getter return (x:xs)
How could I add laziness to this function to revert to old behavior. -- Khudyakov Alexey