[Haskell-cafe] Safely reading RemoteRefs?

amindfv at gmail.com amindfv at gmail.com
Fri Jul 14 20:29:23 UTC 2017

I notice I'm able to retrieve haskell variables after a :r in ghci:

:m + Data.Binary
:m + GHCi.RemoteTypes

> encodeFile "/tmp/foo" =<< mkRemoteRef "hello!"


> putStrLn =<< localRef =<< decodeFile "/tmp/foo"


Is this safe? It works correctly in the common case but are there things I need to be careful of?

In the string case it's not too interesting but it would be great to e.g. retrieve the pid of a running process.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170714/6951947e/attachment.html>

More information about the Haskell-Cafe mailing list