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"><<a href="mailto:mjsottile@mac.com">mjsottile@mac.com</a>></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>
> Hello Café,<br>
><br>
> I was wondering if using infinite lists was a viable and efficient solution in haskell programs (I mean not simple prototypes) :<br>
> I was considering using them to model agents in a hierarchical multi-agent application for school.<br>
> A list would representate the state of an agent at a step of the program.<br>
><br>
> Let's say we have two simple agents, one multiplying its input by 2 and the other dividing it by 4 :<br>
><br>
><br>
> agent1 = fmap (*2)<br>
> agent2 = fmap (/4)<br>
><br>
> allValues = xs where<br>
> ys = agent1 xs<br>
> xs = 100:agen2 ys<br>
><br>
> main = do<br>
> mapM_ print $ take 100 allValues<br>
><br>
><br>
> 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>
><br>
> Some could state what I'm trying to do is FRP, and I agree. But it remains a simple goal so I'd like to keep the program simple, and not go into the whole complexity of a FRP framework (and I'm working with a non-haskeller).<br>
> For instance, with my solution, I cannot dynamically connect or disconnect agents during the runtime, but I'll will not need to do that in my program.<br>
> Besides, I'd like to try to implement this myself, not use an already existing framework.<br>
><br>
> So is it viable or would the use of multiple infinite lists kill the performances?<br>
</div></div><div><div></div><div class="h5">> _______________________________________________<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>
<br>
</div></div></blockquote></div><br>