[project @ 2000-04-10 16:02:58 by simonpj]
[ghc-hetmet.git] / ghc / lib / std / PrelAddr.lhs
index 70f4a7c..8a0ba32 100644 (file)
@@ -5,7 +5,7 @@
 \section[PrelAddr]{Module @PrelAddr@}
 
 \begin{code}
-{-# OPTIONS -fno-implicit-prelude #-}
+{-# OPTIONS -fcompiling-prelude -fno-implicit-prelude #-}
 
 module PrelAddr (
          Addr(..)
@@ -15,6 +15,7 @@ module PrelAddr (
 
        , Word(..)
        , wordToInt
+       , intToWord
 
        , Word64(..)
        , Int64(..)
@@ -22,7 +23,8 @@ module PrelAddr (
 
 import PrelGHC
 import PrelBase
-import PrelCCall
+
+infixl 5 `plusAddr`
 \end{code}
 
 \begin{code}
@@ -44,6 +46,9 @@ instance CReturnable Word
 wordToInt :: Word -> Int
 wordToInt (W# w#) = I# (word2Int# w#)
 
+intToWord :: Int -> Word
+intToWord (I# i#) = W# (int2Word# i#)
+
 #if WORD_SIZE_IN_BYTES == 8
 data Word64 = W64# Word#
 data Int64  = I64# Int#