On Thu, Dec 11, 2008 at 2:05 PM, Andrew Coppin
<[email protected]>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?

Luke
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to