[Haskell-cafe] Problem with Data.Map

michael rice nowgate at yahoo.com
Mon Jun 8 12:51:42 EDT 2009


I don't understand your response. I copied the imports from Hoogles Data.Map page. What should the imports be?

Michael

--- On Mon, 6/8/09, Jochem Berndsen <jochem at functor.nl> wrote:

From: Jochem Berndsen <jochem at functor.nl>
Subject: Re: [Haskell-cafe] Problem with Data.Map
To: "michael rice" <nowgate at yahoo.com>
Cc: haskell-cafe at haskell.org
Date: Monday, June 8, 2009, 12:45 PM

michael rice wrote:
> I'm trying to understand Map type for possible use in another problem I'm working on, but am stymied right off the bat.
> 
> ==========Here's my source:
> 
> import Data.Map (Map)
> import qualified Data.Map as Map
> 
> *Main> fromList $ zip l1 l2
> 
> <interactive>:1:0: Not in scope: `fromList'

You imported map "qualified as Map", that means that only 'Map.fromList'
and 'Data.Map.fromList' are in scope, and not 'fromList'. The reason one
normally does it like this is that a lot of function names clash with
the Prelude (on purpose). Normally one uses "qualified as M" or
"qualified as Map" to shorten the notation.

HTH,

-- 
Jochem Berndsen | jochem at functor.nl
GPG: 0xE6FABFAB



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090608/dcaae127/attachment.html


More information about the Haskell-Cafe mailing list