<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">This reminds me a joke to put it in a humorous way:<div class=""><br class=""></div><div class="">> <span style="color: rgb(0, 0, 0); font-family: Verdana, Geneva, sans-serif; orphans: 2; widows: 2; background-color: rgb(246, 246, 239);" class="">A software QA engineer walks into a bar. He orders a beer. Orders 0 beers. Orders 99999999999 beers. Orders a lizard. Orders -1 beers.</span></div><p style="margin-top: 8px; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: Verdana, Geneva, sans-serif; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(246, 246, 239);" class="">> First real customer walks in and asks where the bathroom is. The bar bursts into flames, killing everyone.</p><div class=""><br class=""></div><div class="">LOL,</div><div class="">Compl<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 2020-05-09, at 02:18, Ben Gamari <<a href="mailto:ben@well-typed.com" class="">ben@well-typed.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Henning Thielemann <<a href="mailto:lemming@henning-thielemann.de" class="">lemming@henning-thielemann.de</a>> writes:<br class=""><br class=""><blockquote type="cite" class="">On Fri, 8 May 2020, Niklas Hambüchen wrote:<br class=""><br class=""><blockquote type="cite" class="">On 5/8/20 7:32 PM, Henning Thielemann wrote:<br class=""><br class=""><blockquote type="cite" class="">Can someone please give me examples where current state lacks<br class=""></blockquote><br class="">* Currently stack traces are not printed, so users cannot forward them <br class="">to the developer, even if both the users and the developers would like <br class="">that.<br class=""></blockquote><br class="">We are talking about the HasCallStack stack traces, yes?<br class="">How is their emission addressed by extending exceptions with stack<br class="">traces?<br class=""></blockquote><br class="">HasCallStack stack traces are one type of backtrace that the proposal<br class="">supports. However, it's not the only (nor is it even the most useful<br class="">sort, in my opinion).<br class=""><br class="">Other mechanisms include cost center stacks from the cost-center<br class="">profiler and native stack unwinding.<br class=""><br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">* Developers cannot easily produce stack traces do debug unintended <br class="">exceptions.<br class=""></blockquote><br class="">What are "unintended exceptions"?<br class="">What is an example of an "unintended exception"?<br class=""></blockquote><br class="">For instance,<br class=""><br class=""> * Somewhere deep in my code a colleague used `fromJust` due to a<br class="">   miscommunicated invariant<br class=""><br class=""> * Somewhere in my system a `writeFile "tmp" $ repeat 'a'` failed due to<br class="">   filling the disk<br class=""><br class=""> * Somewhere in my system I have a partial pattern match in a module<br class="">   which was compiled without -Wall<br class=""><br class=""> * Somewhere in my system I `div` by zero due to lack of input<br class="">   validation<br class=""><br class=""> * I use a record selector on a sum.<br class=""><br class=""> * A logic error results in an assertion failure deep in my program, but<br class="">   it's unclear which path my program took to arrive at the assertion<br class=""><br class="">This list could go on and on...<br class=""><br class="">Currently the proposal does not cover asynchronous exceptions but it<br class="">wouldn't be particularly hard to extend it in this direction. This would<br class="">allow far better reporting of heap/stack overflows and MVar deadlocks<br class="">(which are particularly hard to debug at the moment).<br class=""><br class="">Cheers,<br class=""><br class="">- Ben<br class="">_______________________________________________<br class="">ghc-devs mailing list<br class=""><a href="mailto:ghc-devs@haskell.org" class="">ghc-devs@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br class=""></div></div></blockquote></div><br class=""></div></body></html>