On , Ryan Ingram &lt;ryani.spam@gmail.com&gt; wrote:<br />&gt; Hi Sam.  I don&#39;t know much about the performance problems you are<br />&gt; seeing, but I think your solution is more cleanly implemented just<br />&gt; under the event level with futures.<br />&gt; <br />&gt; I think the reactive function you want has a type like this:<br />&gt; <br />&gt; stateMachine :: s -&gt; (a -&gt; s -&gt; s) -&gt; (s -&gt; Future (b, s)) -&gt; Event a -&gt; Event b<br />&gt; <br /><br />Hi Ryan.<br /><br />I will have to study futures, and your code, for a while before I can give an intelligent response, <br />but I really appreciate the suggestion. I will have a look at futures next.<br /><br />Many thanks,<br />Sam