[Haskell-cafe] Applying Data.Map

michael rice nowgate at yahoo.com
Tue Jun 9 10:18:13 EDT 2009


In the import statements, it wasn't clear to me that I could import types as well as functions, and Map is a type. All clear now.

Thanks.

Michael

--- On Tue, 6/9/09, Thomas ten Cate <ttencate at gmail.com> wrote:

From: Thomas ten Cate <ttencate at gmail.com>
Subject: Re: [Haskell-cafe] Applying Data.Map
To: "michael rice" <nowgate at yahoo.com>
Cc: haskell-cafe at haskell.org
Date: Tuesday, June 9, 2009, 9:40 AM

On Tue, Jun 9, 2009 at 15:23, michael rice<nowgate at yahoo.com> wrote:
> import Data.Map (Map)   (fromList,!)  ???
> import qualified Data.Map as Map  (fromList,!) ???

Because ! is an operator, you need to enclose it in parentheses. Also,
the (Map) in the import is already the list of things you are
importing; you can just add to that. So do the following:

Import these without qualification:
> import Data.Map (Map, fromList, (!))
Import everything else (actually including Map, fromList and (!)) with
qualification "Map":
> import qualified Data.Map as Map

Cheers,

Thomas



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


More information about the Haskell-Cafe mailing list