Data.Map API

Tomasz Zielonka tomasz.zielonka at gmail.com
Sat Nov 12 04:13:44 EST 2005


On Sat, Nov 12, 2005 at 02:05:54AM +0100, Benjamin Franksen wrote:
> Last time I used Data.Map I went for
> 
> import qualified Data.Map as Map
> type Map = Map.Map

There is a small problem - you can define type-class instances for
type synonyms in Haskell 98.

What's wrong with this approach, besides being overly verbose:

    import qualified Data.Map as Map
    import Data.Map (Map)

I've seen it used in others' code. The report allows to import
the same module many times:

"A single module may be imported by more than one import declaration."

Best regards
Tomasz


More information about the Libraries mailing list