Feature Request : Qualified module exports

Roman Cheplyaka roma at ro-che.info
Mon Jul 8 12:37:32 CEST 2013


* Erik de Castro Lopo <mle+hs at mega-nerd.com> [2013-07-08 20:14:12+1000]
> Hi all,
> 
> I've added a feature request ticket to the GHC trac:
> 
>     http://ghc.haskell.org/trac/ghc/ticket/8043
> 
> for qualified module exports. In a nutshell this would allow the
> following 'qualified module' export eg:
> 
>    module MyModule
>        ( qualified module T
>         )
>    import qualified Data.Text as T
> 
> so that any module which imports MyModule has access to the symbols
> of Data.Text under the quaified module name T.

What if something exports Data.Text as T, and something else exports
Data.List as T (and they obviously have lots of conflicts)?

Or what if I don't like the "T" convention and would rather like to use
the "Text" prefix?

The nice thing about the current state of Haskell modules is that you
have very fine-grained control of how your namespace looks like. I feel
that this proposal would make this control harder (if possible at all).

(BTW, I'm not denying usefulness of this, and I've seen a lot of cases
where this would be handy. I'm just pointing at the downsides.)

Roman



More information about the ghc-devs mailing list