[Haskell-cafe] Dynamic types through unsafeCoerce

Alfonso Acosta alfonso.acosta at gmail.com
Sat Dec 9 17:29:02 EST 2006

On 12/9/06, Udo Stenzel <u.stenzel at web.de> wrote:
> 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.

I'm using StablePtrs already, what made you assume I wasn't using them?

> > would the use of unsafeCoerce be dangerous?
> If you have to ask, then yes.

The name of the function makes it clear, it is unsafe, but it is still
used in many cases. I just wanted to know if it was dangerous is this
concrete example.

Taral gave a good reason
> -Udo
> --
> "Never confuse motion with action." -- Ernest Hemingway
> Version: GnuPG v1.4.1 (GNU/Linux)
> GiVZSrY28i5FJUs+V1g1I34=
> =MSt3
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list