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