<br>It seems that the function &#39;justE&#39; 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">

&nbsp; exitE = fmap esc ky where<br>&nbsp;&nbsp;&nbsp; esc k = case k of <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Char &#39;\ESC&#39; -&gt; exitSuccess<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; 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">&lt;<a href="mailto:bkomuves@gmail.com" target="_blank">bkomuves@gmail.com</a>&gt;</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&#39;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&#39;s happening, or <br>whether I&#39;m making a basic mistake?<br><br>The code is below, I hope the formatting survives the<br>various email systems. I don&#39;t know if that matters or<br>


not, but I&#39;m using OS X.<br><br>Thanks,<br>Balazs<br><br></blockquote></div><br>