25 Apr
2007
25 Apr
'07
9:22 a.m.
Wouter Swierstra wrote:
Test.IOSpec Version 1.0
Shouldn't that be 0.1?
* Test.IOSpec.Teletype: a specification of getChar and putChar.
You use Dynamic for the data type in IORefs, this has the unfortunate consequence of needing Typeable constraints. You could try to use unsafeCoerce instead,
type Data = () unsafeToData :: a -> Data unsafeToData = unsafeCoerce unsafeFromData :: Data -> a unsafeFromData = unsafeCoerce
I think this should be just as safe as Dynamic, since internally Dynamic uses unsafeCoerce as well. Just steal the details from there. Twan