Safe Haskell | None |
---|---|
Language | Haskell2010 |
Debugging helpers
- strace :: Show a => a -> a
- ltrace :: Show a => String -> a -> a
- mtrace :: (Monad m, Show a) => a -> m a
- traceWith :: (a -> String) -> a -> a
- ptrace :: Stream [Char] m t => String -> ParsecT [Char] st m ()
- debugLevel :: Int
- dbg :: Show a => String -> a -> a
- dbg0 :: Show a => String -> a -> a
- dbg1 :: Show a => String -> a -> a
- dbg2 :: Show a => String -> a -> a
- dbg3 :: Show a => String -> a -> a
- dbg4 :: Show a => String -> a -> a
- dbg5 :: Show a => String -> a -> a
- dbg6 :: Show a => String -> a -> a
- dbg7 :: Show a => String -> a -> a
- dbg8 :: Show a => String -> a -> a
- dbg9 :: Show a => String -> a -> a
- dbgAt :: Show a => Int -> String -> a -> a
- dbgAtM :: Show a => Int -> String -> a -> IO ()
- dbgAtIO :: Show a => Int -> String -> a -> IO ()
- dbgtrace :: String -> a -> a
- dbgshow :: Show a => Int -> String -> a -> a
- dbgppshow :: Show a => Int -> String -> a -> a
- dbgExit :: Show a => String -> a -> a
- pdbg :: Stream [Char] m t => Int -> String -> ParsecT [Char] st m ()
- module Debug.Trace
- ppShow :: Show a => a -> String
Documentation
strace :: Show a => a -> a Source
Trace (print on stdout at runtime) a showable value. (for easily tracing in the middle of a complex expression)
mtrace :: (Monad m, Show a) => a -> m a Source
Monadic trace - like strace, but works as a standalone line in a monad.
ptrace :: Stream [Char] m t => String -> ParsecT [Char] st m () Source
Parsec trace - show the current parsec position and next input, and the provided label if it's non-null.
debugLevel :: Int Source
Global debug level, which controls the verbosity of debug output
on the console. The default is 0 meaning no debug output. The
--debug
command line flag sets it to 1, or --debug=N
sets it to
a higher value (note: not --debug N
for some reason). This uses
unsafePerformIO and can be accessed from anywhere and before normal
command-line processing. After command-line processing, it is also
available as the debug_
field of CliOpts
.
{--}
{--}
dbg :: Show a => String -> a -> a Source
Print a message and a showable value to the console if the global debug level is non-zero. Uses unsafePerformIO.
dbgAt :: Show a => Int -> String -> a -> a Source
Print a message and a showable value to the console if the global debug level is at or above the specified level. Uses unsafePerformIO.
dbgtrace :: String -> a -> a Source
print this string to the console before evaluating the expression, if the global debug level is non-zero. Uses unsafePerformIO.
dbgshow :: Show a => Int -> String -> a -> a Source
Print a showable value to the console, with a message, if the debug level is at or above the specified level (uses unsafePerformIO). Values are displayed with show, all on one line, which is hard to read.
dbgppshow :: Show a => Int -> String -> a -> a Source
Print a showable value to the console, with a message, if the debug level is at or above the specified level (uses unsafePerformIO). Values are displayed with ppShow, each field/constructor on its own line.
pdbg :: Stream [Char] m t => Int -> String -> ParsecT [Char] st m () Source
Print a message and parsec debug info (parse position and next input) to the console when the debug level is at or above this level. Uses unsafePerformIO. pdbgAt :: GenParser m => Float -> String -> m ()
module Debug.Trace