Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- trace :: String -> a -> a
- tracy :: Show a => String -> a -> a
- proTracy :: (Show a, Show b) => String -> (a -> b) -> a -> b
- keanu :: a -> a
- arnold :: a -> a
- hasLength :: Foldable t => String -> t a -> t a
- isFound :: Foldable t => String -> t a -> t a
- spy :: Show b => String -> (a -> b) -> a -> a
- scope :: String -> f a -> Scope f a
- unScope :: Scope f a -> f a
- data Scope f a
Documentation
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.
proTracy :: (Show a, Show b) => String -> (a -> b) -> a -> b Source #
trace the input and output of a function