Policy on import declarations in GHC
simonmar at microsoft.com
Mon Oct 9 05:28:16 EDT 2006
I'd like to propose a change to our coding style in GHC with respect to
import declarations. I talked this over with Simon on Friday, and he
(grudgingly :-) accepted that it is probably time to make this change.
I propose that we stop using explicit import lists. Here's why:
- They slow down development. Almost every modification is
by a corresponding change to the import lists, which usually means
extra compile/edit cycle per change.
- They cause spurious conflicts. This is a biggie, IMO. Since
we have to be extra careful about conflicts right now, avoiding
is important. Also not dealing with conflicts is a time saver.
The benefits of import lists are realised in other, better, ways:
- being able to tell where an identifier comes from by searching in
TAGS is better for this.
- being able to spot unused imports. GHC itself is better at this.
The only downside is that we don't get a visual indication of when an
import declaration is "nearly" unused, which might be helpful when
rearranging module dependencies. Still, I think the benefits in agility
of the codebase outweigh this.
Any comments before I add this policy to the coding guidelines?
More information about the Cvs-ghc