<?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: Adding numbers</title>
	<atom:link href="http://conal.net/blog/posts/adding-numbers/feed" rel="self" type="application/rss+xml" />
	<link>http://conal.net/blog/posts/adding-numbers</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/adding-numbers#comment-782</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Sat, 06 Nov 2010 18:53:46 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=240#comment-782</guid>
		<description><![CDATA[&lt;p&gt;Daniel: thanks for the simple explanation.&lt;/p&gt;

&lt;p&gt;As noted in &lt;a href=&quot;http://conal.net/blog/src/adding-numbers/AddingMachines.hs&quot; rel=&quot;nofollow&quot;&gt;the source code&lt;/a&gt;, if I use &lt;code&gt;zipWith3&#039;&lt;/code&gt; and &lt;code&gt;init is&lt;/code&gt;, I get the first three digits out but not the last one.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Daniel: thanks for the simple explanation.</p>

<p>As noted in <a href="http://conal.net/blog/src/adding-numbers/AddingMachines.hs" rel="nofollow">the source code</a>, if I use <code>zipWith3'</code> and <code>init is</code>, I get the first three digits out but not the last one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Fischer</title>
		<link>http://conal.net/blog/posts/adding-numbers#comment-781</link>
		<dc:creator><![CDATA[Daniel Fischer]]></dc:creator>
		<pubDate>Sat, 06 Nov 2010 13:45:49 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=240#comment-781</guid>
		<description><![CDATA[&lt;p&gt;&quot;Note the mutual recursion in the two local definitions. I’m relying on the last element of is being dropped by zipWith3. I could instead pass in init is, but when I do so, no digits get out. I think the reason has to do with a subtlety in the definition of init.&quot;&lt;/p&gt;

&lt;p&gt;Not so subtle. zipWith3 pattern-matches on all three lists. (init is) is empty iff os is empty, so (assuming the digit lists to be nonempty), to decide whether it produces any output, it needs to see whether it produces any output: &lt;&gt;. The problem is that init can&#039;t deliver an item until it knows that there&#039;s a next one.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>&#8220;Note the mutual recursion in the two local definitions. I’m relying on the last element of is being dropped by zipWith3. I could instead pass in init is, but when I do so, no digits get out. I think the reason has to do with a subtlety in the definition of init.&#8221;</p>

<p>Not so subtle. zipWith3 pattern-matches on all three lists. (init is) is empty iff os is empty, so (assuming the digit lists to be nonempty), to decide whether it produces any output, it needs to see whether it produces any output: &lt;&gt;. The problem is that init can&#8217;t deliver an item until it knows that there&#8217;s a next one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: augustss</title>
		<link>http://conal.net/blog/posts/adding-numbers#comment-780</link>
		<dc:creator><![CDATA[augustss]]></dc:creator>
		<pubDate>Wed, 27 Oct 2010 08:37:14 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=240#comment-780</guid>
		<description><![CDATA[&lt;p&gt;Hmmm, I seem to remember that Russel O&#039;Connor mentioned some problem with real numbers and data abstraction, but I can&#039;t remember what.  Ask him.  Real numbers are beastly. :)&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Hmmm, I seem to remember that Russel O&#8217;Connor mentioned some problem with real numbers and data abstraction, but I can&#8217;t remember what.  Ask him.  Real numbers are beastly. <img src="http://conal.net/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/adding-numbers#comment-779</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Tue, 26 Oct 2010 23:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=240#comment-779</guid>
		<description><![CDATA[&lt;p&gt;A Twitter exchange:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;luqui: @conal, your addition is discontinuous. &lt;code&gt;addsPR add10 (repeat 9) (repeat 0) False&lt;/code&gt; gives &lt;code&gt;_&#124;_&lt;/code&gt;. There are two contradictory right answers.&lt;/p&gt;
  
  &lt;p&gt;luqui: @conal, impossible to have continuous addition with stream of digits. First digit partitions R into 2 disjoint subsets, but R is connected.&lt;/p&gt;
  
  &lt;p&gt;conal: @luqui yep. fixable with redundant number system representation + data abstraction?&lt;/p&gt;
  
  &lt;p&gt;luqui: @conal, so I have heard.  I tried for 3 or 4 hours today and couldn&#039;t quite get it.&lt;/p&gt;
&lt;/blockquote&gt;
]]></description>
		<content:encoded><![CDATA[<p>A Twitter exchange:</p>

<blockquote>
  <p>luqui: @conal, your addition is discontinuous. <code>addsPR add10 (repeat 9) (repeat 0) False</code> gives <code>_|_</code>. There are two contradictory right answers.</p>
  
  <p>luqui: @conal, impossible to have continuous addition with stream of digits. First digit partitions R into 2 disjoint subsets, but R is connected.</p>
  
  <p>conal: @luqui yep. fixable with redundant number system representation + data abstraction?</p>
  
  <p>luqui: @conal, so I have heard.  I tried for 3 or 4 hours today and couldn&#8217;t quite get it.</p>
</blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/adding-numbers#comment-778</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Tue, 26 Oct 2010 06:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=240#comment-778</guid>
		<description><![CDATA[&lt;p&gt;ja: &lt;em&gt;Shhh.&lt;/em&gt;  You&#039;re getting ahead of the story.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>ja: <em>Shhh.</em>  You&#8217;re getting ahead of the story.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ja</title>
		<link>http://conal.net/blog/posts/adding-numbers#comment-777</link>
		<dc:creator><![CDATA[ja]]></dc:creator>
		<pubDate>Tue, 26 Oct 2010 00:11:15 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=240#comment-777</guid>
		<description><![CDATA[&lt;p&gt;You might also want to check out redundant number systems.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>You might also want to check out redundant number systems.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
