On Tue, Feb 06, 2007 at 04:58:28PM +0100, Alfonso Acosta wrote:
Hi all,
Reading the sources of Lava (a Haskell Hardware Description DSL) I run
into this definition ...
unsafeCoerce :: a - b
unsafeCoerce a = unsafePerformIO $
do writeIORef ref a
readIORef ref
where
ref =
Hi all,
Reading the sources of Lava (a Haskell Hardware Description DSL) I run
into this definition ...
unsafeCoerce :: a - b
unsafeCoerce a = unsafePerformIO $
do writeIORef ref a
readIORef ref
where
ref = unsafePerformIO $
do newIORef undefined
Is this actually equivalent to the
Hi Alfonso,
Reading the sources of Lava (a Haskell Hardware Description DSL) I run
into this definition ...
unsafeCoerce :: a - b
Is this actually equivalent to the infamous unsafeCoerce# ?
Yes, see the comment in the haddock documentation for unsafePerformIO: