On Sat, Oct 10, 2009 at 11:11:24PM +0200, Daniel Fischer wrote:
> To: [email protected]
> From: Daniel Fischer <[email protected]>
> Date: Sat, 10 Oct 2009 23:11:24 +0200
> Subject: Re: [Haskell-cafe] How do I get this done in constant mem?
> 
> Am Samstag 10 Oktober 2009 22:14:38 schrieb [email protected]:
> > On Sat, Oct 10, 2009 at 09:33:52AM -0700, Thomas Hartman wrote:
> > > To: Luke Palmer <[email protected]>
> > > Cc: [email protected], [email protected]
> > > From: Thomas Hartman <[email protected]>
> > > Date: Sat, 10 Oct 2009 09:33:52 -0700
> > > Subject: Re: [Haskell-cafe] How do I get this done in constant mem?
> > >
> > > > Yes, you should not do this in IO.  That requires the entire
> > > > computation to finish before the result can be used.
> > >
> > > Not really the entire computation though... whnf, no?
> >
> > In that example, yes.  But readFile takes the entire file into a
> > strict String before it gives you the first Char, right?  (Sorry again
> > for my misleading code "simplification".)
> 
> No, readFile reads the file lazily.

hm?  oh, you are right, now that i fixed all the other problems in my
code readFile isn't a problem any more either...  (-:

(but then how does it know when to close the handle?  gotta go read
the code i guess.)

thanks!
-m
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to