<?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: Proofs for left fold zipping</title>
	<atom:link href="http://conal.net/blog/posts/proofs-for-left-fold-zipping/feed" rel="self" type="application/rss+xml" />
	<link>http://conal.net/blog/posts/proofs-for-left-fold-zipping</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; Enhancing a Zip</title>
		<link>http://conal.net/blog/posts/proofs-for-left-fold-zipping#comment-202</link>
		<dc:creator><![CDATA[Conal Elliott &#187; Blog Archive &#187; Enhancing a Zip]]></dc:creator>
		<pubDate>Thu, 30 May 2013 17:03:53 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=60#comment-202</guid>
		<description><![CDATA[&lt;p&gt;[...] Part Three proved the suitability of the zipping definitions in Part Two. [...]&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>[&#8230;] Part Three proved the suitability of the zipping definitions in Part Two. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/proofs-for-left-fold-zipping#comment-201</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Sun, 16 Nov 2008 06:16:07 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=60#comment-201</guid>
		<description><![CDATA[&lt;p&gt;I think lazy patterns do indeed fix the &#8869; bug.
For instance,&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&gt;cfoldl ~&lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;F op e&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; = &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:foldl&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;foldl&lt;/span&gt;&lt;/a&gt; op e
&#160;
~&lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;F op e&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; `&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;zip&lt;/span&gt;&lt;/a&gt;` ~&lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;F op&#039; e&#039;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; = F op&#039;&#039; &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;e,e&#039;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;
 &lt;span style=&quot;color: #050; font-weight: bold;&quot;&gt;where&lt;/span&gt;
   ~&lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;a,a&#039;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; `op&#039;&#039;` b = &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;a `op` b, a&#039; `op&#039;` b&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Then&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&gt;cfoldl &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; == cfoldl &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;F &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;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;/pre&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&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;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;zip&lt;/span&gt;&lt;/a&gt;` f&#039; == F &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;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;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;zip&lt;/span&gt;&lt;/a&gt;` f&#039;
&#160;
f `&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;zip&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; == f `&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;zip&lt;/span&gt;&lt;/a&gt;` F &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;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;/pre&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;So, although &lt;code&gt;undefined&lt;/code&gt; does not have the form &lt;code&gt;(F op e)&lt;/code&gt;, it is equivalent to such a form in the context of &lt;code&gt;cfoldl&lt;/code&gt; and of &lt;code&gt;zip&lt;/code&gt;, as in the morphism property:&lt;/p&gt;

&lt;p&gt;&lt;div&gt;
&lt;pre class=&quot;haskell&quot;&gt;cfoldl &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;f `&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;zip&lt;/span&gt;&lt;/a&gt;` f&#039;&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt; bs == &lt;span style=&quot;color: green;&quot;&gt;&#040;&lt;/span&gt;cfoldl f bs, cfoldl f&#039; bs&lt;span style=&quot;color: green;&quot;&gt;&#041;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;I&#039;m not sure what to make of this result.
Can one always play this lazy pattern trick?
I don&#039;t think so, in the case of multiple constructors.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>I think lazy patterns do indeed fix the &perp; bug.
For instance,</p>

<p><div>
<pre class="haskell">cfoldl ~<span style="color: green;">&#40;</span>F op e<span style="color: green;">&#41;</span> = <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:foldl" rel="nofollow"><span style="font-weight: bold;">foldl</span></a> op e
&nbsp;
~<span style="color: green;">&#40;</span>F op e<span style="color: green;">&#41;</span> `<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip" rel="nofollow"><span style="font-weight: bold;">zip</span></a>` ~<span style="color: green;">&#40;</span>F op' e'<span style="color: green;">&#41;</span> = F op'' <span style="color: green;">&#40;</span>e,e'<span style="color: green;">&#41;</span>
 <span style="color: #050; font-weight: bold;">where</span>
   ~<span style="color: green;">&#40;</span>a,a'<span style="color: green;">&#41;</span> `op''` b = <span style="color: green;">&#40;</span>a `op` b, a' `op'` b<span style="color: green;">&#41;</span></pre>
</div></p>

<p>Then</p>

<p><div>
<pre class="haskell">cfoldl <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> == cfoldl <span style="color: green;">&#40;</span>F <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> <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></pre>
</div></p>

<p>and</p>

<p><div>
<pre class="haskell"><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> `<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip" rel="nofollow"><span style="font-weight: bold;">zip</span></a>` f' == F <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> <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> `<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip" rel="nofollow"><span style="font-weight: bold;">zip</span></a>` f'
&nbsp;
f `<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip" rel="nofollow"><span style="font-weight: bold;">zip</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> == f `<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip" rel="nofollow"><span style="font-weight: bold;">zip</span></a>` F <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> <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></pre>
</div></p>

<p>So, although <code>undefined</code> does not have the form <code>(F op e)</code>, it is equivalent to such a form in the context of <code>cfoldl</code> and of <code>zip</code>, as in the morphism property:</p>

<p><div>
<pre class="haskell">cfoldl <span style="color: green;">&#40;</span>f `<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip" rel="nofollow"><span style="font-weight: bold;">zip</span></a>` f'<span style="color: green;">&#41;</span> bs == <span style="color: green;">&#40;</span>cfoldl f bs, cfoldl f' bs<span style="color: green;">&#41;</span></pre>
</div></p>

<p>I&#8217;m not sure what to make of this result.
Can one always play this lazy pattern trick?
I don&#8217;t think so, in the case of multiple constructors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: conal</title>
		<link>http://conal.net/blog/posts/proofs-for-left-fold-zipping#comment-200</link>
		<dc:creator><![CDATA[conal]]></dc:creator>
		<pubDate>Sun, 16 Nov 2008 02:46:17 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=60#comment-200</guid>
		<description><![CDATA[&lt;p&gt;Ryan,&lt;/p&gt;

&lt;p&gt;Thanks for catching and pointing out my mistake.  I accidentally omitted &#8869;, and I agree that my mistake is exactly where you pointed out (&quot;We’ll want some structure ....&quot;).&lt;/p&gt;

&lt;p&gt;Perhaps this problem has an easy fix, using lazy pattern matching in definitions like &lt;code&gt;zipF&lt;/code&gt;.&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Ryan,</p>

<p>Thanks for catching and pointing out my mistake.  I accidentally omitted &perp;, and I agree that my mistake is exactly where you pointed out (&#8220;We’ll want some structure &#8230;.&#8221;).</p>

<p>Perhaps this problem has an easy fix, using lazy pattern matching in definitions like <code>zipF</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Ingram</title>
		<link>http://conal.net/blog/posts/proofs-for-left-fold-zipping#comment-199</link>
		<dc:creator><![CDATA[Ryan Ingram]]></dc:creator>
		<pubDate>Sun, 16 Nov 2008 02:21:04 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=60#comment-199</guid>
		<description><![CDATA[&lt;p&gt;One thing I&#039;ve noticed about your proofs is that you play a bit fast and loose with &lt;em&gt;&#8869;&lt;/em&gt;; the line in this proof is &quot;We&#039;ll want some structure on our folds as well&quot;.  Now, it&#039;s not true that &lt;code&gt;cfoldl (undefined `zip` undefined) bs == (cfoldl undefined bs, cfoldl undefined bs)&lt;/code&gt;; the former is &lt;em&gt;&#8869;&lt;/em&gt; whereas the latter is (&lt;em&gt;&#8869;&lt;/em&gt;, &lt;em&gt;&#8869;&lt;/em&gt;).  That said, I don&#039;t really disagree with your results; I often do the same things in my informal proofs.  But is there any justification for ignoring &lt;em&gt;&#8869;&lt;/em&gt;?  Can we just say &quot;you shouldn&#039;t use undefined folds&quot; and leave it at that?&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>One thing I&#8217;ve noticed about your proofs is that you play a bit fast and loose with <em>&perp;</em>; the line in this proof is &#8220;We&#8217;ll want some structure on our folds as well&#8221;.  Now, it&#8217;s not true that <code>cfoldl (undefined `zip` undefined) bs == (cfoldl undefined bs, cfoldl undefined bs)</code>; the former is <em>&perp;</em> whereas the latter is (<em>&perp;</em>, <em>&perp;</em>).  That said, I don&#8217;t really disagree with your results; I often do the same things in my informal proofs.  But is there any justification for ignoring <em>&perp;</em>?  Can we just say &#8220;you shouldn&#8217;t use undefined folds&#8221; and leave it at that?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
