export control (Was: Add 'e' to Floating typeclass)

Henning Thielemann lemming at henning-thielemann.de
Thu Feb 21 23:23:40 UTC 2019


On Thu, 21 Feb 2019, Levent Erkok wrote:

> I often wonder if Haskell can have a "qualified export" feature for these cases. Just like we can "import
> qualified," why not "export qualified" some names, which means if you simply import the module the name will
> still be available qualified. (You can of course always import qualified.)
> 
> I haven't thought too much about the implications of this, but it might be an easy solution to this problem.
> Would love to hear thoughts on this; is there any language that has this feature? How costly would it be to add
> it to GHC?

Why not providing two modules: One that exports all identifiers and one 
that exports only identifiers that are likely not to clash with others. 
The first module would export 'e' and the second one would not. The first 
module would preferably be imported with qualification and the second one 
without.

However, unrestricted unqualified imports (like for the second module) are 
most oftenly not what you want because you have to restrict the imported 
package to a specific minor version then (according to PVP).


More information about the Libraries mailing list