[Haskell-cafe] Efficient temporary file storage??

Felipe Almeida Lessa felipe.lessa at gmail.com
Tue Jan 24 00:43:05 CET 2012

On Mon, Jan 23, 2012 at 9:37 PM, Nick Rudnick
<nick.rudnick at googlemail.com> wrote:
> if you want to temporarily store haskell data in a file – do you have a
> special way to get it done efficiently?
> In an offline, standalone app, I am continuously reusing data volumes of
> about 200MB, representing Map like tables of a rather simple structure,
> key: (Int,Int,Int)
> value: [((Int,Int),LinkId)]
> which take quite a good deal of time to produce.
> Is there a recommendation about how to 'park' such data tables most
> efficiently in files – any format acceptable, quick loading time is the most
> desirable thing.

Use cereal [1], usually it's fast and easy enough.  If you need to be
able to access your files for a long time, consider using safecopy [2]
(which internally uses cereal as well).

[1] http://hackage.haskell.org/package/cereal
[2] http://hackage.haskell.org/package/safecopy



More information about the Haskell-Cafe mailing list