summaryrefslogtreecommitdiff
path: root/ghc/compiler/HsVersions.h
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-04-29 14:04:11 +0000
committersimonmar <unknown>2002-04-29 14:04:11 +0000
commitb085ee40c7f265a5977ea6ec1c415e573be5ff8c (patch)
treeab849b59a7eb6a57bc89559706cd71256b5898e4 /ghc/compiler/HsVersions.h
parentf6124b6ca2ec9820f7eb454dbcffbf4b8b790d4f (diff)
downloadhaskell-b085ee40c7f265a5977ea6ec1c415e573be5ff8c.tar.gz
[project @ 2002-04-29 14:03:38 by simonmar]
FastString cleanup, stage 1. The FastString type is no longer a mixture of hashed strings and literal strings, it contains hashed strings only with O(1) comparison (except for UnicodeStr, but that will also go away in due course). To create a literal instance of FastString, use FSLIT(".."). By far the most common use of the old literal version of FastString was in the pattern ptext SLIT("...") this combination still works, although it doesn't go via FastString any more. The next stage will be to remove the need to use this special combination at all, using a RULE. To convert a FastString into an SDoc, now use 'ftext' instead of 'ptext'. I've also removed all the FAST_STRING related macros from HsVersions.h except for SLIT and FSLIT, just use the relevant functions from FastString instead.
Diffstat (limited to 'ghc/compiler/HsVersions.h')
-rw-r--r--ghc/compiler/HsVersions.h37
1 files changed, 3 insertions, 34 deletions
diff --git a/ghc/compiler/HsVersions.h b/ghc/compiler/HsVersions.h
index 4900e5663a..40a58517b4 100644
--- a/ghc/compiler/HsVersions.h
+++ b/ghc/compiler/HsVersions.h
@@ -37,8 +37,6 @@ name = Util.global (value) :: IORef (ty); \
#define UASSERT2(e,msg)
#endif
-#if __GLASGOW_HASKELL__ >= 23
-
-- This #ifndef lets us switch off the "import FastString"
-- when compiling FastString itself
#ifndef COMPILING_FAST_STRING
@@ -46,36 +44,7 @@ name = Util.global (value) :: IORef (ty); \
import qualified FastString
#endif
-# define USE_FAST_STRINGS 1
-# define FAST_STRING FastString.FastString
-# define SLIT(x) (FastString.mkFastCharString# (x#))
-# define FSLIT(x) (FastString.mkFastString# (x#))
-# define _NULL_ FastString.nullFastString
-# define _NIL_ (FastString.mkFastString "")
-# define _CONS_ FastString.consFS
-# define _HEAD_ FastString.headFS
-# define _HEAD_INT_ FastString.headIntFS
-# define _TAIL_ FastString.tailFS
-# define _LENGTH_ FastString.lengthFS
-# define _PK_ FastString.mkFastString
-# define _UNPK_ FastString.unpackFS
-# define _UNPK_INT_ FastString.unpackIntFS
-# define _APPEND_ `FastString.appendFS`
-#else
-# error I think that FastString is now always used. If not, fix this.
-# define FAST_STRING String
-# define SLIT(x) (x)
-# define _CMP_STRING_ cmpString
-# define _NULL_ null
-# define _NIL_ ""
-# define _CONS_ (:)
-# define _HEAD_ head
-# define _TAIL_ tail
-# define _LENGTH_ length
-# define _PK_ (\x->x)
-# define _UNPK_ (\x->x)
-# define _SUBSTR_ substr{-from Utils-}
-# define _APPEND_ ++
-#endif
+#define SLIT(x) (FastString.mkLitString# (x#))
+#define FSLIT(x) (FastString.mkFastString# (x#))
-#endif
+#endif // HSVERSIONS_H