<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Adventures in F#--Corecursion</title><link>http://blogs.msdn.com/jomo_fisher/archive/2007/09/24/adventures-in-f-corecursion.aspx</link><description>Jomo Fisher--In a prior post I touched on recursion in F#. One of the comments was about mutually recursive functions. The example given was, let f1 a do print a f2 a let f2 a do print a f1 a f1 1 It turns out that this F# doesn't compile because F# scoping</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>MSDN Blog Postings  &amp;raquo; Adventures in F#--Corecursion</title><link>http://blogs.msdn.com/jomo_fisher/archive/2007/09/24/adventures-in-f-corecursion.aspx#5103534</link><pubDate>Mon, 24 Sep 2007 21:12:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5103534</guid><dc:creator>MSDN Blog Postings  » Adventures in F#--Corecursion</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://msdnrss.thecoderblogs.com/2007/09/24/adventures-in-f-corecursion/"&gt;http://msdnrss.thecoderblogs.com/2007/09/24/adventures-in-f-corecursion/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Adventures in F#--Corecursion</title><link>http://blogs.msdn.com/jomo_fisher/archive/2007/09/24/adventures-in-f-corecursion.aspx#5135544</link><pubDate>Wed, 26 Sep 2007 07:24:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5135544</guid><dc:creator>Jon Harrop</dc:creator><description>&lt;p&gt;I found it enlightening to write a pair of mutually recursive functions that extract alternate elements from a given list to return a pair of lists that contain the elements with even and odd indexes, respectively.&lt;/p&gt;</description></item><item><title>Tail</title><link>http://blogs.msdn.com/jomo_fisher/archive/2007/09/24/adventures-in-f-corecursion.aspx#5167118</link><pubDate>Thu, 27 Sep 2007 15:51:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5167118</guid><dc:creator>Finnsson</dc:creator><description>&lt;p&gt;Cool. So F# is using ”tail” after all. What I still don't understand is why F# bother with the rec keyword, since it should be trivial to calculate if tail call optimization is possible or not (and since rec anyway have to make sure that tail call optimization is permitted).&lt;/p&gt;
&lt;p&gt;Another strange thing is that F# is making f1 and f2 generic since neither f1 nor f2 can return anything else than int. I would love if F# could type infere f1 and f2 to both int and float in this case, but I don't think it can - so why bother with the generics? Is it something I'm missing here?&lt;/p&gt;</description></item><item><title>re: Adventures in F#--Corecursion</title><link>http://blogs.msdn.com/jomo_fisher/archive/2007/09/24/adventures-in-f-corecursion.aspx#5883016</link><pubDate>Sun, 04 Nov 2007 14:29:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5883016</guid><dc:creator>Jon Harrop</dc:creator><description>&lt;p&gt;Finnsson,&lt;/p&gt;
&lt;p&gt;F# has a &amp;quot;rec&amp;quot; keyword because it is often very useful to supercede definitions in a functional language. So you often want a not-rec let binding.&lt;/p&gt;
&lt;p&gt;Regarding the inferred types of the &amp;quot;f1&amp;quot; and &amp;quot;f2&amp;quot; functions, these functions never return so F# correctly infers generic types for their return types. This is just one example of type inference providing you with assurances about your code. If the compiler inferred a return type of &amp;quot;int&amp;quot; for a function that should never return then you know that you have made a mistake.&lt;/p&gt;
&lt;p&gt;You can learn to leverage F#'s type inference and static type checking to write more robust code. This is described in detail in some of our F#.NET Journal articles. These tricks make it much easier to write complicated code in F#.&lt;/p&gt;</description></item><item><title>Discoveries This Week 06/21/2009</title><link>http://blogs.msdn.com/jomo_fisher/archive/2007/09/24/adventures-in-f-corecursion.aspx#9796679</link><pubDate>Mon, 22 Jun 2009 04:39:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9796679</guid><dc:creator>Rick Minerich's Development Wonderland</dc:creator><description>&lt;p&gt;Almost too much to keep up with this week.&amp;amp;#160; Most notably, Roger Castillo gave a fantastic talk on&lt;/p&gt;
</description></item><item><title>re: Adventures in F#--Corecursion</title><link>http://blogs.msdn.com/jomo_fisher/archive/2007/09/24/adventures-in-f-corecursion.aspx#9797729</link><pubDate>Mon, 22 Jun 2009 17:46:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9797729</guid><dc:creator>James Hugard</dc:creator><description>&lt;p&gt;Just as a note, tailcall is disabled in debug mode as of Beta 1. &amp;nbsp;This preserves stack frames, often simplifying debugging.&lt;/p&gt;</description></item></channel></rss>