Add 'dumpAction' and 'traceAction' hooks
- add 2 hooks into DynFlags (
dumpAction
andtraceAction
) that can be used with GHC API to capture dumped messages with intermediate representations and traces - the default implementations of these hooks keep the current behavior
- replace
dumpSDoc
with a call todumpAction
- add dump type argument ("Core", "STG", "Text", etc.) useful for syntax highlighting
- fix some traces that were always displayed on stdout even with
-ddump-to-file