debug-0.0.1: Simple trace-based debugger

Safe HaskellNone
LanguageHaskell2010

Debug.Record

Contents

Description

Module for recording and manipulating debug traces. For most users, the TemplateHaskell helpers in Debug should be sufficient.

Synopsis

Recording

data Function Source #

Metadata about a function, used to drive the HTML view.

Constructors

Function 

Fields

data Call Source #

A single function call, used to attach additional information

funInfo :: Show a => Function -> (Call -> a) -> a Source #

A version of fun allowing you to pass further information about the Function which is used when showing debug views.

fun :: Show a => String -> (Call -> a) -> a Source #

Called under a lambda with a function name to provide a unique context for a particular call, e.g.:

tracedAdd x y = fun "add" $ \t -> var t "x" x + var t "y" y

This function involves giving identity to function calls, so is unsafe, and will only work under a lambda.

var :: Show a => Call -> String -> a -> a Source #

Used in conjunction with fun to annotate variables. See fun for an example.

Viewing

debugClear :: IO () Source #

Clear all debug information. Useful when working in ghci to reset any previous debugging work and reduce the amount of output.

debugPrint :: IO () Source #

Print information about the observed function calls to stdout. Definitely not machine readable, usually not human readable either.

debugJSON :: IO String Source #

Obtain information about observed functions in JSON format. The JSON format is not considered a stable part of the interface, more presented as a back door to allow exploration of alternative views.

debugView :: IO () Source #

Open a web browser showing information about observed functions.

debugSave :: FilePath -> IO () Source #

Save information about observed functions to the specified file, in HTML format.

Orphan instances

Show a Source #

An orphan instance of Show that maps anything without a Show instance to ?. Suitable for use only when debugging.

Methods

showsPrec :: Int -> a -> ShowS #

show :: a -> String #

showList :: [a] -> ShowS #