
22 Jun
2007
22 Jun
'07
3:53 p.m.
"Olivier Boudry"
I did this replacing: (putStrLn . unlines . concat) origLinks with (putStrLn . unlines . take 10 . concat) origLinks
Unfortunately, 'origLinks' has already been computed in full, before the 'take 10' applies to it. Why? Because 'origLinks' is the result of an I/O action, which forces it:
main = do ... origLinks <- mapM (getLinksAfterImgByAttr ...) picLinks
What you really want to do is to trim the picLinks before you download them. e.g.
main = do ... origLinks <- mapM (getLinksAfterImgByAttr ...) (take 10 picLinks)
Regards, Malcolm