[Haskell-cafe] Serialization of (a -> b) and IO a
andrewcoppin at btinternet.com
Fri Nov 12 15:44:02 EST 2010
On 11/11/2010 08:07 PM, C. McCann wrote:
> Having a full serialization function without some restriction along
> those lines would be like renaming unsafePerformIO to runIO, moving it
> to Control.Monad.IO, and telling people "hey, just don't misuse this
> and everything will be okay".
There's been a lot of talk about "if serialisation existed, you could do
X, which is bad". Well you know what? unsafePerformIO exists.
unsafeCoerce exists. And using FFI, you can do utterly evil things. And...?
Just today I was thinking about how useful it would be if you could send
a block of code from one PC to another to execute it remotely. The fact
that you can't do this is basically why there's no distributed Haskell
yet, despite what an obviously good idea that would be. It would be
really cool if we could do this.
And yes, it should of course be an IO operation. Because, let's face it,
any result it produces is inherantly going to be pretty random. (Much
like my favourite GHC function name, reallyUnsafePtrEquity#...)
More information about the Haskell-Cafe