[Haskell-cafe] Qualified import syntax badly designed (?)

allan a.d.clark at ed.ac.uk
Wed Jul 9 06:05:20 EDT 2008

Neil Mitchell wrote:
> Hi
>> declaration with a regular syntax. For example:
>>     import Data.Map as Map
>>         unqualified (Map, (\\))
>>         qualified   (lookup, map, null)
>>         hiding      (filter)
> I think I prefer this to my proposal, plus its closer to the current
> syntax. I think its also nearly equal to what Tom Davie came up with,
> given some keyword renaming. If we dropped the unqualified keyword,
> and just required unqualified things to come directly after, we get
> the full benefits of not introducing any keywords.
Just to say that I also like this design. A minor point would be; do we
really need the parentheses and commas? or could we not just use
indentation (I think this about module imports in general).

Also I wouldn't mind 'as' for the names which are imported which would
be a bit of a work around for the debate as to whether I should design
my modules for qualified import or not. Suppose I make a 'NewList'
module and use the default names then someone could do:
import Data.NewList
  unqualified map  as nlMap
              find as nlFind
              lookup as nlLookup

or vice-versa.


The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

More information about the Haskell-Cafe mailing list