[GHC] #10478: Shorter import syntax

GHC ghc-devs at haskell.org
Wed Jun 3 09:59:51 UTC 2015


#10478: Shorter import syntax
-------------------------------------+-------------------------------------
        Reporter:  acowley           |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by Yuras):

 Note that currently the next is allowed:

 {{{#!haskell
 import Data.Map as M (Map)
 }}}

 Different semantics based on order of parens and `as` is too ambiguous and
 hard to remember IMO.

 Also, the existing convention to import data type unqualified and the rest
 qualified is some kind of a hack working around lack of nested namespaces.
 In the ideal world `Data.Map` should export functions qualified. Like the
 next:

 {{{#!haskell
 module Data.Map
 (Map, namespace Map)
 where

 data Map = ...

 namespace Map where
   length :: Map -> Int
   length ...
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10478#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list