[Haskell-cafe] A curios monad

Luke Palmer lrpalmer at gmail.com
Thu Dec 11 18:33:50 EST 2008

On Thu, Dec 11, 2008 at 2:05 PM, Andrew Coppin
<andrewcoppin at btinternet.com>wrote:

> Tillmann Rendel wrote:
>> Andrew Coppin wrote:
>>> Except that, AFAIK, ST doesn't provide the "hey you can store anything
>>> and retrieve it later" trick. ;-)
>> I would say that Data.STRef does exactly that.
> That's true - but you can't transport those from place to play. (By
> design.)

If you could guarantee that the ID of a key is globally unique, even through
different invocations of the monad (using eg. unsafePerformIO newUnique),
then you could ensure type safety and allow transport of keys between
different monads.

However, if you did this, then your library would not be referentially
transparent.  Can you see how?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081211/40e599d9/attachment.htm

More information about the Haskell-Cafe mailing list