<div dir="ltr"><div>Hi,</div><div><br></div><div>I would like to enable stack traces at launch time and run program without HasCallStack overhead by default.</div><div>I've got an idea to use GHC plugin which would duplicate all functions in modules with specified prefix. Duplicated functions should get disambiguating prefix (e.g. "debug") and HasCallStack constraint. Bodies of prefixed functions should be rewritten to use prefixed functions from matching modules (should be easy to do - hook just after renaming GHC phase when all names are fully qualified?).</div><div><br></div><div>This way main  function could choose "runLib" or "debugRunLib".</div><div><br></div><div>Did anybody make something similar?<br></div><div><br></div><div><br></div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>Best regards,<br>Daniil Iaitskov<br> <br><br><br></div></div></div>