<div dir="ltr">Hi Bernie,<br><br>I like your much more. I tried also to find a solution using cycle but didn&#39;t succeed.<br><br>Thank you,<br>Dirk<br><br><div class="gmail_quote">2008/7/21 Bernie Pope &lt;<a href="mailto:bjpop@csse.unimelb.edu.au">bjpop@csse.unimelb.edu.au</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Dirk,<br>
<br>
I doubt this is &quot;easier&quot;, but it is a nice opportunity to show off some cyclic programming:<br>
<br>
 &nbsp; suffix = 5 : [ x + y | (x,y) &lt;- zip suffix (cycle [2,4])]<br>
 &nbsp; list = 2 : 3 : suffix<br>
<br>
cycle is from the Prelude and is used above to build an &quot;infinite&quot; list of [2,4,2,4 ...]<br>
<br>
Note that suffix is recursive. Lazy evaluation allows us to pull values out of it whilst building it at the same time. Obviously it is important that we start building the list before trying to pull any values out of it, hence the &quot;5 :&quot; at the start is important.<br>

<br>
I may not have answered your question, but hopefully it is interesting nonetheless.<br>
<br>
Cheers,<br><font color="#888888">
Bernie.<br>
<br>
<br>
</font></blockquote></div><br></div>