1 -----------------------------------------------------------------------------
3 -- Module : Debug.Trace
4 -- Copyright : (c) The University of Glasgow 2001
5 -- License : BSD-style (see the file libraries/core/LICENSE)
7 -- Maintainer : libraries@haskell.org
8 -- Stability : provisional
9 -- Portability : portable
11 -- $Id: Trace.hs,v 1.3 2002/04/24 16:31:43 simonmar Exp $
13 -- The trace function.
15 -----------------------------------------------------------------------------
18 trace -- :: String -> a -> a
22 import System.IO.Unsafe
25 #ifdef __GLASGOW_HASKELL__
30 #ifdef __GLASGOW_HASKELL__
31 {-# NOINLINE trace #-}
32 trace :: String -> a -> a
33 trace string expr = unsafePerformIO $ do
36 fd <- withHandle_ "trace" stderr $ (return.haFD)
40 foreign import ccall "PostTraceHook" postTraceHook :: Int -> IO ()