diff options
author | simonmar <unknown> | 2002-08-29 15:44:23 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-08-29 15:44:23 +0000 |
commit | ce9687a5f450014c5596b32de8e8a7b99b6389e8 (patch) | |
tree | 718993a94d5e2b03bae392f4b3b4710814c3c4d8 /ghc/compiler/utils/Pretty.lhs | |
parent | 4a851c8281491a26ce130e6ce4496042e3feb42b (diff) | |
download | haskell-ce9687a5f450014c5596b32de8e8a7b99b6389e8.tar.gz |
[project @ 2002-08-29 15:44:11 by simonmar]
Housekeeping:
- The main goal is to remove dependencies on hslibs for a
bootstrapped compiler, leaving only a requirement that the
packages base, haskell98 and readline are built in stage 1 in
order to bootstrap. We're almost there: Posix is still required
for signal handling, but all other dependencies on hslibs are now
gone.
Uses of Addr and ByteArray/MutableByteArray array are all gone
from the compiler. PrimPacked defines the Ptr type for GHC 4.08
(which didn't have it), and it defines simple BA and MBA types to
replace uses of ByteArray and MutableByteArray respectively.
- Clean up import lists. HsVersions.h now defines macros for some
modules which have moved between GHC versions. eg. one now
imports 'GLAEXTS' to get at unboxed types and primops in the
compiler.
Many import lists have been sorted as per the recommendations in
the new style guidelines in the commentary.
I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and
itself, and everything still works here. Doubtless I've got something
wrong, though.
Diffstat (limited to 'ghc/compiler/utils/Pretty.lhs')
-rw-r--r-- | ghc/compiler/utils/Pretty.lhs | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/ghc/compiler/utils/Pretty.lhs b/ghc/compiler/utils/Pretty.lhs index bf7f10b31f..6a1c07ffc3 100644 --- a/ghc/compiler/utils/Pretty.lhs +++ b/ghc/compiler/utils/Pretty.lhs @@ -178,9 +178,11 @@ module Pretty ( #include "HsVersions.h" import FastString -import GlaExts -import Numeric (fromRat) import PrimPacked ( strLength ) + +import GLAEXTS + +import Numeric (fromRat) import IO #if __GLASGOW_HASKELL__ < 503 @@ -195,16 +197,7 @@ import PrelBase ( unpackCString# ) import GHC.Base ( unpackCString# ) #endif -#if __GLASGOW_HASKELL__ < 411 -import PrelAddr ( Addr(..) ) -#else -import Addr ( Addr(..) ) -#if __GLASGOW_HASKELL__ < 503 -import Ptr ( Ptr(..) ) -#else -import GHC.Ptr ( Ptr(..) ) -#endif -#endif +import PrimPacked ( Ptr(..) ) -- Don't import Util( assertPanic ) because it makes a loop in the module structure @@ -608,12 +601,12 @@ isEmpty _ = False char c = textBeside_ (Chr c) 1# Empty text s = case length s of {IBOX(sl) -> textBeside_ (Str s) sl Empty} ftext s = case lengthFS s of {IBOX(sl) -> textBeside_ (PStr s) sl Empty} -ptext (A# s) = case strLength (A# s) of {IBOX(sl) -> textBeside_ (LStr s sl) sl Empty} +ptext (Ptr s) = case strLength (Ptr s) of {IBOX(sl) -> textBeside_ (LStr s sl) sl Empty} -- RULE that turns (text "abc") into (ptext (A# "abc"#)) to avoid the -- intermediate packing/unpacking of the string. {-# RULES - "text/str" forall a. text (unpackCString# a) = ptext (A# a) + "text/str" forall a. text (unpackCString# a) = ptext (Ptr a) #-} nest IBOX(k) p = mkNest k (reduceDoc p) -- Externally callable version |