breakpoint-0.1.0.0: Set breakpoints using a GHC plugin
Safe HaskellSafe-Inferred
LanguageHaskell2010

Debug.Breakpoint

Synopsis

Documentation

captureVars :: Map String String Source #

Constructs a lazy Map from the names of all visible variables at the call site to a string representation of their value. Be careful about binding this to a variable because that variable will also be captured, resulting in an infinite loop if that element of the Map is evaluated.

showLev :: ShowLev rep a => a -> String Source #

fromAscList :: Ord k => [(k, v)] -> Map k v Source #

breakpoint :: a -> a Source #

Sets a breakpoint in pure code

queryVars :: a -> a Source #

When evaluated, displays the names of variables visible from the callsite and starts a prompt where entering a variable will display its value. You may want to use this instead of breakpoint if there are value which should stay unevaluated or you are only interested in certain values. Only the current thread is blocked while the prompt is active. To resume execution, press enter with a blank prompt.

breakpointM :: Applicative m => m () Source #

Sets a breakpoint in an arbitrary Applicative. Uses unsafePerformIO which means that laziness and common sub-expression elimination can result in the breakpoint not being hit as expected. For this reason, you should prefer breakpointIO if a MonadIO instance is available.

queryVarsM :: Applicative m => m () Source #

Similar to queryVars but for use in an arbitrary Applicative context. This uses unsafePerformIO which means that laziness and common sub-expression elimination can result in unexpected behavior. For this reason you should prefer queryVarsIO if a MonadIO instance is available.

breakpointIO :: MonadIO m => m () Source #

Sets a breakpoint in an IO based Monad. You should favor this over breakpointM if the monad can perform IO.

queryVarsIO :: MonadIO m => m () Source #

Similar to queryVars but specialized to an IO context. You should favor this over queryVarsM if a MonadIO instance is available.

getSrcLoc :: String Source #

Pretty prints the source code location of its call site