[ghc-steering-committee] #283: Local modules (again), recommendation: accept

Spiwack, Arnaud arnaud.spiwack at tweag.io
Thu May 20 15:42:30 UTC 2021

Dear all,

It is time to review the local modules proposal, from our own Richard
Eisenberg, again. In fact it’s been time for a while, and I must apologise
to Richard for not having understood that. Sorry, Richard.

Link: https://github.com/ghc-proposals/ghc-proposals/pull/283

Since the last time, the proposal has been both simplified and made more
precise. The main issues solved by this proposal are

   - The ability to export qualified names from modules
   - The ability to define functions with qualified names within a module (
   *e.g.* you could have both T.f and U.f).
   - The ability to locally refer to qualified data as unqualified (suppose
   Set.map is in scope, then the proposal lets you write let import module
   Set in map f (map g some_set).

I think these are three important issues, and the proposal makes a good
case that they ought to be solved together. I also think that the
specification is clear and doesn’t leave any dark corner. Caveat: I have
contributed to writing the current specification, so I may be missing some

The proposal does introduce a somewhat byzantine semantic difference
between module X and module qualified X in export lists. This is to keep
the current meaning of module X which is already not very intuitive (cf
https://ro-che.info/articles/2012-12-25-haskell-module-system-p1 ). I think
this is unavoidable.

There are also 3 optional pieces of specification that we are asked to rule
on (§4). I’m personally in favour of option 1. I’m weakly in favour of
option 3 (with a preference for the variant described in Alternative 7). On
the other hand option 2 seems to add a bit too much syntactic subtlety to
be worth it (though if we choose option 2, I see no reason not to accept
Alternative 3 as well).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20210520/915b74f6/attachment.html>

More information about the ghc-steering-committee mailing list