[Haskell-cafe] Serialization of (a -> b) and IO a

C. McCann cam at uptoisomorphism.net
Thu Nov 11 16:23:27 EST 2010

On Thu, Nov 11, 2010 at 3:30 PM, Stephen Tetley
<stephen.tetley at gmail.com> wrote:
> The conclusion notes in passing that OCaml's persistence isn't
> referentially transparent. If the Haskell version wasn't, I'd expect a
> mea culpa from the authors at this point.

>From a quick glance at the paper, the Haskell version is referentially
transparent in the standard, trivial sense: the persistence operations
all return IO actions. This is of course perfectly fine. What started
this thread, however, was the idea of a serialization function
producing something like a pure ByteString, and why that, as opposed
to (IO ByteString), would be extremely problematic.

What it boils down to is just that any pure "serialization" function
would necessarily do nothing useful. Serializing closures from IO
actions, on the other hand, I think is a great idea, though probably
difficult to implement!

- C.

More information about the Haskell-Cafe mailing list