[Haskell-cafe] preffered 'map'

Pixel pixel at mandriva.com
Fri Dec 9 11:02:01 EST 2005


Benjamin Franksen <benjamin.franksen at bessy.de> writes:

>> import Data.Map as Map
>>
>> but now anywhere when I want ot use "map" it complains for
>> name clashes, so I have to specifiy Prelude.map all the time.
>> Is there a way to specify that i mean Prelude not Data 'map' (but not
>> fqn) I use Hugs, 'cause error messages are more understandable.
>
> import Data.Map as Map
> import Prelude hiding (map)
> import qualified Prelude (map)

better do:

  import qualified Data.Map as Map

since:

  import A as B                 x, y, B.x, B.y
  import A as B(x)              x, B.x
  import qualified A as B       B.x, B.y

(cf http://www.haskell.org/onlinereport/modules.html)

i've been hit by this too.
maybe the documentation at beginning of Map.hs should be changed?


More information about the Haskell-Cafe mailing list