&gt; ..until further notice, just assume &quot;broken&quot;.<br><br>Useful to know.  I shall postpone its use in critical projects.<br><br>BTW, s/joinMaybes/justE works quickly, in minimal CPU and memory.  Forgot about that function.  Curious that the operational semantics have become so odd though; I&#39;m used to denotational ones being off -- late updates and so forth -- but I haven&#39;t come across quite that level of resource consumption in reactive code before.<br>
<br>Freddie<br><br><div class="gmail_quote">2009/6/10 Svein Ove Aas <span dir="ltr">&lt;<a href="mailto:svein.ove@aas.no">svein.ove@aas.no</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/6/10 Freddie Manners &lt;<a href="mailto:f.manners@gmail.com">f.manners@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; This is a silly example.  Console lines &quot;b = x&quot; update the value of b; &quot;c =<br>
&gt; y&quot; likewise; lines starting &quot;a&quot; cause the current value of a to be printed.<br>
&gt;<br>
&gt; module Main<br>
&gt;    where<br>
&gt;<br>
&gt; import FRP.Reactive<br>
&gt; import FRP.Reactive.LegacyAdapters<br>
&gt; import Data.List<br>
&gt; import Control.Monad<br>
&gt; import Control.Concurrent<br>
&gt; import Control.Applicative<br>
&gt;<br>
&gt; parseEvent :: String -&gt; Event String -&gt; Event Integer<br>
&gt; parseEvent s = fmap read . joinMaybes . fmap (stripPrefix s)<br>
&gt;<br>
&gt; main :: IO ()<br>
&gt; main = do<br>
&gt;       cl    &lt;- makeClock<br>
&gt;       (s,e) &lt;- makeEvent cl<br>
&gt;       forkIO . forever $ getLine &gt;&gt;= s<br>
&gt;       let b = stepper 0 $ parseEvent &quot;b =&quot; e<br>
&gt;       let c = stepper 0 $ parseEvent &quot;c =&quot; e<br>
&gt;       let p = parseEvent &quot;a&quot; e<br>
&gt;       let a = liftA2 (+) b c -- the only interesting line<br>
&gt;<br>
&gt;       adaptE . fmap print $ snapshot_ a p<br>
&gt;<br>
&gt; So yes, this does use explicit concurrency because &quot;feeding&quot; the reactive<br>
&gt; events (with getLine) and printing the answers must happen in different<br>
&gt; threads.<br>
&gt;<br>
&gt; Interestingly, this fairly simple program gobbles CPU and RAM on<br>
&gt; reactive-0.11, as well as running with a bit of a lag.  Could joinMaybes be<br>
&gt; to blame?  I don&#39;t know how happy the Monad instance of Event is these days.<br>
&gt;<br>
</div></div>&quot;Fundamentally broken&quot; about covers it.<br>
<br>
Well, to be specific, joinE is broken, and looks hard to fix.<br>
The Monoid instance for Event is also broken, but I think only when<br>
all Events involved are finite.<br>
<br>
Further, I was trying to fix it, but GHC is broken.<br>
<br>
I&#39;d also like to note that LegacyAdapters is broken. I&#39;ve got a fix<br>
for the broken bits, which happens to break everything else. Blocked<br>
on another GHC bug, though.<br>
<br>
..until further notice, just assume &quot;broken&quot;.<br>
<br>
--<br>
<font color="#888888">Svein Ove Aas<br>
</font></blockquote></div><br>