Thanks for your answers. In fact I tried to use Simple with a clock signal and it&#39;s painful to pass it wherever you need it. Param is much more practical.<br>I like Elerea, I tried Reactive and Yampa, and I found them (especially Yampa) heavy and not very practical.<br>
The fact that Elerea is minimalistic makes it easier to learn/use and more flexible.<br><br><div class="gmail_quote">2010/12/23 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="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">&gt; fromList :: [a] -&gt; SignalGen (Signal a)<br>
&gt; fromList xs =<br>
&gt;   stateful xs tail &gt;&gt;= memo . fmap head<br>
&gt;<br>
&gt; 1) It does what I want, but is it the good way to do it?<br>
</div>Yes, I&#39;d do it the same way, assuming that the input is always an<br>
infinite list (so this version should probably be called<br>
unsafeFromList...). But you can always make a list infinite, just add a<br>
Maybe layer or pad with a default value.<br>
<div class="im"><br>
&gt; 2) Since the returned signal may be used in several places and since I<br>
&gt; obtain it through the generic fmap (and not through an Elerea primitive),<br>
&gt; I guessed I had to &quot;memo&quot; it instead of simply using &quot;return&quot;. Did I guess<br>
&gt; right?<br>
</div>That&#39;s exactly what memo is needed for, yes. However, whether it is<br>
worth the overhead in such a simple case (after all, head is essentially<br>
just a single dereferencing step) should be determined by profiling.<br>
<div class="im"><br>
&gt; 3) Concerning the functionnality added by the Param implementation, I<br>
&gt; have<br>
&gt; the impression that the same can be achieved through the use of an<br>
&gt; external<br>
&gt; signal in Simple (*). Am I right?<br>
</div>Yes, the two are equally expressive. The difference is the way you<br>
access the signals. In the case of Param, you get a globally accessible<br>
signal that you don&#39;t need to pass around explicitly, just retrieve with<br>
&#39;input&#39; wherever you want. This might be useful when there&#39;s some<br>
ubiquitous piece of information that you need practically everywhere,<br>
e.g. real time for a simulation.<br>
<br>
Gergely<br>
<font color="#888888"><br>
--<br>
<a href="http://www.fastmail.fm" target="_blank">http://www.fastmail.fm</a> - Does exactly what it says on the tin<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>