Re: [Haskell-cafe] Strictness in do block

2006-07-05 Thread Bulat Ziganshin
Hello John, Wednesday, July 5, 2006, 3:04:22 PM, you wrote: > What I want to know is the generic way to force an entire String (or > other list, perhaps from hGetContents) to be evaluated (read into RAM, I > guess) so the underlying file can be closed and do it right now. eval [] = [] eval (

Re: [Haskell-cafe] Strictness in do block

2006-07-05 Thread Twan van Laarhoven
I can always stumble upon things that work, but I'm never sure if I've got 'em right. So, what is the idiomatic way to do this? I think something like > evaluate (rnf myString) Evaluate is an action that forces the value to be evaluated. rnf (from Control.Parallel.Strategies) is 'reduce to no

Re: [Haskell-cafe] Strictness in do block

2006-07-05 Thread Duncan Coutts
On Wed, 2006-07-05 at 12:08 +0100, Neil Mitchell wrote: > Hi, > > > What I want to know is the generic way to force an entire String (or > > other list, perhaps from hGetContents) to be evaluated (read into RAM, I > > guess) so the underlying file can be closed and do it right now. > What I ha

Re: [Haskell-cafe] Strictness in do block

2006-07-05 Thread Neil Mitchell
Hi, What I want to know is the generic way to force an entire String (or other list, perhaps from hGetContents) to be evaluated (read into RAM, I guess) so the underlying file can be closed and do it right now. What I have done in the past is to take the length of the string, and test the l

[Haskell-cafe] Strictness in do block

2006-07-05 Thread John Goerzen
Hi, One thing that seems to keep biting me is strictness in do blocks. What I want to know is the generic way to force an entire String (or other list, perhaps from hGetContents) to be evaluated (read into RAM, I guess) so the underlying file can be closed and do it right now. One quick hack