<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks, guys.<br><br>Sounds like Lisp packages. Now I see the functionality of the A or B, etc.: Fewer keystrokes.<br><br>Michael<br><br><br>--- On <b>Mon, 6/8/09, minh thu <i><noteed@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: minh thu <noteed@gmail.com><br>Subject: Re: [Haskell-cafe] Problem with Data.Map<br>To: "michael rice" <nowgate@yahoo.com><br>Cc: "Jochem Berndsen" <jochem@functor.nl>, haskell-cafe@haskell.org<br>Date: Monday, June 8, 2009, 1:00 PM<br><br><div class="plainMail">Hi,<br><br>> import Blurp<br>bring every thing defined in the Blurp module in scope.<br>So if blah is defined in blurp,<br>> blah<br>will work as expected.<br><br>> import qualified Blurp as B<br>does the same thing but everything defined in Blurp should
be<br>qualified (i.e. prefixed) with B.<br>> B.blah<br>will work, not<br>> blah<br><br>So your import statement is right but you should write Map.fromList<br>instead of just fromList.<br><br>The goal is to have multiple identical names from different modules<br>and still be able to use them at the same time, but qualified, for<br>instance lookup is defined in both Data.List and Data.Map.<br><br>> import qualified Data.List as L<br>> import qualified Data.Map as M<br>> L.lookup<br>> M.lookup<br>The two last lines are unambiguous.<br><br>Cheers,<br>Thu<br><br><br>2009/6/8 michael rice <<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>>:<br>> I don't understand your response. I copied the imports from Hoogles Data.Map<br>> page. What should the imports be?<br>><br>> Michael<br>><br>> --- On Mon, 6/8/09, Jochem Berndsen <<a ymailto="mailto:jochem@functor.nl"
href="/mc/compose?to=jochem@functor.nl">jochem@functor.nl</a>> wrote:<br>><br>> From: Jochem Berndsen <<a ymailto="mailto:jochem@functor.nl" href="/mc/compose?to=jochem@functor.nl">jochem@functor.nl</a>><br>> Subject: Re: [Haskell-cafe] Problem with Data.Map<br>> To: "michael rice" <<a ymailto="mailto:nowgate@yahoo.com" href="/mc/compose?to=nowgate@yahoo.com">nowgate@yahoo.com</a>><br>> Cc: <a ymailto="mailto:haskell-cafe@haskell.org" href="/mc/compose?to=haskell-cafe@haskell.org">haskell-cafe@haskell.org</a><br>> Date: Monday, June 8, 2009, 12:45 PM<br>><br>> michael rice wrote:<br>>> I'm trying to understand Map type for possible use in another problem I'm<br>>> working on, but am stymied right off the bat.<br>>><br>>> ==========Here's my source:<br>>><br>>> import Data.Map (Map)<br>>> import qualified Data.Map as Map<br>>><br>>> *Main> fromList $ zip l1
l2<br>>><br>>> <interactive>:1:0: Not in scope: `fromList'<br>><br>> You imported map "qualified as Map", that means that only 'Map.fromList'<br>> and 'Data.Map.fromList' are in scope, and not 'fromList'. The reason one<br>> normally does it like this is that a lot of function names clash with<br>> the Prelude (on purpose). Normally one uses "qualified as M" or<br>> "qualified as Map" to shorten the notation.<br>><br>> HTH,<br>><br>> --<br>> Jochem Berndsen | <a ymailto="mailto:jochem@functor.nl" href="/mc/compose?to=jochem@functor.nl">jochem@functor.nl</a><br>> GPG: 0xE6FABFAB<br>><br>><br>> _______________________________________________<br>> Haskell-Cafe mailing list<br>> <a ymailto="mailto:Haskell-Cafe@haskell.org" href="/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe"
target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>><br>><br></div></blockquote></td></tr></table><br>