Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Util.Debug

Synopsis

Documentation

activate :: Handle -> IO.IO () Source #

Write debug msgs to the given handle.

deactivate :: IO.IO () Source #

Suppress debug msgs.

full :: (Eq a, Monoid a) => (a -> a) -> a -> a Source #

Only apply the function if the val is non-mempty. Useful for the trace family.

fullM :: (Monad m, Eq a, Monoid a) => (a -> m ()) -> a -> m () Source #

Like full but useful for the traceM and put family.

forced by evaluation

trace :: (HasCallStack, Show a) => Text -> a -> a Source #

Print a showable value en passant.

tracep :: (HasCallStack, Pretty.Pretty a) => Text -> a -> a Source #

Pretty print a value en passant.

traces :: (HasCallStack, Show b) => Text -> b -> a -> a Source #

Print a showable value.

tracesp :: (HasCallStack, Pretty.Pretty b) => Text -> b -> a -> a Source #

Pretty print a value.

tracef :: (HasCallStack, Show b) => Text -> (a -> b) -> a -> a Source #

Print a value after applying a function to it.

tracefp :: (HasCallStack, Pretty.Pretty b) => Text -> (a -> b) -> a -> a Source #

trace_ret :: (HasCallStack, Show a, Show b) => Text -> a -> b -> b Source #

Trace input and output of a function.

trace_str :: HasCallStack => Text -> a -> a Source #

Show a raw string, equivalent to trace.

forced by monad

traceM :: (HasCallStack, Show a, Monad m) => Text -> a -> m () Source #

Print a value in a monad. The monad will force it to be printed.

tracepM :: (HasCallStack, Pretty.Pretty a, Monad m) => Text -> a -> m () Source #

tracesM :: (HasCallStack, Monad m) => Text -> m () Source #

puts :: (HasCallStack, MonadIO m) => Text -> m () Source #

put :: (HasCallStack, MonadIO m, Show a) => Text -> a -> m () Source #

putp :: (HasCallStack, MonadIO m, Pretty.Pretty a) => Text -> a -> m () Source #