1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
module System.Unsafe where
-- taken from share/doc/ghc/html/libraries/base-4.5.1.0/doc-index-U.html
import System.IO.Unsafe (unsafePerformIO, unsafeInterleaveIO, )
import Control.Monad.ST.Unsafe (unsafeInterleaveST, unsafeIOToST, unsafeSTToIO, )
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr, )
import Unsafe.Coerce (unsafeCoerce, )
import Control.Monad.ST (ST, )
import Foreign.ForeignPtr (ForeignPtr, )
import Foreign.Ptr (Ptr, )
performIO :: IO a -> a
performIO = unsafePerformIO
interleaveIO :: IO a -> IO a
interleaveIO = unsafeInterleaveIO
interleaveST :: ST s a -> ST s a
interleaveST = unsafeInterleaveST
ioToST :: IO a -> ST s a
ioToST = unsafeIOToST
stToIO :: ST s a -> IO a
stToIO = unsafeSTToIO
foreignPtrToPtr :: ForeignPtr a -> Ptr a
foreignPtrToPtr = unsafeForeignPtrToPtr
coerce :: a -> b
coerce = unsafeCoerce
|