[Haskell-cafe] Dynamic types through unsafeCoerce

Udo Stenzel u.stenzel at web.de
Sat Dec 9 14:45:37 EST 2006


Alfonso Acosta wrote:
> I've been using Data.Dynamic but the Typeable requirement doesn't go
> well with FFI declarations (which don't accept type contexts).

You wouldn't need a Typeable context anyway; what's biting you is that
Dynamic is not one of the primitive types that can pass across the FFI.
There are good reasons for that and unsafeCoerce certainly cannot
invalidate them.

You want a StablePtr.


> would the use of unsafeCoerce be dangerous?

If you have to ask, then yes.


-Udo
-- 
"Never confuse motion with action." -- Ernest Hemingway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20061209/8434b62e/attachment.bin


More information about the Haskell-Cafe mailing list