+\begin{code}
+{-# NOINLINE trace #-}
+trace :: String -> a -> a
+trace string expr = unsafePerformIO $ do
+ fd <- getHandleFd stderr
+ hPutStrLn stderr string
+ _ccall_ PostTraceHook fd
+ return expr
+
+\end{code}
+
+\begin{code}
+unsafeIOToST :: IO a -> ST s a
+unsafeIOToST (IO io) = ST $ \ s ->
+ case ((unsafeCoerce# io) s) of
+ IOok new_s a -> unsafeCoerce# (STret new_s a)
+ IOfail new_s e -> error ("I/O Error (unsafeIOToST): " ++ showsPrec 0 e "\n")
+\end{code}
+
+Not something you want to call normally, but useful
+in the cases where you do want to flush stuff out of
+the heap or make sure you've got room enough
+
+\begin{code}
+performGC :: IO ()
+performGC = _ccall_GC_ StgPerformGarbageCollection
+\end{code}