Get building GHC itself with Cabal more-or-less working
[ghc-hetmet.git] / compiler / utils / Util.lhs
index 62e2eda..7057d32 100644 (file)
@@ -6,7 +6,7 @@
 
 \begin{code}
 module Util (
-        debugIsOn, ghciTablesNextToCode, picIsOn,
+        ghciSupported, debugIsOn, ghciTablesNextToCode, picIsOn,
         isWindowsHost, isWindowsTarget, isDarwinTarget,
 
         -- general list processing
@@ -107,11 +107,18 @@ infixr 9 `thenCmp`
 
 %************************************************************************
 %*                                                                      *
-\subsection{Is DEBUG on, are we on Windows?}
+\subsection{Is DEBUG on, are we on Windows, etc?}
 %*                                                                      *
 %************************************************************************
 
 \begin{code}
+ghciSupported :: Bool
+#ifdef GHCI
+ghciSupported = True
+#else
+ghciSupported = False
+#endif
+
 debugIsOn :: Bool
 #ifdef DEBUG
 debugIsOn = True
@@ -405,16 +412,6 @@ isn'tIn msg x ys
 # endif /* DEBUG */
 \end{code}
 
-foldl1' was added in GHC 6.4
-
-\begin{code}
-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 604
-foldl1'          :: (a -> a -> a) -> [a] -> a
-foldl1' f (x:xs) =  foldl' f x xs
-foldl1' _ []     =  panic "foldl1'"
-#endif
-\end{code}
-
 %************************************************************************
 %*                                                                      *
 \subsubsection[Utils-Carsten-mergesort]{A mergesort from Carsten}