<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Memoizing higher-order functions</title>
	<atom:link href="http://conal.net/blog/posts/memoizing-higher-order-functions/feed" rel="self" type="application/rss+xml" />
	<link>http://conal.net/blog/posts/memoizing-higher-order-functions</link>
	<description>Inspirations &#38; experiments, mainly about denotative/functional programming in Haskell</description>
	<lastBuildDate>Sat, 26 Sep 2020 21:06:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.17</generator>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/memoizing-higher-order-functions#comment-648</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Fri, 23 Jul 2010 21:12:06 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=119#comment-648</guid>
		<description><![CDATA[&lt;p&gt;Ah, I realized a problem in the technique described in this post.
Given a higher-order function to memoize &lt;code&gt;f :: (a -&gt; b) -&gt; c&lt;/code&gt;, if the type &lt;code&gt;a&lt;/code&gt; (the domain type&#039;s domain type) has infinitely many elements (e.g., &lt;code&gt;Integer&lt;/code&gt; or &lt;code&gt;[Bool]&lt;/code&gt;), then its corresponding trie &lt;code&gt;t :: a :-&gt;: b&lt;/code&gt; will be infinitely large.
In that case, the usual hyperstrict memoization will insist on evaluating the entire infinite trie.
I accidentally avoided this problem in my post by choosing the finite type &lt;code&gt;Bool&lt;/code&gt; for &lt;code&gt;a&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I hope &amp; suspect that &lt;a href=&quot;http://conal.net/blog/posts/nonstrict-memoization/&quot; rel=&quot;nofollow&quot;&gt;non-strict memoization&lt;/a&gt; will solve this problem.  I&#039;m working on the implementation now.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Ah, I realized a problem in the technique described in this post.
Given a higher-order function to memoize <code>f :: (a -&gt; b) -&gt; c</code>, if the type <code>a</code> (the domain type&#8217;s domain type) has infinitely many elements (e.g., <code>Integer</code> or <code>[Bool]</code>), then its corresponding trie <code>t :: a :-&gt;: b</code> will be infinitely large.
In that case, the usual hyperstrict memoization will insist on evaluating the entire infinite trie.
I accidentally avoided this problem in my post by choosing the finite type <code>Bool</code> for <code>a</code>.</p>

<p>I hope &amp; suspect that <a href="http://conal.net/blog/posts/nonstrict-memoization/" rel="nofollow">non-strict memoization</a> will solve this problem.  I&#8217;m working on the implementation now.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
