
12 Dec
2006
12 Dec
'06
1:55 p.m.
On 12/12/06, Alfonso Acosta
On 12/10/06, Lemmih
wrote: How about using a StablePtr to a Dynamic?
Uhm, that's a good idea cause no Typeable context will then be required and thus the function can be exported by the FFI.
On the other hand, using Data.Dynamic requires any type to be an instance of Typeable. And thus requires the user to make such instantiation (which is a pain)
GHC supports the "deriving" clause for the Typeable class, but it's not standard Haskell98 (and as far as I know, for example hugs doesn't support it)
So it would be great to be able to use unsafeCoerce.
Ah, you want type-safe casts without using Typeable? Good luck, you'll need it. -- Cheers, Lemmih