[project @ 1999-09-21 08:59:46 by sof]
[ghc-hetmet.git] / ghc / lib / exts / Addr.lhs
index 6d9149d..5e02bf2 100644 (file)
@@ -28,6 +28,7 @@ import PrelAddr
 import PrelForeign
 import PrelStable
 import PrelBase
+import NumExts
 import PrelIOBase ( IO(..) )
 import Word    ( indexWord8OffAddr,  indexWord16OffAddr
                , indexWord32OffAddr, indexWord64OffAddr
@@ -48,6 +49,17 @@ import Int   ( indexInt8OffAddr,  indexInt16OffAddr
 
 \end{code}
 
+\begin{code}
+instance Show Addr where
+   showsPrec p (A# a) = showHex int
+     where
+       int = 
+       case word2Integer# (int2Word# (addr2Int# a)) of
+         (# s, d #) -> J# s d
+
+\end{code}
+
+
 Coercing between machine ints and words
 
 \begin{code}