summaryrefslogtreecommitdiff
path: root/compiler/utils/FastFunctions.lhs
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2014-12-03 12:44:03 -0600
committerAustin Seipp <austin@well-typed.com>2014-12-03 12:44:03 -0600
commit0c48e172836d6a1e281aed63e42d60063700e6d8 (patch)
tree89fe135e31e86dc579aba5652738f14c256a284d /compiler/utils/FastFunctions.lhs
parentb04296d3a3a256067787241a7727877e35e5af03 (diff)
downloadhaskell-0c48e172836d6a1e281aed63e42d60063700e6d8.tar.gz
compiler: de-lhs utils/
Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/utils/FastFunctions.lhs')
-rw-r--r--compiler/utils/FastFunctions.lhs47
1 files changed, 0 insertions, 47 deletions
diff --git a/compiler/utils/FastFunctions.lhs b/compiler/utils/FastFunctions.lhs
deleted file mode 100644
index 854bd13b11..0000000000
--- a/compiler/utils/FastFunctions.lhs
+++ /dev/null
@@ -1,47 +0,0 @@
-Z%
-% (c) The University of Glasgow, 2000-2006
-%
-\section{Fast functions}
-
-\begin{code}
-{-# LANGUAGE CPP, MagicHash, UnboxedTuples #-}
-
-module FastFunctions (
- unsafeChr, inlinePerformIO, unsafeDupableInterleaveIO,
- indexWord8OffFastPtr,
- indexWord8OffFastPtrAsFastChar, indexWord8OffFastPtrAsFastInt,
- global, Global
- ) where
-
-#include "HsVersions.h"
-
-import FastTypes
-import Data.IORef
-import System.IO.Unsafe
-
-import GHC.Exts
-import GHC.Word
-import GHC.Base (unsafeChr)
-
-import GHC.IO (IO(..), unsafeDupableInterleaveIO)
-
--- Just like unsafePerformIO, but we inline it.
-{-# INLINE inlinePerformIO #-}
-inlinePerformIO :: IO a -> a
-inlinePerformIO (IO m) = case m realWorld# of (# _, r #) -> r
-
-indexWord8OffFastPtr p i = W8# (indexWord8OffAddr# p i)
-indexWord8OffFastPtrAsFastChar p i = indexCharOffAddr# p i
-indexWord8OffFastPtrAsFastInt p i = word2Int# (indexWord8OffAddr# p i)
--- or ord# (indexCharOffAddr# p i)
-
---just so we can refer to the type clearly in a macro
-type Global a = IORef a
-global :: a -> Global a
-global a = unsafePerformIO (newIORef a)
-
-indexWord8OffFastPtr :: FastPtr Word8 -> FastInt -> Word8
-indexWord8OffFastPtrAsFastChar :: FastPtr Word8 -> FastInt -> FastChar
-indexWord8OffFastPtrAsFastInt :: FastPtr Word8 -> FastInt -> FastInt
-
-\end{code}