ghc-Stack-Clean.tgz ------------------- (14th June, 2010) Contains a ghc source tree with the stack trace patches applied. The source tree was a GHC head just before ghc 6.12 came out - the prototype patches no longer apply cleanly to an up-to-date-ghc due to ghc's fast moving codebase (and updated build system). Because it's a pre 6.12 codebase, this source has to be built with a version of GHC pre 6.12. (ghc-pkg changed output format). *** i.e.: configure and build with something like: $ ./configure --with-ghc=ghc-6.10.1 && make *** If you don't want to make-install, you can run ghc from its in-place location: $ ~/ghc-Stack-Clean/ghc/stage2-inplace/ghc -fds-simple -fexplicit-call-stack-all --make Foo For reference, a full example showing a suitable definition for an error' function that can get at the stack. $ cat Foo.hs module Main where import Control.Exception import GHC.ExplicitCallStack.Stack foo0, foo1, foo2, foo3, foo4 :: Bool -> () foo0 x = foo1 x foo1 x = foo2 x foo2 x = foo3 x foo3 x = foo4 x foo4 False = foo0 True `seq` error' "Ouch!" foo4 True = () main :: IO () main = print $ foo0 False error' :: String -> a error' msg = throwStack (\s -> ErrorCall (msg ++ "\n" ++ (show s)))