ecbabbfd

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Let a rule say it needs a whole package

HsGenValidInGenPackage, from haskell-style.md: a GenValid instance belongs in
the gen package, not beside the type. Answering it needs two packages at once,
which no rule could ask for until now.

A rule's constructor is its level, so nothing can disagree with it. A module
rule is handed one module and a package rule is handed a query over the store
the commit below this one added, and the envelope never learns what is in a
rule's table: adding a rule adds no case to it, because a package rule is a
migration, what it writes out of one module, and the query it answers with.

Each level judges exactly the suppressions naming its own rules. That is what
keeps unused-suppression detection sound without a pass over the whole
repository: a suppression for a package rule cannot be called unused by the
module phase, which has not run that rule.

The three module rules gain one line each, saying which level they are. That is
the whole of what the level costs a rule that does not need it.

Still one process, so the store has nowhere to go and nothing crosses a process
boundary. Nothing reads what the compiler wrote down: the package check's
signature does not take the compiler's answers, because this rule has no use for
them.