[Haskell-cafe] Space leak when returning pairs?
scm at ipl.t.u-tokyo.ac.jp
Fri May 19 05:27:10 EDT 2006
On May 19, 2006, at 6:16 PM, Henning Thielemann wrote:
> On Fri, 19 May 2006, Shin-Cheng Mu wrote:
>> idX :: [XMLEvent] -> ([XMLEvent], [XMLEvent])
>> idX (StartEvent a : strm) =
>> let (ts, strm') = idX strm
>> (us, strm'') = idX strm'
>> in (StartEvent a  : ts ++ EndEvent a : us, strm'')
> let ~(ts, strm') = idX strm
> ~(us, strm'') = idX strm'
Oh, I just tried using lazy patterns for the case for StartEvent
and TextEvent. But the space behaviour remained the same. :(
More information about the Haskell-Cafe