[Haskell-cafe] Dynamic types through unsafeCoerce

Alfonso Acosta alfonso.acosta at gmail.com
Tue Dec 12 13:11:19 EST 2006


On 12/10/06, Lemmih <lemmih at gmail.com> 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.


More information about the Haskell-Cafe mailing list