The Haskell Unfolder Episode 29: exceptions, annotations and backtraces

preview_player
Показать описание
Version 9.10 of GHC introduces an extremely useful new feature: exception annotations and automatic exception backtraces. This new feature, four years in the making, can be a life-saver when debugging code and has not received nearly as much attention as it deserves. In this episode of the Haskell Unfolder we therefore give an overview of the changes and discuss how we can take advantage of them.

Resources:

Рекомендации по теме
Комментарии
Автор

Cool stuff! Previously one could already get backtrace info on exceptions in profiling builds with +RTS -xc, but that was very noisy in practice because it prints a backtrace for _every_ exception — and it's often not even clear which of those exceptions is the actual problem. Having an easy way to get good backtraces for mostly only the exceptions that matter is definitely a boon for debugging!

TomSmeding
Автор

Thanks for another super interesting vid. Definitely upgrading my ghc version soon

johnwalker
Автор

Great video. I was trying "annotateIO" in a program run with runhaskell/ghci and I didn't saw any annotations. They only appeared when running the compiled program. I suspect it's because the "losing annotations when re-throwing" effect described at 9:50.

danieldiaz
Автор

thanks for making this! is there some way to use this to get a backtrace from an operation that's in an infinite loop seemingly? I tried throwTo to that thread and catching higher up, but the ExceptionContext is empty

lkbasgiohbasg