[Haskell-cafe] Stack space overflow in HaskellNet

Henning Thielemann lemming at henning-thielemann.de
Tue Jul 26 10:17:22 CEST 2011


On Mon, 25 Jul 2011, Manfred Lotz wrote:

> Hi there,
> If I take example imap.hs
>
>
> import System.IO
> import Network.HaskellNet.IMAP
> import Text.Mime
> import qualified Data.ByteString.Char8 as BS
> import Control.Monad
>
> -- the next lines were changed to fit to my local imap server
> imapServer = "imap.mail.org"
> user = ""
> pass = ""
>
> main = do
>  con <- connectIMAP imapServer
>  login con user pass
>  mboxes <- list con
>  mapM print mboxes

This should be mapM_ and 'ghc -Wall' spots this problem since 6.12.

>  select con "INBOX"
>  msgs <- search con [ALLs]
>  mapM_ (\x -> print x) (take 4 msgs)
>  forM_ (take 4msgs) (\x -> fetch con x >>= print)



More information about the Haskell-Cafe mailing list