No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ui Add module information about constructors in patterns. Dec 28, 2016
.gitignore Bump dependencies Aug 22, 2017
ChangeLog.md Bump version Aug 9, 2018
DumpCore.hs Remove deprecated reinitializeGlobals Aug 6, 2018
LICENSE Initial version Dec 24, 2016
README.md
Setup.hs Initial version Dec 24, 2016
dump-core.cabal Bump version Aug 9, 2018

README.md

This is a GHC plugin that renders the Core generated by GHC into JSON and also HTML, for easy inspection. The JSON is machine readable so it could be used by other tools, although at present the format is not documented and unstable.

An easy way to use the plugin is to add a flag to your Cabal file. For example, add the following to top-level of the Cabal file:

flag dump-core
  description: Dump HTML for the core generated by GHC during compilation
  default:     False

Then, you can add something like this to your library or executable section:

if flag(dump-core)
  build-depends: dump-core
  ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html

The option to the plugin specifies the directory where files should be saved--- in this example, it is set to core-html. The default is dump-core.

After compilation, directory dump-core (or whatever was specified in the options) will contain HTML files that you can open with a web browser. I've only tried Chrome but most browsers ought to work. Please let me know if you encounter problems.

While browsing, you can hover over variables to get information about them: hovering over a use site of a variable will highlight all other uses of it, as well as its binder. Hovering over a binder will give information about the type of the variable, as well as some of the information GHC inferred, such as strictness, uses, etc. You may also click on a binder to "hold on" to its information---the information won't disappear when you move the mouse. Click again to "let go" of the binder.

Hovering over identifiers from other modules will show you where they are defined. You may click on them to go to that module (if you have the HTML for it), although---due to a bug---you'll have to scroll to the definition manually.

You may also expand and collapse (some of the) definitions to make things more manageable.

Here a sample of the output for a single module:

http://yav.github.io/dump-core/example-output/Galua.OpcodeInterpreter.html