diff --git a/hledger-lib/Hledger/Utils/Debug.hs b/hledger-lib/Hledger/Utils/Debug.hs index 44da1864e..d9a3ff3d1 100644 --- a/hledger-lib/Hledger/Utils/Debug.hs +++ b/hledger-lib/Hledger/Utils/Debug.hs @@ -171,8 +171,6 @@ progName = -- unsafePerformIO and can be accessed from anywhere and before normal -- command-line processing. When running with :main in GHCI, you must -- touch and reload this module to see the effect of a new --debug option. --- {-# OPTIONS_GHC -fno-cse #-} -{-# NOINLINE debugLevel #-} debugLevel :: Int debugLevel = case dropWhile (/="--debug") progArgs of ["--debug"] -> 1 @@ -247,7 +245,6 @@ debugLogFile = progName ++ ".log" -- | Log a string to the debug log before returning the second argument. -- Uses unsafePerformIO. -{-# NOINLINE traceLog #-} traceLog :: String -> a -> a traceLog s x = unsafePerformIO $ do evaluate (force s) -- to complete any previous logging before we attempt more @@ -360,7 +357,6 @@ dbg9 :: Show a => String -> a -> a dbg9 = ptraceOrLogAt 9 -- | Like dbg0, but also exit the program. Uses unsafePerformIO. -{-# NOINLINE dbgExit #-} dbgExit :: Show a => String -> a -> a dbgExit label a = unsafePerformIO $ dbg0IO label a >> exitFailure diff --git a/hledger-lib/Hledger/Utils/Print.hs b/hledger-lib/Hledger/Utils/Print.hs index 0301daa97..f5c46d692 100644 --- a/hledger-lib/Hledger/Utils/Print.hs +++ b/hledger-lib/Hledger/Utils/Print.hs @@ -110,22 +110,15 @@ colorOption = -- and a NO_COLOR environment variable is not defined -- and stdout supports ANSI color and -o/--output-file was not used or is "-" -- ). --- {-# OPTIONS_GHC -fno-cse #-} --- {-# NOINLINE useColorOnStdout #-} useColorOnStdout :: Bool useColorOnStdout = not hasOutputFile && useColorOnHandle stdout -- Avoid using dbg*, pshow etc. in this function (infinite loop). -- | Like useColorOnStdout, but checks for ANSI color support on stderr, -- and is not affected by -o/--output-file. --- {-# OPTIONS_GHC -fno-cse #-} --- {-# NOINLINE useColorOnStdout #-} useColorOnStderr :: Bool useColorOnStderr = useColorOnHandle stderr --- sorry, I'm just cargo-culting these pragmas: --- {-# OPTIONS_GHC -fno-cse #-} --- {-# NOINLINE useColorOnHandle #-} useColorOnHandle :: Handle -> Bool useColorOnHandle h = unsafePerformIO $ do no_color <- isJust <$> lookupEnv "NO_COLOR" @@ -157,8 +150,6 @@ outputFileOption = -- | Check whether the -o/--output-file option has been used at program startup -- with an argument other than "-", using unsafePerformIO. --- {-# OPTIONS_GHC -fno-cse #-} --- {-# NOINLINE hasOutputFile #-} hasOutputFile :: Bool hasOutputFile = outputFileOption `notElem` [Nothing, Just "-"]