On Sun, 13 May 2007, David Roundy wrote: > I was just contemplating hashes, and it occurred to me that it would be > nice to be able to compute the hash of a lazily constructed bytestring and > lazily consume its output without requiring the whole string to ever be in > memory. Or in general, it'd be nice to be able to perform two simultaneous > consumptions of a lazy list without requiring that the entire list be > stored. Another example would be computing the length of an ordinary list: > > do l <- readFile "foo" > let len = length l > writeFile "bar" l > putStrLn $ "Length is " ++ show l
An elegant implementation of 'wc' is another example. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe