RE: [Haskell] writeFile for a looong string
14 Jul
2005
14 Jul
'05
11:39 a.m.
On 14 July 2005 10:08, Johannes Waldmann wrote:
I am writing a long string (several MByte) to a file, with writeFile fname ( render d ) where d :: Text.PrettyPrint.HughesPJ.Doc
I wonder what happens internally (when compiled with ghc -O, if that matters) Will the string be in memory completely before it is actually written?
No, it should be streamed to the output in constant space, as long as the String can be evaluated lazilly. Cheers, Simon
7715
Age (days ago)
7715
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow