Dear members,
I am experiencing a space leak, which I suspect to be
an instance of the problem addressed by Wadler before.
I'd appreciate if someone here would take a look.
Given the following datatype:
data XMLEvent = StartEvent String
| EndEvent String
|
On Fri, 19 May 2006, Shin-Cheng Mu wrote:
idX :: [XMLEvent] - ([XMLEvent], [XMLEvent])
idX [] = ([], [])
idX (StartEvent a : strm) =
let (ts, strm') = idX strm
(us, strm'') = idX strm'
in (StartEvent a [] : ts ++ EndEvent a : us, strm'')
idX (EndEvent _:
Dear Henning,
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 ++
Henning Thielemann [EMAIL PROTECTED] wrote:
let ~(ts, strm') = idX strm
~(us, strm'') = idX strm'
Let-bindings are already lazy, so the ~ here is redundant.
Regards,
Malcolm
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On May 19, 2006, at 6:16 PM, Henning Thielemann wrote:
let ~(ts, strm') = idX strm
~(us, strm'') = idX strm'
I seem to have found a partial solution to the problem.
It's rather ugly, however, and I think there should be
a better way.
The original definition for one of the clauses was
Shin-Cheng Mu wrote:
Dear members,
I am experiencing a space leak, which I suspect to be
an instance of the problem addressed by Wadler before.
I'd appreciate if someone here would take a look.
Given the following datatype:
data XMLEvent = StartEvent String
| EndEvent
Shin-Cheng Mu [EMAIL PROTECTED] wrote:
I was wondering where the space leak came from and suspected
that it's the leak described in one of Philip Wadler's
early paper Fixing Some Space Leaks With a Garbage Collector (1987).
But since Wadler has addressed this problem a long time ago,
I