Thanks you all for your links,<br><br>I will read this.<br><br>However, Brent, I fail to understand your implementation of Monad... I understand the purpose, but not the algorithm.<br><br><br><div class="gmail_quote">2010/12/18 Matthew Sottile <span dir="ltr">&lt;<a href="mailto:mjsottile@mac.com">mjsottile@mac.com</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;">Hi-<br>
<br>
This may be of some interest:<br>
<br>
<a href="https://github.com/mjsottile/hsworkflow/raw/master/docs/works09paper.pdf" target="_blank">https://github.com/mjsottile/hsworkflow/raw/master/docs/works09paper.pdf</a><br>
<br>
That describes a simple project that I think is similar to what you are looking at doing.  The code is in that github repository as well, a couple directories up from the paper.<br>
<br>
<a href="https://github.com/mjsottile/hsworkflow/" target="_blank">https://github.com/mjsottile/hsworkflow/</a><br>
<font color="#888888"><br>
-m<br>
</font><div><div></div><div class="h5"><br>
<br>
On Dec 15, 2010, at 5:52 AM, Yves Parès wrote:<br>
<br>
&gt; Hello Café,<br>
&gt;<br>
&gt; I was wondering if using infinite lists was a viable and efficient solution in haskell programs (I mean not simple prototypes) :<br>
&gt; I was considering using them to model agents in a hierarchical multi-agent application for school.<br>
&gt; A list would representate the state of an agent at a step of the program.<br>
&gt;<br>
&gt; Let&#39;s say we have two simple agents, one multiplying its input by 2 and the other dividing it by 4 :<br>
&gt;<br>
&gt;<br>
&gt; agent1 = fmap (*2)<br>
&gt; agent2 = fmap (/4)<br>
&gt;<br>
&gt; allValues = xs where<br>
&gt;   ys = agent1 xs<br>
&gt;   xs = 100:agen2 ys<br>
&gt;<br>
&gt; main = do<br>
&gt;    mapM_ print $ take 100 allValues<br>
&gt;<br>
&gt;<br>
&gt; Of course, in a real program, an agent would rather take a list of multiple agents (i.e. a list of lists) in input, so that its ouput could depend on what several agents feed him.<br>
&gt;<br>
&gt; Some could state what I&#39;m trying to do is FRP, and I agree. But it remains a simple goal so I&#39;d like to keep the program simple, and not go into the whole complexity of a FRP framework (and I&#39;m working with a non-haskeller).<br>

&gt; For instance, with my solution, I cannot dynamically connect or disconnect agents during the runtime, but I&#39;ll will not need to do that in my program.<br>
&gt; Besides, I&#39;d like to try to implement this myself, not use an already existing framework.<br>
&gt;<br>
&gt; So is it viable or would the use of multiple infinite lists kill the performances?<br>
</div></div><div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br>
</div></div></blockquote></div><br>