<?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: Overloading lambda</title>
	<atom:link href="http://conal.net/blog/posts/overloading-lambda/feed" rel="self" type="application/rss+xml" />
	<link>http://conal.net/blog/posts/overloading-lambda</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: Paolo G. Giarrusso</title>
		<link>http://conal.net/blog/posts/overloading-lambda#comment-868</link>
		<dc:creator><![CDATA[Paolo G. Giarrusso]]></dc:creator>
		<pubDate>Sun, 24 Aug 2014 17:06:31 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=533#comment-868</guid>
		<description><![CDATA[&lt;blockquote&gt;
  &lt;p&gt;In a category with an initial object, AFAIK it’s standard to encode constants as morphisms from the initial object.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sorry, of course I meant terminal object (1 or Unit).&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<blockquote>
  <p>In a category with an initial object, AFAIK it’s standard to encode constants as morphisms from the initial object.</p>
</blockquote>

<p>Sorry, of course I meant terminal object (1 or Unit).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paolo G. Giarrusso</title>
		<link>http://conal.net/blog/posts/overloading-lambda#comment-867</link>
		<dc:creator><![CDATA[Paolo G. Giarrusso]]></dc:creator>
		<pubDate>Sun, 24 Aug 2014 16:47:51 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=533#comment-867</guid>
		<description><![CDATA[&lt;p&gt;Answering to:&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;-- Primitives
  Prim    ∷ Prim &#040;a → b&#041; → &#040;a ↣ b&#041;
  Const   ∷ Prim       b  → &#040;a ↣ b&#041;&lt;/pre&gt;
&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’m not happy with the similarity of Prim and Const. Perhaps there’s a simpler formulation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Wouldn&#039;t you want to model &lt;code&gt;Const b&lt;/code&gt; as a primitive &lt;code&gt;p&lt;/code&gt; of type &lt;code&gt;Unit → b&lt;/code&gt;, and then construct &lt;code&gt;Prim p&lt;/code&gt; of type &lt;code&gt;Unit ↣ b&lt;/code&gt;? In a category with an initial object, AFAIK it&#039;s standard to encode constants as morphisms from the initial object.&lt;/p&gt;

&lt;p&gt;The polymorphic &lt;code&gt;a&lt;/code&gt; in &lt;code&gt;Const&lt;/code&gt; result type seems especially unfortunate, since you can inadvertently pass whatever argument (you will likely still get some error, but probably not the best one).&lt;/p&gt;

&lt;p&gt;I see you&#039;re sharing &lt;code&gt;Prim&lt;/code&gt; with Haskell code, so those constants should also be encoded without the &lt;code&gt;Unit →&lt;/code&gt; part of the type in some places. Unfortunately I don&#039;t see a perfect solution to that: it might be best to have a different type of primitives for CCCs, with a constructor for function primitives and one for constants which adds the &lt;code&gt;Unit →&lt;/code&gt; part, because that at least keeps the CCC language precisely matching its spec.&lt;/p&gt;

&lt;p&gt;(Sorry for my bad quoting, I can&#039;t find how to format comments properly, so I just tried out some Markdown dialect which kind-of-works).&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Answering to:</p>

<p>
<pre>-- Primitives
  Prim    ∷ Prim &#040;a → b&#041; → &#040;a ↣ b&#041;
  Const   ∷ Prim       b  → &#040;a ↣ b&#041;</pre>
</p>

<blockquote>
  <p>I’m not happy with the similarity of Prim and Const. Perhaps there’s a simpler formulation.</p>
</blockquote>

<p>Wouldn&#8217;t you want to model <code>Const b</code> as a primitive <code>p</code> of type <code>Unit → b</code>, and then construct <code>Prim p</code> of type <code>Unit ↣ b</code>? In a category with an initial object, AFAIK it&#8217;s standard to encode constants as morphisms from the initial object.</p>

<p>The polymorphic <code>a</code> in <code>Const</code> result type seems especially unfortunate, since you can inadvertently pass whatever argument (you will likely still get some error, but probably not the best one).</p>

<p>I see you&#8217;re sharing <code>Prim</code> with Haskell code, so those constants should also be encoded without the <code>Unit →</code> part of the type in some places. Unfortunately I don&#8217;t see a perfect solution to that: it might be best to have a different type of primitives for CCCs, with a constructor for function primitives and one for constants which adds the <code>Unit →</code> part, because that at least keeps the CCC language precisely matching its spec.</p>

<p>(Sorry for my bad quoting, I can&#8217;t find how to format comments properly, so I just tried out some Markdown dialect which kind-of-works).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conal Elliott &#187; Blog Archive &#187; Circuits as a bicartesian closed category</title>
		<link>http://conal.net/blog/posts/overloading-lambda#comment-865</link>
		<dc:creator><![CDATA[Conal Elliott &#187; Blog Archive &#187; Circuits as a bicartesian closed category]]></dc:creator>
		<pubDate>Tue, 17 Sep 2013 20:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=533#comment-865</guid>
		<description><![CDATA[&lt;p&gt;[...] previous few posts have been about cartesian closed categories (CCCs). In From Haskell to hardware via cartesian [...]&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>[&#8230;] previous few posts have been about cartesian closed categories (CCCs). In From Haskell to hardware via cartesian [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Krejsa</title>
		<link>http://conal.net/blog/posts/overloading-lambda#comment-864</link>
		<dc:creator><![CDATA[Dan Krejsa]]></dc:creator>
		<pubDate>Sat, 14 Sep 2013 23:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=533#comment-864</guid>
		<description><![CDATA[&lt;p&gt;Looking at the expression&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;apply ∘ &#040;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:curry&quot; rel=&quot;nofollow&quot;&gt;curry&lt;/a&gt; &#040;apply ∘ &#040;apply ∘ &#040;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const&quot; rel=&quot;nofollow&quot;&gt;const&lt;/a&gt; &#040;,&#041; △ &#040;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:id&quot; rel=&quot;nofollow&quot;&gt;id&lt;/a&gt; ∘ exr&#041; ∘ exr&#041; △ &#040;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:id&quot; rel=&quot;nofollow&quot;&gt;id&lt;/a&gt; ∘ exl&#041; ∘ exr&#041;&#041; △ &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:id&quot; rel=&quot;nofollow&quot;&gt;id&lt;/a&gt;&#041;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;I was asking myself, what is the interpretation of &#039;const&#039; and of &#039;(,)&#039; in the CCC?&lt;/p&gt;

&lt;p&gt;The only answer I came up with that seemed to make sense was that const is the function&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const&quot; rel=&quot;nofollow&quot;&gt;const&lt;/a&gt; :: &#040;1 ↣ b&#041; → &#040;a ↣ b&#041;
&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const&quot; rel=&quot;nofollow&quot;&gt;const&lt;/a&gt; e = e ∘ it&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;where &#039;it&#039; is the unique CCC morphism a ↣ 1, 1 being Unit; and &#039;(,)&#039; means the CCC morphism&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;&#040;,&#041; :: 1 ↣ &#040;a ⇨ &#040;b ⇨ a × b&#041;&#041;
&#040;,&#041; = &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:curry&quot; rel=&quot;nofollow&quot;&gt;curry&lt;/a&gt; &#040;&lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:curry&quot; rel=&quot;nofollow&quot;&gt;curry&lt;/a&gt; &#040;exr ∘ exl △ exr&#041;&#041;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;I was curious why your &#039;↣&#039; type representing the CCC morphisms didn&#039;t have a fundamental constructor&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;It :: a ↣ Unit&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;corresponding to &#039;it&#039;, given that a terminal object 1 (or Unit) is required? I guess you can use Const as a generalization of that, but it seems to go somewhat outside of the category language...&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>Looking at the expression</p>

<p>
<pre>apply ∘ &#040;<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:curry" rel="nofollow">curry</a> &#040;apply ∘ &#040;apply ∘ &#040;<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const" rel="nofollow">const</a> &#040;,&#041; △ &#040;<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:id" rel="nofollow">id</a> ∘ exr&#041; ∘ exr&#041; △ &#040;<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:id" rel="nofollow">id</a> ∘ exl&#041; ∘ exr&#041;&#041; △ <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:id" rel="nofollow">id</a>&#041;</pre>
</p>

<p>I was asking myself, what is the interpretation of &#8216;const&#8217; and of &#8216;(,)&#8217; in the CCC?</p>

<p>The only answer I came up with that seemed to make sense was that const is the function</p>

<p>
<pre><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const" rel="nofollow">const</a> :: &#040;1 ↣ b&#041; → &#040;a ↣ b&#041;
<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:const" rel="nofollow">const</a> e = e ∘ it</pre>
</p>

<p>where &#8216;it&#8217; is the unique CCC morphism a ↣ 1, 1 being Unit; and &#8216;(,)&#8217; means the CCC morphism</p>

<p>
<pre>&#040;,&#041; :: 1 ↣ &#040;a ⇨ &#040;b ⇨ a × b&#041;&#041;
&#040;,&#041; = <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:curry" rel="nofollow">curry</a> &#040;<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:curry" rel="nofollow">curry</a> &#040;exr ∘ exl △ exr&#041;&#041;</pre>
</p>

<p>I was curious why your &#8216;↣&#8217; type representing the CCC morphisms didn&#8217;t have a fundamental constructor</p>

<p>
<pre>It :: a ↣ Unit</pre>
</p>

<p>corresponding to &#8216;it&#8217;, given that a terminal object 1 (or Unit) is required? I guess you can use Const as a generalization of that, but it seems to go somewhat outside of the category language&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conal Elliott &#187; Blog Archive &#187; Optimizing CCCs</title>
		<link>http://conal.net/blog/posts/overloading-lambda#comment-863</link>
		<dc:creator><![CDATA[Conal Elliott &#187; Blog Archive &#187; Optimizing CCCs]]></dc:creator>
		<pubDate>Sat, 14 Sep 2013 01:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://conal.net/blog/?p=533#comment-863</guid>
		<description><![CDATA[&lt;p&gt;[...] the post Overloading lambda, I gave a translation from a typed lambda calculus into the vocabulary of cartesian closed [...]&lt;/p&gt;
]]></description>
		<content:encoded><![CDATA[<p>[&#8230;] the post Overloading lambda, I gave a translation from a typed lambda calculus into the vocabulary of cartesian closed [&#8230;]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
