1 -----------------------------------------------------------------------------
3 -- Module : Unsafe.Coerce
4 -- Copyright : Malcolm Wallace 2006
5 -- License : BSD-style (see the LICENSE file in the distribution)
7 -- Maintainer : libraries@haskell.org
8 -- Stability : experimental
9 -- Portability : portable
11 -- The highly unsafe primitive 'unsafeCoerce' converts a value from any
12 -- type to any other type. Needless to say, if you use this function,
13 -- it is your responsibility to ensure that the old and new types have
14 -- identical internal representations, in order to prevent runtime corruption.
16 module Unsafe.Coerce (unsafeCoerce) where
18 #if defined(__GLASGOW_HASKELL__)
19 import GHC.Base (unsafeCoerce#)
20 unsafeCoerce :: a -> b
21 unsafeCoerce = unsafeCoerce#
25 import NonStdUnsafeCoerce (unsafeCoerce)
29 import Hugs.Base (unsafeCoerce)