Module Debug

This library contains some useful operation for debugging programs.

Author: Bjoern Peemoeller

Version: September 2014

Summary of exported operations:

trace :: String -> a -> a   
Prints the first argument as a side effect and behaves as identity on the second argument.
traceId :: String -> String   
Prints the first argument as a side effect and returns it afterwards.
traceShow :: Show a => a -> b -> b   
Prints the first argument using show and returns the second argument afterwards.
traceShowId :: Show a => a -> a   
Prints the first argument using show and returns it afterwards.
traceIO :: String -> IO ()   
Output a trace message from the IO monad.
assert :: Bool -> String -> a -> a   
Assert a condition w.r.t.
assertIO :: Bool -> String -> IO ()   
Assert a condition w.r.t.

Exported operations:

trace :: String -> a -> a   

Prints the first argument as a side effect and behaves as identity on the second argument.

traceId :: String -> String   

Prints the first argument as a side effect and returns it afterwards.

traceShow :: Show a => a -> b -> b   

Prints the first argument using show and returns the second argument afterwards.

traceShowId :: Show a => a -> a   

Prints the first argument using show and returns it afterwards.

traceIO :: String -> IO ()   

Output a trace message from the IO monad.

assert :: Bool -> String -> a -> a   

Assert a condition w.r.t. an error message. If the condition is not met it fails with the given error message, otherwise the third argument is returned.

assertIO :: Bool -> String -> IO ()   

Assert a condition w.r.t. an error message from the IO monad. If the condition is not met it fails with the given error message.