The desugarer (compiler/deSugar/Desugar) converts from the massive HsSyn type to GHC's intermediate language, CoreSyn. This Core-language data type is unusually tiny: just eight constructors.

This late desugaring is somewhat unusual. It is much more common to desugar the program before typechecking, or renaming, becuase that presents the renamer and typechecker with a much smaller language to deal with. However, GHC's organisation means that

  • error messages can display precisely the syntax that the user wrote; and
  • desugaring is not required to preserve type-inference properties.
Commentary/Compiler/HscMain – GHC


ついでに、A History of Haskell: being lazy with classの9.1節にも同様の事が書いてある。