[Haskell-cafe] A curios monad
andrewcoppin at btinternet.com
Thu Dec 11 14:06:33 EST 2008
Alberto G. Corona wrote:
> it is safe to use unsafeCoherce in your context? I mean, I think you
> need to use instances of Data.Typeable (or some with the same
> functionality) to make it safe. Like in Data.Dynamic...
The *only* way for you to generate a Key value is to use the function I
provide - which conviniently tags it with the type of value it's
supposed to retreive. That means the type cast is guaranteed to cast it
back to the type it was in the first place.
...unless you can muddle keys from other state threads up. In that case,
all bets are off.
I looked at using Data.Dynamic, but that only works for a few types. I
wanted something that will work for *any* type.
More information about the Haskell-Cafe