Dealing with large files in Haskell

前端 未结 3 2123
别跟我提以往
别跟我提以往 2021-02-14 09:33

I have a large file (4+ gigs) of, lets just say, 4 byte floats. I would like to treat it as List, in the sense that I would like to be able to use map, filter, foldl, etc. Howev

3条回答
  •  灰色年华
    2021-02-14 10:12

    This should be quite helpful to you. You can use readFile and writeFile for what you need to do, and everything is done lazily. It only keeps things in memory while they are still being used, so you can read, process, and write the file out without blowing up your computer.

提交回复
热议问题