[Haskell-cafe] Re: persist and retrieve of IO type?

Daryoush Mehrtash dmehrtash at gmail.com
Sat Apr 10 13:32:01 EDT 2010


Can you please explain this:

....the parameters baked into the  thunk may be infinite....
>


daryoush


On Sat, Apr 10, 2010 at 6:27 AM, Svein Ove Aas <svein.ove at aas.no> wrote:

> On Sat, Apr 10, 2010 at 11:19 AM, Jon Fairbairn
> <jon.fairbairn at cl.cam.ac.uk> wrote:
> > It sounds more like he wants two functions something like
> >
> > save:: FilePath -> [IO ()] -> IO ()
> > restore:: FilePath -> IO [IO ()]
> >
> > to which the answer would be no.
> >
> It's an insoluble problem in general - the parameters baked into the
> thunk may be infinite, or at least too large to persist, and the
> functions may not be around if you try to load the persisted data into
> a different version of the executable - but it's an interesting
> problem to attempt solving.
>
> Given that GHC 6.12 has added some of the base functionality required
> (i.e. dynamic linking), I was planning to take a bash at it
> (persisting functions in general, not just IO actions) in the summer.
>
> I don't know if that would help you, though. It's certainly not a good
> idea in general, and at any rate there's a good chance I won't
> succeed.
>
> (Of course, thunks aren't /actually/ infinite, in memory. Part of the
> project would be an attempt to persist the thunks, allowing lazy
> evaluation after reading them back in. Naturally this would only work
> with the exact same executable, but that's not necessarily a problem.)
>
> --
> Svein Ove Aas
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100410/1128bae2/attachment.html


More information about the Haskell-Cafe mailing list