Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Re: Forcing evalation in the IO Monad (Philip Scott)


----------------------------------------------------------------------

Message: 1
Date: Fri, 16 Apr 2010 19:50:21 +0100
From: Philip Scott <[email protected]>
Subject: Re: [Haskell-beginners] Re: Forcing evalation in the IO Monad
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed


> Prelude Control.Exception>  let lst = [undefined,undefined] :: [Bool]
> Prelude Control.Exception>  evaluate lst>>= putStrLn . take 1 . show
> [
> Prelude Control.Exception>  evaluate lst>>= print
> [*** Exception: Prelude.undefined
>
>    
Ahh, yes you are of course right. Hmm so, how do we crack this nut 
without resorting to deepSeq etc.. It must be possible, because it 
happens when you print it!

Am I going to have to resort to physically writing the output to /dev/null ?

It seems like such an ordinary thing to want to do, the fact that it is 
hard makes me think I must be approaching this in the wrong way (which 
is usually the case when I get my knickers in a twist with Haskell ;)

- Phil


------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 22, Issue 30
*****************************************

Reply via email to