• simonpj's avatar
    [project @ 2003-02-20 18:33:50 by simonpj] · 56b5a8b8
    simonpj authored
          Add Core Notes and the {-# CORE #-} pragma
    This is an idea of Hal Daume's. The key point is that Notes in Core
    are augmented thus:
      data Note
        = SCC CostCentre
        | ...
        | CoreNote String     -- NEW
    These notes can be injected via a Haskell-source pragma:
       f x = ({-# CORE "foo" #-} show) ({-# CORE "bar" #-} x)
    This wraps a (Note (CoreNote "foo")) around the 'show' variable,
    and a similar note around the argument to 'show'.
    These notes are basically ignored by GHC, but are emitted into
    External Core, where they may convey useful information.
    Exactly how code involving these notes is munged by the simplifier
    isn't very well defined.  We'll see how it pans out.  Meanwhile
    the impact on the rest of the compiler is minimal.
HsExpr.lhs 24.7 KB