[Haskell-beginners] Problem with Data.Map and IO...

Manfred Lotz manfred.lotz at arcor.de
Thu May 12 11:08:59 CEST 2011


Hi,
Thanks to both of you.


On Thu, 12 May 2011 03:19:24 +0300
Markus Läll <markus.l2ll at gmail.com> wrote:

> You want the Map to map from filenames to their contents?
> 
> Basically you need mapM or foldM, depending in where you want to use
> getXmlContent. In the below code I used mapM to read the files into a
> list of pairs, and fold over it (I changed insertRec to take a pair).
> 

Actually I had tried foldM because I thought this has to be the way.
But when I changed createMap accordingly I didn't think about changing
the signature and then I didn't understand the compiler's error
message. 

foldM works fine now. Now I have another problem which should be a new
thread.



-- 
Manfred





More information about the Beginners mailing list