<?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: Functional Data Structures Out Of Nowhere</title>
	<atom:link href="http://offthelip.org/?feed=rss2&#038;p=103" rel="self" type="application/rss+xml" />
	<link>http://offthelip.org/?p=103</link>
	<description>Code weavings for the surf addicts</description>
	<lastBuildDate>Thu, 19 Aug 2010 01:12:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: -= Linkage 2007.03.05 =-</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-7146</link>
		<dc:creator>-= Linkage 2007.03.05 =-</dc:creator>
		<pubDate>Mon, 26 Jan 2009 15:38:03 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-7146</guid>
		<description>[...] Functional Data Structures out of Nowhere&lt;br/&gt; [...]</description>
		<content:encoded><![CDATA[<p>[...] Functional Data Structures out of Nowhere&lt;br/&gt; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Off The Lip &#187; The Problem With Assignment</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-3185</link>
		<dc:creator>Off The Lip &#187; The Problem With Assignment</dc:creator>
		<pubDate>Mon, 21 Apr 2008 14:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-3185</guid>
		<description>[...] again (please bear with me for a moment even if this sounds like my last post), a good start would be a purely functional definition of pairs and the corresponding extraction [...]</description>
		<content:encoded><![CDATA[<p>[...] again (please bear with me for a moment even if this sounds like my last post), a good start would be a purely functional definition of pairs and the corresponding extraction [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sp3w &#187; Blog Archive &#187; Linkage 2007.03.05</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2811</link>
		<dc:creator>Sp3w &#187; Blog Archive &#187; Linkage 2007.03.05</dc:creator>
		<pubDate>Wed, 05 Mar 2008 16:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2811</guid>
		<description>[...] Functional Data Structures out of Nowhere [...]</description>
		<content:encoded><![CDATA[<p>[...] Functional Data Structures out of Nowhere [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jonathan</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2804</link>
		<dc:creator>jonathan</dc:creator>
		<pubDate>Tue, 04 Mar 2008 15:39:53 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2804</guid>
		<description>Very interesting. Python version:

&gt;&gt;&gt; def Pair(a, b):
...  return lambda pick: b if pick &gt; 0 else a
&gt;&gt;&gt; def head(p): return p(0)
...
&gt;&gt;&gt; def tail(p): return p(1)
...
&gt;&gt;&gt; head(Pair(3, &#039;b&#039;))
3</description>
		<content:encoded><![CDATA[<p>Very interesting. Python version:</p>
<p>&gt;&gt;&gt; def Pair(a, b):<br />
&#8230;  return lambda pick: b if pick &gt; 0 else a<br />
&gt;&gt;&gt; def head(p): return p(0)<br />
&#8230;<br />
&gt;&gt;&gt; def tail(p): return p(1)<br />
&#8230;<br />
&gt;&gt;&gt; head(Pair(3, &#8216;b&#8217;))<br />
3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Welker</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2803</link>
		<dc:creator>Eddie Welker</dc:creator>
		<pubDate>Tue, 04 Mar 2008 13:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2803</guid>
		<description>Those videos are fun, I&#039;ve been watching them intermittently for a couple of weeks now.  I think it is the fact that they&#039;re still relevant... and from an era where things were vastly different.

Anyway, haven&#039;t gotten to this lecture yet, but I&#039;ll be sure to revisit when I do.</description>
		<content:encoded><![CDATA[<p>Those videos are fun, I&#8217;ve been watching them intermittently for a couple of weeks now.  I think it is the fact that they&#8217;re still relevant&#8230; and from an era where things were vastly different.</p>
<p>Anyway, haven&#8217;t gotten to this lecture yet, but I&#8217;ll be sure to revisit when I do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe Grand</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2801</link>
		<dc:creator>Christophe Grand</dc:creator>
		<pubDate>Tue, 04 Mar 2008 11:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2801</guid>
		<description>What Cale suggests, in js:

# js&gt; var Pair = function(a,b) { return function(pick) { return pick(a, b); } };  
# js&gt; var head = function(p) { return p(function(a) {return a}); };  
# js&gt; var tail = function(p) { return p(function(_, b) {return b}); }  
# js&gt; head(Pair(3,&#039;b&#039;));</description>
		<content:encoded><![CDATA[<p>What Cale suggests, in js:</p>
<p># js&gt; var Pair = function(a,b) { return function(pick) { return pick(a, b); } };<br />
# js&gt; var head = function(p) { return p(function(a) {return a}); };<br />
# js&gt; var tail = function(p) { return p(function(_, b) {return b}); }<br />
# js&gt; head(Pair(3,&#8217;b'));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin&#8217;s Link Blog &#187; Functional Structures</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2800</link>
		<dc:creator>Kevin&#8217;s Link Blog &#187; Functional Structures</dc:creator>
		<pubDate>Tue, 04 Mar 2008 10:32:59 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2800</guid>
		<description>[...] Functional Structures Out Of Nowhere [...]</description>
		<content:encoded><![CDATA[<p>[...] Functional Structures Out Of Nowhere [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Tauber</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2799</link>
		<dc:creator>James Tauber</dc:creator>
		<pubDate>Tue, 04 Mar 2008 09:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2799</guid>
		<description>Stevan,

Typo in your comment on FALSE. Should be

# FALSE := Î» x. Î» y. y</description>
		<content:encoded><![CDATA[<p>Stevan,</p>
<p>Typo in your comment on FALSE. Should be</p>
<p># FALSE := Î» x. Î» y. y</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stevan Little</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2796</link>
		<dc:creator>Stevan Little</dc:creator>
		<pubDate>Mon, 03 Mar 2008 22:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2796</guid>
		<description>
If you are looking for a more pure Lambda Calc approach, you could start with some Church Booleans and then use those to build your pair with. Here is an example of that using Perl

# TRUE := Î» x. Î» y. x
sub TRUE {
    my $x = shift;
    sub { $x }
}

# FALSE := Î» x. Î» y. x
sub FALSE {
    my $x = shift;
    sub { shift }
}

# pair := Î» f. Î» s. Î» b. b f s
sub pair {
    my $f = shift;
    sub {
        my $s = shift;
        sub {
            my $b = shift;
            $b-&gt;($f)-&gt;($s);
        }
    }
}

# head := Î» p p TRUE
sub head {
    my $p = shift;
    $p-&gt;(\&amp;TRUE)
}

# tail := Î» p p FALSE
sub tail {
    my $p = shift;
    $p-&gt;(\&amp;FALSE)
}

From here you can implement lists and so forth. 

- Stevan</description>
		<content:encoded><![CDATA[<p>If you are looking for a more pure Lambda Calc approach, you could start with some Church Booleans and then use those to build your pair with. Here is an example of that using Perl</p>
<p># TRUE := Î» x. Î» y. x<br />
sub TRUE {<br />
    my $x = shift;<br />
    sub { $x }<br />
}</p>
<p># FALSE := Î» x. Î» y. x<br />
sub FALSE {<br />
    my $x = shift;<br />
    sub { shift }<br />
}</p>
<p># pair := Î» f. Î» s. Î» b. b f s<br />
sub pair {<br />
    my $f = shift;<br />
    sub {<br />
        my $s = shift;<br />
        sub {<br />
            my $b = shift;<br />
            $b-&gt;($f)-&gt;($s);<br />
        }<br />
    }<br />
}</p>
<p># head := Î» p p TRUE<br />
sub head {<br />
    my $p = shift;<br />
    $p-&gt;(\&amp;TRUE)<br />
}</p>
<p># tail := Î» p p FALSE<br />
sub tail {<br />
    my $p = shift;<br />
    $p-&gt;(\&amp;FALSE)<br />
}</p>
<p>From here you can implement lists and so forth. </p>
<p>- Stevan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthieu Riou</title>
		<link>http://offthelip.org/?p=103&#038;cpage=1#comment-2794</link>
		<dc:creator>Matthieu Riou</dc:creator>
		<pubDate>Mon, 03 Mar 2008 19:27:30 +0000</pubDate>
		<guid isPermaLink="false">http://offthelip.org/?p=103#comment-2794</guid>
		<description>@greg: thanks, that&#039;s fixed.

@Cale: Yes, there are quite a few different ways to implement this. I decided to stick with the one proposed by GJS because it&#039;s maybe more clear to untrained functional eyes. Also its slightly hackish feeling illustrates the last point that implementation can be improved anytime without leaking. But I certainly agree the implementation you proposed is more elegant. Care to post a little snippet in your favorite language for others to see?</description>
		<content:encoded><![CDATA[<p>@greg: thanks, that&#8217;s fixed.</p>
<p>@Cale: Yes, there are quite a few different ways to implement this. I decided to stick with the one proposed by GJS because it&#8217;s maybe more clear to untrained functional eyes. Also its slightly hackish feeling illustrates the last point that implementation can be improved anytime without leaking. But I certainly agree the implementation you proposed is more elegant. Care to post a little snippet in your favorite language for others to see?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
