packages feed

MicroHs-0.17.4.0: lib/Debug/Trace.hs

module Debug.Trace(module Debug.Trace) where
import qualified Prelude(); import MiniPrelude
import System.IO.Base(hPutStrLn, stderr, hFlush)
import Primitives

trace :: forall a . String -> a -> a
trace msg a = _primitive "IO.performIO" (
  do
    hPutStrLn stderr msg
    hFlush stderr
    return a
  )

traceM :: forall m . Monad m => String -> m ()
traceM s = trace s (return ())

traceShow :: forall a r. Show a => a -> r -> r
traceShow a = trace (show a)