summaryrefslogtreecommitdiff
path: root/compiler/GHC/Utils/IO/Unsafe.hs
blob: 4adf71bd11eb815949faa3a75dda6e09318c1060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-
(c) The University of Glasgow, 2000-2006
-}

{-# LANGUAGE MagicHash, UnboxedTuples #-}

module GHC.Utils.IO.Unsafe
   ( inlinePerformIO,
   )
where

import GHC.Prelude ()

import GHC.Exts
import GHC.IO   (IO(..))

-- Just like unsafeDupablePerformIO, but we inline it.
{-# INLINE inlinePerformIO #-}
inlinePerformIO :: IO a -> a
inlinePerformIO (IO m) = case m realWorld# of (# _, r #)   -> r