Dear all,

I would like to bring our own Richard Eisenberg’s proposal, #283: Local modules, to your attention.
https://github.com/ghc-proposals/ghc-proposals/pull/283

The proposal is an attempt at solving the long debated issue that we can’t export qualified names out of a module (e.g. we may have to repeat import qualified Data.Map as Map and import qualified Data.Set as Set in every module in a project, rather than simply calling import MyPrelude which would take care of both and more), to improve scope management, and sharing names between types in the same files, while making namespaces more convenient to use in the process.

It’s a pretty ambitious proposal, with quite a few interlocking pieces. Yet, in my opinion, they fit pretty well together. And I’m, as a potential consumer, very enthusiastic about it.

Some highlight (though do read the whole thing):

Additionally, there is a small point that is not integral to the rest of the proposal, where defining, say, a type

data T
  = A
  | B

Would create a local module named T, such that the constructors could be referred to as T.A and T.B. I mention it separately, because it causes the only (small) backward incompatibility (that is Haskell 2010 programs which stop compiling when you turn on -XLocalModules).

I’m rather in favour of keeping it in, but it’s worth mentioning.

I pretty much want all of these features in my daily programming, so, as I said above, I’m very enthusiastic for all of this. And I’m pretty happy with the realisation. Hence my recommending acceptance.

/Arnaud