<br>It seems that the function 'justE' caused my problem. <br>If I remove that, replacing the section at issue with<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
exitE = fmap esc ky where<br> esc k = case k of <br> Char '\ESC' -> exitSuccess<br> _ -> nop<br></blockquote><br>then the program works. However, there is a large <br>random delay, sometimes measured in seconds, before<br>
processing the events in the second argument of<br>`mappend`. And it still leaks space. Any advice?<br>(all this is with reactive-0.9.6 and ghc 6.10.1)<br><br>Thanks,<br>Balazs<br><br><div class="gmail_quote">On Tue, Dec 2, 2008 at 1:58 PM, Balazs Komuves <span dir="ltr"><<a href="mailto:bkomuves@gmail.com" target="_blank">bkomuves@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Dear All,<br><br>I'm trying to get my hands wet with the reactive library,<br>but already the simplest example I cooked up is failing<br>
to work properly (and leaks memory, and uses relatively<br>lots of cpu time). <br>
<br>The problem appears when I try to merge my two events<br>with `mappend`. One event should exit on pressing ESC, <br>the other draws colored circles on pressing the left mouse <br>button. They work correctly separately.<br>
<br>Could somebody explain me what's happening, or <br>whether I'm making a basic mistake?<br><br>The code is below, I hope the formatting survives the<br>various email systems. I don't know if that matters or<br>
not, but I'm using OS X.<br><br>Thanks,<br>Balazs<br><br></blockquote></div><br>