"Olivier Boudry" <[EMAIL PROTECTED]> wrote:

> 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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to