diff options
Diffstat (limited to 'compiler/GHC/Utils/Misc.hs')
-rw-r--r-- | compiler/GHC/Utils/Misc.hs | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/compiler/GHC/Utils/Misc.hs b/compiler/GHC/Utils/Misc.hs index 67d3f11c67..5629b339b9 100644 --- a/compiler/GHC/Utils/Misc.hs +++ b/compiler/GHC/Utils/Misc.hs @@ -13,10 +13,6 @@ -- | Highly random utility functions -- module GHC.Utils.Misc ( - -- * Flags dependent on the compiler build - ghciSupported, debugIsOn, - isWindowsHost, isDarwinHost, - -- * Miscellaneous higher-order functions applyWhen, nTimes, @@ -137,6 +133,7 @@ import GHC.Prelude import GHC.Utils.Exception import GHC.Utils.Panic.Plain +import GHC.Utils.Constants import Data.Data import qualified Data.List as List @@ -170,50 +167,6 @@ import {-# SOURCE #-} GHC.Driver.Ppr ( warnPprTrace ) infixr 9 `thenCmp` -{- -************************************************************************ -* * -\subsection{Is DEBUG on, are we on Windows, etc?} -* * -************************************************************************ - -These booleans are global constants, set by CPP flags. They allow us to -recompile a single module (this one) to change whether or not debug output -appears. They sometimes let us avoid even running CPP elsewhere. - -It's important that the flags are literal constants (True/False). Then, -with -0, tests of the flags in other modules will simplify to the correct -branch of the conditional, thereby dropping debug code altogether when -the flags are off. --} - -ghciSupported :: Bool -#if defined(HAVE_INTERNAL_INTERPRETER) -ghciSupported = True -#else -ghciSupported = False -#endif - -debugIsOn :: Bool -#if defined(DEBUG) -debugIsOn = True -#else -debugIsOn = False -#endif - -isWindowsHost :: Bool -#if defined(mingw32_HOST_OS) -isWindowsHost = True -#else -isWindowsHost = False -#endif - -isDarwinHost :: Bool -#if defined(darwin_HOST_OS) -isDarwinHost = True -#else -isDarwinHost = False -#endif {- ************************************************************************ @@ -679,7 +632,7 @@ isSortedBy cmp = sorted -} minWith :: Ord b => (a -> b) -> [a] -> a -minWith get_key xs = ASSERT( not (null xs) ) +minWith get_key xs = assert (not (null xs) ) head (sortWith get_key xs) nubSort :: Ord a => [a] -> [a] |