RFC: general sequences

Henning Thielemann lemming at henning-thielemann.de
Tue May 24 06:17:07 EDT 2005

On Tue, 24 May 2005, Benjamin Franksen wrote:

> You have answered your question yourself: Qualified import is bad for
> everyday functions like 'map' and also for operators. The problem with
> 'map' is that it is restricted to lists and not available for other
> collections. I think 'filter' is an everyday function like 'map'.


> All these should be members of appropriate type classes.

  Since I would call the functions of Data.Sequence in a qualified way it 
would be no difference whether they are functions for Data.Sequence or 
methods of a type class. In the case of (++) and (!!) I would hide the 
prelude functions. This effort is only necessary for modules actually 
using Data.Sequence and only as long as the Prelude is as it is today. 
(How long will this be? :-)

> That doesn't mean I am against qualified imports. I personnally think
> qualified import is good for libraries that serve a special purpose,
> for instance a GUI library or a /special/ implementation of some data
> structure. I think it is less appropriate for the standard collection
> ADTs that should be available for everyday use in the most easy-to-use
> manner. Type classes are a lot easier to use, because the compiler
> selects the correct instance, not the programmer.

me too

More information about the Libraries mailing list