<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Functional Programming on Boyang Yue</title><link>http://blog.boyangyue.com/tags/functional-programming/</link><description>Recent content in Functional Programming on Boyang Yue</description><generator>Hugo</generator><language>en-us</language><copyright>A Good Year Ahead</copyright><lastBuildDate>Mon, 30 Nov 2020 09:47:00 +0900</lastBuildDate><atom:link href="http://blog.boyangyue.com/tags/functional-programming/index.xml" rel="self" type="application/rss+xml"/><item><title>Recursion, Iteration, and the Hidden Stack</title><link>http://blog.boyangyue.com/2020/11/recursion-iteration-and-the-hidden-stack/</link><pubDate>Mon, 30 Nov 2020 09:47:00 +0900</pubDate><guid>http://blog.boyangyue.com/2020/11/recursion-iteration-and-the-hidden-stack/</guid><description>&lt;p&gt;Repeated computation has two common surface forms. In an imperative loop, a counter or other state changes until a condition fails. In recursion, a function calls itself on a smaller or later version of the problem, and the runtime remembers what remains to be done.&lt;/p&gt;
&lt;p&gt;Imperative languages expose loops directly through constructs such as &lt;code&gt;for&lt;/code&gt; and &lt;code&gt;while&lt;/code&gt;. In pure functional programming languages like &lt;a href="https://www.haskell.org/" target="_blank" rel="nofollow noopener noreferrer"&gt;Haskell&lt;/a&gt;, however, there is no primitive imperative &lt;code&gt;for&lt;/code&gt;/&lt;code&gt;while&lt;/code&gt; syntax. That makes Haskell a useful place to ask the question directly: if the loop disappears from the language, what replaces it?&lt;/p&gt;</description></item></channel></rss>