Safe Haskell | None |
---|---|
Language | Haskell2010 |
Probabilistic tracing conduits using Trace
Documentation
exitAfterC :: Monad m => Int -> Conduit a m a Source #
For profiling and debugging it can sometimes be useful, to have a circuit breaker, like this conduit, that exists after an given number of items have been processed, and, until then just yields all inputs.
traceShowC :: (Show a, Monad m) => Double -> String -> Conduit a m a Source #
Receive and trace the Show
n value prefixed by a message and then yield
down the stream. Since the number of elements sent over a conduit can be
tremendous, a tracing probability parameter was added, that can be between
0.0
- 1.0
, and sets the probability of with which a message will be
traced. This uses traceM
internally. Do not use this for
logging.
traceShowSink :: (Show a, Monad m) => Double -> String -> Consumer a m [a] Source #
Like traceShowC
but implemented as a Consumer
that also returns all
received inputs as a list when the conduit terminates.