Version 2 (modified by guest, 11 years ago) (diff)


The ExternalCore type

The ExternalCore data type is used by GHC to communicate code represented in the Core data type with the outside world. It comes with an external syntax, a parser, a pretty printer, and code to convert between Core and External Core. Unfortunately, External Core has not been widely used, and the code has bit-rotted. The recent changes in Core to use System FC have exacerbated the problem. This page documents the process of getting ExternalCore and Core back in sync.

Relevant files

The main source files related to External Core:

Other files that contain some reference to External Core or are otherwise relevant:


Design decisions



  • Update the ExternalCore data type to be compatible with the current Core data type.
  • Define an external text representation for ExternalCore (which will probably be simply a minor modification of the old format)
  • Update LexCore.hs, ParserCore.y, and ParserCoreUtils.hs to support the new data type and external syntax.
  • Update MkExternalCore.lhs to support both the current Core and the new ExternalCore.
  • Update PprExternalCore.lhs to print stuff that LexCore and ParserCore can understand.
  • Convert the current External Core documentation (in LaTeX) into a chapter (in XML) in the User's Guide.