• Simon Peyton Jones's avatar
    Record usage information using GlobalRdrElt · 3e94842d
    Simon Peyton Jones authored
    This patch implements an improvment that I've wanted to do for ages, but
    never gotten around to.
    Unused imports are computed based on how imported entities occur (qualified,
    unqualified).   This info was accumulated in tcg_used_rdrnames :: Set RdrName.
    But that was a huge pain, and it got worse when we introduced duplicate
    record fields.
    The Right Thing is to record tcg_used_gres :: [GlobalRdrElt], which records
    the GRE *after* filtering with pickGREs.  See Note [GRE filtering] in RdrName.
    This is much, much bette.  This patch deletes quite a bit of code, and is
    conceptually much easier to follow.
    Hooray.  There should be no change in functionality.
TcSMonad.hs 109 KB