briqueabraque: > Hi, > > I need to edit big text files (5 to 500 Mb). But I just need to > change one or two small lines, and save it. What is the best way to do > that in Haskell, without creating copies of the whole files? >
I'd think maybe a lazy bytestring would be ok. Something like: import Data.ByteString.Lazy.Char8 B.putStr . B.unlines . B.map edit . B.lines =<< B.getContents in the darcs version of Data.ByteString, here, http://www.cse.unsw.edu.au/~dons/fps.html Let me know how you go, it would make a good benchmark. -- Don _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe