So, it may be that we&#39;ve made Num a =&gt; Behavior a an instance of Num in which case this is valid code; I think the definition<br><br>a = liftA2 (+) b c<br><br>is more instructive.  The point is that Behavior is an instance of Applicative, so we can apply a time-varying function (such as (+) b) to a time-varying argument (such as c) so that the answer is modified when either the function or the argument is.<br>
<br>Freddie<br><br><div class="gmail_quote">2009/6/10 Patai Gergely <span dir="ltr">&lt;<a href="mailto:patai_gergely@fastmail.fm">patai_gergely@fastmail.fm</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;">
<div class="im">&gt; Anyway, can you give any implementation of this example using the<br>
&gt; reactive library?<br>
</div>If b and c are signals (or behaviours as they are called in Reactive)<br>
carrying Num values of the same type, you can simply say a = b + c, and<br>
you&#39;re done. Signal a will be updated only when either b or c is<br>
updated. Note that this must be understood in the context of laziness,<br>
i.e. not a single sum is calculated until a sample of a is requested.<br>
<br>
Gergely<br>
<font color="#888888"><br>
--<br>
<a href="http://www.fastmail.fm" target="_blank">http://www.fastmail.fm</a> - One of many happy users:<br>
  <a href="http://www.fastmail.fm/docs/quotes.html" target="_blank">http://www.fastmail.fm/docs/quotes.html</a><br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Reactive mailing list<br>
<a href="mailto:Reactive@haskell.org">Reactive@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/reactive" target="_blank">http://www.haskell.org/mailman/listinfo/reactive</a><br>
</div></div></blockquote></div><br>