Skip to content

Instantly share code, notes, and snippets.

@symbiont-eric-torreborre
Forked from jacobstanley/trace.hs
Created August 14, 2019 12:57
Show Gist options
  • Save symbiont-eric-torreborre/2989c3ac858d41bd45208c5487a7531a to your computer and use it in GitHub Desktop.
Save symbiont-eric-torreborre/2989c3ac858d41bd45208c5487a7531a to your computer and use it in GitHub Desktop.
import qualified System.Console.Concurrent as Concurrent
trace :: [Char] -> a -> a
trace string expr =
unsafePerformIO $ do
traceIO string
return expr
traceIO :: [Char] -> IO ()
traceIO string = do
Concurrent.errorConcurrent (string <> "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment