<?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: Non-strict memoization</title>
	<atom:link href="http://conal.net/blog/posts/nonstrict-memoization/feed" rel="self" type="application/rss+xml" />
	<link>http://conal.net/blog/posts/nonstrict-memoization</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 Elliott &#187; Blog Archive &#187; Details for non-strict memoization, part 1</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-640</link>
		<dc:creator><![CDATA[Conal Elliott &#187; Blog Archive &#187; Details for non-strict memoization, part 1]]></dc:creator>
		<pubDate>Fri, 10 Sep 2010 23:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-640</guid>
		<description><![CDATA[&lt;p&gt;[...] Non-strict memoization, I sketched out a means of memoizing non-strict functions. I gave the essential insight but did not [...]&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>[&#8230;] Non-strict memoization, I sketched out a means of memoizing non-strict functions. I gave the essential insight but did not [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conal Elliott &#187; Blog Archive &#187; Memoizing higher-order functions</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-639</link>
		<dc:creator><![CDATA[Conal Elliott &#187; Blog Archive &#187; Memoizing higher-order functions]]></dc:creator>
		<pubDate>Thu, 22 Jul 2010 19:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-639</guid>
		<description><![CDATA[&lt;p&gt;[...] does nonstrict memoization fit in with higher-order memoization?   var flattr_wp_ver = &#039;0.9.5&#039;; var flattr_uid = &#039;17223&#039;; var [...]&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>[&#8230;] does nonstrict memoization fit in with higher-order memoization?   var flattr_wp_ver = &#39;0.9.5&#39;; var flattr_uid = &#39;17223&#39;; var [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-638</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Wed, 14 Jul 2010 22:54:25 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-638</guid>
		<description><![CDATA[&lt;p&gt;Sebastian:&lt;/p&gt;

&lt;p&gt;I was running out of energy, and the post was running long, and hence the sketchy section.
I think I&#039;ll release a new library soon, and at the least, I&#039;ll mention it with your example as a comment here.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Sebastian:</p>

<p>I was running out of energy, and the post was running long, and hence the sketchy section.
I think I&#8217;ll release a new library soon, and at the least, I&#8217;ll mention it with your example as a comment here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-637</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Wed, 14 Jul 2010 22:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-637</guid>
		<description><![CDATA[&lt;p&gt;Hi Job,&lt;/p&gt;

&lt;p&gt;For integral types, even including &lt;code&gt;Integer&lt;/code&gt; (unbounded), one can use a structure like a Patricia tree.
See Chris Okasaki and Andy Gill&#039;s paper, &lt;em&gt;&lt;a href=&quot;http://citeseer.ist.psu.edu/okasaki98fast.html&quot; rel=&quot;nofollow&quot;&gt;Fast Mergeable Integer Maps&lt;/a&gt;&lt;/em&gt; or the &lt;code&gt;Word&lt;/code&gt; instance of &lt;code&gt;HasTrie&lt;/code&gt; in  &lt;em&gt;&lt;a href=&quot;http://conal.net/blog/posts/elegant-memoization-with-functional-memo-tries/&quot; rel=&quot;nofollow&quot;&gt;Elegant memoization with functional memo tries&lt;/a&gt;&lt;/em&gt;.
For signed types (like &lt;code&gt;Int&lt;/code&gt; and &lt;code&gt;Integer&lt;/code&gt;), one has to handle negative and non-negative keys.
You can find the details in Luke Palmer&#039;s &lt;a href=&quot;http://hackage.haskell.org/packages/archive/data-inttrie/0.0.3/doc/html/src/Data-IntTrie.html&quot; rel=&quot;nofollow&quot;&gt;data-inttrie package&lt;/a&gt;.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Hi Job,</p>

<p>For integral types, even including <code>Integer</code> (unbounded), one can use a structure like a Patricia tree.
See Chris Okasaki and Andy Gill&#8217;s paper, <em><a href="http://citeseer.ist.psu.edu/okasaki98fast.html" rel="nofollow">Fast Mergeable Integer Maps</a></em> or the <code>Word</code> instance of <code>HasTrie</code> in  <em><a href="http://conal.net/blog/posts/elegant-memoization-with-functional-memo-tries/" rel="nofollow">Elegant memoization with functional memo tries</a></em>.
For signed types (like <code>Int</code> and <code>Integer</code>), one has to handle negative and non-negative keys.
You can find the details in Luke Palmer&#8217;s <a href="http://hackage.haskell.org/packages/archive/data-inttrie/0.0.3/doc/html/src/Data-IntTrie.html" rel="nofollow">data-inttrie package</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Job Vranish</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-636</link>
		<dc:creator><![CDATA[Job Vranish]]></dc:creator>
		<pubDate>Wed, 14 Jul 2010 20:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-636</guid>
		<description><![CDATA[&lt;p&gt;Neat!
Any idea what a memo table type for Int would look like? It seems like such a thing would have some pretty severe restrictions&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Neat!
Any idea what a memo table type for Int would look like? It seems like such a thing would have some pretty severe restrictions</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Fischer</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-635</link>
		<dc:creator><![CDATA[Sebastian Fischer]]></dc:creator>
		<pubDate>Wed, 14 Jul 2010 19:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-635</guid>
		<description><![CDATA[&lt;p&gt;Very interesting!&lt;/p&gt;

&lt;p&gt;Your remarks under &quot;Beyond Bool&quot; are a little sketchy. I was missing a demo of memoizing a function like &lt;code&gt;and . take 10&lt;/code&gt; on &lt;code&gt;repeat True&lt;/code&gt; and &lt;code&gt;False:undefined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I guess it works as expected but it would be nice to be convinced by an example!&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Very interesting!</p>

<p>Your remarks under &#8220;Beyond Bool&#8221; are a little sketchy. I was missing a demo of memoizing a function like <code>and . take 10</code> on <code>repeat True</code> and <code>False:undefined</code>.</p>

<p>I guess it works as expected but it would be nice to be convinced by an example!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-634</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Wed, 14 Jul 2010 16:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-634</guid>
		<description><![CDATA[&lt;p&gt;Hi Nikolay,&lt;/p&gt;

&lt;p&gt;Let&#039;s give it a try:&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&gt;h4, s4,n4 :: &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Bool&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;color: #833; font-weight: bold;&quot;&gt;Bool&lt;/span&gt;&lt;/a&gt; -&gt; &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Integer&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;color: #833; font-weight: bold;&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt;,&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Integer&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;color: #833; font-weight: bold;&quot;&gt;Integer&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;
h4 = &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;const&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;undefined&lt;/span&gt;&lt;/a&gt;, &lt;span style=&quot;color: red;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;
s4 = memoBoolStrict h4
n4 = memoBool h4&lt;/pre&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Testing:&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&gt;*Main&gt; &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:snd&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;snd&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;h4 &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;undefined&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;    &lt;span style=&quot;color: #5d478b; font-style: italic;&quot;&gt;-- original&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;4&lt;/span&gt;
*Main&gt; &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:snd&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;snd&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;s4 &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;undefined&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;    &lt;span style=&quot;color: #5d478b; font-style: italic;&quot;&gt;-- strict&lt;/span&gt;
*** Exception: &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;colo: #050; font-weight: bold;&quot;&gt;Prelude&lt;/span&gt;&lt;/a&gt;.&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;undefined&lt;/span&gt;&lt;/a&gt;
*Main&gt; &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:snd&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;snd&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;n4 &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;undefined&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;    &lt;span style=&quot;color: #5d478b; font-style: italic;&quot;&gt;-- nonstrict&lt;/span&gt;
&lt;span style=&quot;color: red;&quot;&gt;4&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Looks good.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Hi Nikolay,</p>

<p>Let&#8217;s give it a try:</p>

<p><div>
<pre class="haskell">h4, s4,n4 :: <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Bool" rel="nofollow"><span style="color: #833; font-weight: bold;">Bool</span></a> -&gt; <span style="color: green;">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Integer" rel="nofollow"><span style="color: #833; font-weight: bold;">Integer</span></a>,<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Integer" rel="nofollow"><span style="color: #833; font-weight: bold;">Integer</span></a><span style="color: green;">&#41;</span>
h4 = <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const" rel="nofollow"><span style="font-weight: bold;">const</span></a> <span style="color: green;">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined" rel="nofollow"><span style="font-weight: bold;">undefined</span></a>, <span style="color: red;">4</span><span style="color: green;">&#41;</span>
s4 = memoBoolStrict h4
n4 = memoBool h4</pre>
</div></p>

<p>Testing:</p>

<p><div>
<pre class="haskell">*Main&gt; <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:snd" rel="nofollow"><span style="font-weight: bold;">snd</span></a> <span style="color: green;">&#40;</span>h4 <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined" rel="nofollow"><span style="font-weight: bold;">undefined</span></a><span style="color: green;">&#41;</span>    <span style="color: #5d478b; font-style: italic;">-- original</span>
<span style="color: red;">4</span>
*Main&gt; <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:snd" rel="nofollow"><span style="font-weight: bold;">snd</span></a> <span style="color: green;">&#40;</span>s4 <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined" rel="nofollow"><span style="font-weight: bold;">undefined</span></a><span style="color: green;">&#41;</span>    <span style="color: #5d478b; font-style: italic;">-- strict</span>
*** Exception: <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html" rel="nofollow"><span style="colo: #050; font-weight: bold;">Prelude</span></a>.<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined" rel="nofollow"><span style="font-weight: bold;">undefined</span></a>
*Main&gt; <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:snd" rel="nofollow"><span style="font-weight: bold;">snd</span></a> <span style="color: green;">&#40;</span>n4 <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:undefined" rel="nofollow"><span style="font-weight: bold;">undefined</span></a><span style="color: green;">&#41;</span>    <span style="color: #5d478b; font-style: italic;">-- nonstrict</span>
<span style="color: red;">4</span></pre>
</div></p>

<p>Looks good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikolay Orlyuk</title>
		<link>http://conal.net/blog/posts/nonstrict-memoization#comment-633</link>
		<dc:creator><![CDATA[Nikolay Orlyuk]]></dc:creator>
		<pubDate>Wed, 14 Jul 2010 11:57:44 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=110#comment-633</guid>
		<description><![CDATA[&lt;p&gt;There may be a problem with memoization of nonstrict result.&lt;/p&gt;

&lt;pre&gt;
h3, s3 :: Bool -&gt; Integer
h3 = const (undefined, 3)
s3 = memoBoolStrict h3
&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;snd (s3 (undefined))&lt;/code&gt;&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>There may be a problem with memoization of nonstrict result.</p>

<pre>
h3, s3 :: Bool -&gt; Integer
h3 = const (undefined, 3)
s3 = memoBoolStrict h3
</pre>

<p><code>snd (s3 (undefined))</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
