GHC source code improvement ideas
igloo at earth.li
Fri Jan 4 12:47:39 EST 2008
On Fri, Jan 04, 2008 at 08:34:22AM +0000, Simon Peyton-Jones wrote:
> | 4. A more radical change would be introducing hierarchical modules. This
> | could be just a matter of renaming the directories to start with an upper
> | case character and changing the import declarations. This gives module names
> | like "Typecheck.TcGadt". The tc is redundant here, so perhaps it should be
> | renamed to "Typecheck.Gadt" or "Typecheck.GADT". Perhaps even better would
> | be "GHC.Typecheck.GADT", this way some modules can be exposed as part of the
> | GHC api.
> I don't think I'd object, but I'm not sure that much is gained here. We don't spend much time on mondule-name clashes.
One point is that GHC uses module names like Util and State, which is a
bit unfriendly to people using GHC-as-a-library.
Also, although "import Types.Generics" is a bit longer to type, it is
also a bit easier for someone less familiar with the code to follow the
imports (if their editor does not help them).
It's a pity that GHC.* is already used in base. I'm not sure what the
best thing to do is in the short term.
More information about the Glasgow-haskell-users