debuggable-0.1.0: Utilities for making your applications more debuggable.
Safe HaskellNone
LanguageHaskell2010

Debug.NonInterleavedIO

Description

Functions for non-interleaved output

Intended for qualifed import.

import Debug.NonInterleavedIO qualified as NIIO

Alternatively, you can import Debug.NonInterleavedIO.Trace as a drop-in replacement for Debug.Trace.

The functions in this module can all be called concurrently, without resulting in interleaved output: each function call is atomic.

The first time any of these functions is called, we lookup the NIIO_OUTPUT environment variable. If set, we will write to the file specified (if the file already exists, it will be overwritten). If NIIO_OUTPUT is not set, a temporary file will be created in the system temporary directory; typically such a file will be called tmpniionumber. The name of this file is written to stderr (this is the only output origiating from functions in this module that is not written to the file).

Synopsis

Output functions

putStr :: MonadIO m => String -> m () Source #

Non-interleaved version of putStr

putStrLn :: MonadIO m => String -> m () Source #

Non-interleaved version of putStrLn

print :: (MonadIO m, Show a) => a -> m () Source #

Non-interleaved version of print

Tracing functions

trace :: String -> a -> a Source #

Non-interleaved version of trace

traceShow :: Show a => a -> b -> b Source #

Non-interleaved version of traceShow

traceShowId :: Show a => a -> a Source #

Non-interleaved version of traceShowId

traceM :: Applicative m => String -> m () Source #

Non-interleaved version of traceM

traceShowM :: (Applicative m, Show a) => a -> m () Source #

Non-interleaved version of traceShowM