[Haskell-cafe] Space leak with recursion
Tom Ellis
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Fri Apr 24 10:26:01 UTC 2015
On Fri, Apr 24, 2015 at 12:16:55PM +0200, Martijn Rijkeboer wrote:
> >> Maybe I don't understand, but inside the pollServer function a call to
> >> poll is done and on line 47 and 56 of that same function, pollServer is
> >> called again (recursive).
> >
> > It's fine to call `pollServer` recursively, but it's not fine to
> > call it recursively from a handler, i.e. something that occurs in the
> > second argument to `poll`.
>
> Clear, my bad. I've just implemented a version with StateT (code below)
> and it doesn't leak space as you already expected. Thank you very much
> for your help.
Looks good! You're welcome Martijn.
Tom
More information about the Haskell-Cafe
mailing list