debug-tracy-0.1.0.3: More useful trace functions for investigating bugs

Safe HaskellNone
LanguageHaskell2010

Debug.Tracy

Synopsis

Documentation

trace :: String -> a -> a #

The trace function outputs the trace message given as its first argument, before returning the second argument as its result.

For example, this returns the value of f x but first outputs the message.

>>> let x = 123; f = show
>>> trace ("calling f with x = " ++ show x) (f x)
"calling f with x = 123
123"

The trace function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.

tracy :: Show a => String -> a -> a Source #

trace with show and a delimiter built in

proTracy :: (Show a, Show b) => String -> (a -> b) -> a -> b Source #

trace the input and output of a function

keanu :: a -> a Source #

Spit out a random Keanu Reaves quote when a is evauluated

arnold :: a -> a Source #

spit out a random Arnold Schwarzenegger quote when a is evaluated

hasLength :: Foldable t => String -> t a -> t a Source #

Inspect the size of a collection

isFound :: Foldable t => String -> t a -> t a Source #

Inspect if t a is null

spy :: Show b => String -> (a -> b) -> a -> a Source #

scope :: String -> f a -> Scope f a Source #

unScope :: Scope f a -> f a Source #

data Scope f a Source #

Instances
(Monad m, Foldable m) => Monad (Scope m) Source # 
Instance details

Defined in Debug.Tracy

Methods

(>>=) :: Scope m a -> (a -> Scope m b) -> Scope m b #

(>>) :: Scope m a -> Scope m b -> Scope m b #

return :: a -> Scope m a #

fail :: String -> Scope m a #

(Functor f, Foldable f) => Functor (Scope f) Source # 
Instance details

Defined in Debug.Tracy

Methods

fmap :: (a -> b) -> Scope f a -> Scope f b #

(<$) :: a -> Scope f b -> Scope f a #

(Applicative f, Foldable f) => Applicative (Scope f) Source # 
Instance details

Defined in Debug.Tracy

Methods

pure :: a -> Scope f a #

(<*>) :: Scope f (a -> b) -> Scope f a -> Scope f b #

liftA2 :: (a -> b -> c) -> Scope f a -> Scope f b -> Scope f c #

(*>) :: Scope f a -> Scope f b -> Scope f b #

(<*) :: Scope f a -> Scope f b -> Scope f a #