FastFunctions.hs 419 Bytes
Newer Older
Austin Seipp's avatar
Austin Seipp committed
1
2
3
{-
(c) The University of Glasgow, 2000-2006
-}
4

5
{-# LANGUAGE CPP, MagicHash, UnboxedTuples #-}
6
7

module FastFunctions (
8
    inlinePerformIO,
9
10
11
12
  ) where

#include "HsVersions.h"

13
14
import GhcPrelude ()

15
import GHC.Exts
16
import GHC.IO   (IO(..))
17

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