<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Generalizing recursion on integers</title>
	<atom:link href="http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/feed/" rel="self" type="application/rss+xml" />
	<link>http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/</link>
	<description>XSLT et cetera</description>
	<pubDate>Thu, 04 Dec 2008 22:48:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Daryl</title>
		<link>http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/#comment-41065</link>
		<dc:creator>Daryl</dc:creator>
		<pubDate>Sun, 19 Aug 2007 01:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/#comment-41065</guid>
		<description>hi i enjoyed the read</description>
		<content:encoded><![CDATA[<p>hi i enjoyed the read</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Prevost</title>
		<link>http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/#comment-41010</link>
		<dc:creator>John Prevost</dc:creator>
		<pubDate>Thu, 14 Jun 2007 21:00:03 +0000</pubDate>
		<guid isPermaLink="false">http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/#comment-41010</guid>
		<description>I agree with Dimitre here, as far as “foldr op v (take n [1 .. ])” goes.

In a way, you’re trying too hard here.  Remember that Haskell has non-strict evaluation—this means that there’s no real difference between the following:

1) a function that takes an integer and then tail calls itself with the next integer in some pre-determined sequence, and

2) a function that takes a sequence and then tail calls itself on the tail of the sequence, combined with a function that produces a pre-determined sequence.

In both cases, the next number in sequence will only be produced when it is needed—this isn’t an imperative language where returning a list means you will always be allocating and holding that list in memory.  Instead, you might think of a function that returns a list as being exactly the same thing as a function that returns a description of the process of how to produce that list.

I hope that was at least a little clearer than it sounds to me right now.  :)</description>
		<content:encoded><![CDATA[<p>I agree with Dimitre here, as far as “foldr op v (take n [1 .. ])” goes.</p>
<p>In a way, you’re trying too hard here.  Remember that Haskell has non-strict evaluation—this means that there’s no real difference between the following:</p>
<p>1) a function that takes an integer and then tail calls itself with the next integer in some pre-determined sequence, and</p>
<p>2) a function that takes a sequence and then tail calls itself on the tail of the sequence, combined with a function that produces a pre-determined sequence.</p>
<p>In both cases, the next number in sequence will only be produced when it is needed—this isn’t an imperative language where returning a list means you will always be allocating and holding that list in memory.  Instead, you might think of a function that returns a list as being exactly the same thing as a function that returns a description of the process of how to produce that list.</p>
<p>I hope that was at least a little clearer than it sounds to me right now.  <img src='http://evanlenz.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitre Novatchev</title>
		<link>http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/#comment-41009</link>
		<dc:creator>Dimitre Novatchev</dc:creator>
		<pubDate>Thu, 14 Jun 2007 19:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://evanlenz.net/blog/2007/06/14/generalizing-recursion-on-integers/#comment-41009</guid>
		<description>Hi Evan,

The function you are after is:

    foldr op v (take n  [1 .. ])


Or you could use the definition of the function 

    iter

as defined in FXSL.

Which is actually composing a function with itself N times

   f.f.f....f initval


Cheers,
Dimitre Novatchev</description>
		<content:encoded><![CDATA[<p>Hi Evan,</p>
<p>The function you are after is:</p>
<p>    foldr op v (take n  [1 .. ])</p>
<p>Or you could use the definition of the function </p>
<p>    iter</p>
<p>as defined in FXSL.</p>
<p>Which is actually composing a function with itself N times</p>
<p>   f.f.f&#8230;.f initval</p>
<p>Cheers,<br />
Dimitre Novatchev</p>
]]></content:encoded>
	</item>
</channel>
</rss>
