[Haskell-cafe] GHC debug plugin

Daneel Yaitskov dyaitskov at gmail.com
Sun Dec 12 20:01:41 UTC 2021


Hi,

I would like to enable stack traces at launch time and run program without
HasCallStack overhead by default.
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?).

This way main function could choose "runLib" or "debugRunLib".

Did anybody make something similar?



-- 

Best regards,
Daniil Iaitskov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20211212/a08a8533/attachment.html>


More information about the Haskell-Cafe mailing list