<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Drinkable Chicken &#187; functional</title>
	<atom:link href="http://4.flowsnake.org/archives/tag/functional/feed" rel="self" type="application/rss+xml" />
	<link>http://4.flowsnake.org</link>
	<description>A Pythoneer's adventures with Scheme, Clojure and a whole lot more. ^_^</description>
	<lastBuildDate>Sat, 10 Jul 2010 14:39:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Miscellaneous links</title>
		<link>http://4.flowsnake.org/archives/442</link>
		<comments>http://4.flowsnake.org/archives/442#comments</comments>
		<pubDate>Tue, 13 Jan 2009 02:19:35 +0000</pubDate>
		<dc:creator>Hans Nowak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c64]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[latin]]></category>
		<category><![CDATA[macosx]]></category>

		<guid isPermaLink="false">http://4.flowsnake.org/?p=442</guid>
		<description><![CDATA[Not a very original subject, but these links might be vaguely interesting: Schola: A social network for Latin speakers. The Ultimate Commodore 64 Talk @25C3: Commodore 64 in a nutshell. (Well, a sizable nut&#8230;) How to create custom icons for your Mac: Useful. Functional programming languages (lectures): Heavy stuff. G3 icons for Adium: How cool [...]]]></description>
			<content:encoded><![CDATA[<p>Not a very original subject, but these links might be vaguely interesting:</p>
<ul>
<li><a href="http://schola.ning.com/">Schola</a>: A social network for Latin speakers.</li>
</ul>
<ul>
<li><a href="http://www.pagetable.com/?p=53">The Ultimate Commodore 64 Talk @25C3</a>: Commodore 64 in a nutshell. (Well, a sizable nut&#8230;)</li>
</ul>
<ul>
<li><a href="http://macapper.com/2007/04/21/how-to-create-custom-icons-for-your-mac/">How to create custom icons for your Mac</a>: Useful.</li>
</ul>
<ul>
<li><a href="http://gallium.inria.fr/~xleroy/mpri/progfunc/">Functional programming languages</a> (lectures): Heavy stuff.</li>
</ul>
<ul>
<li><a href="http://www.adiumxtras.com/index.php?a=xtras&amp;xtra_id=4372">G3 icons for Adium</a>: How cool is that? :-)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://4.flowsnake.org/archives/442/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catamorphisms in 60 seconds</title>
		<link>http://4.flowsnake.org/archives/24</link>
		<comments>http://4.flowsnake.org/archives/24#comments</comments>
		<pubDate>Fri, 11 Jan 2008 02:46:29 +0000</pubDate>
		<dc:creator>Hans Nowak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[60 seconds]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://4.flowsnake.org/archives/24</guid>
		<description><![CDATA[Catamorphisms. Recently I&#8217;ve seen this word popping up in some blog posts (often Haskell-related). Sounds fancy, and when I try to look it up, I run into stuff that is probably really deep, but looks like gobbledygook to me. (Likely because my brain doesn&#8217;t really grok complex math stuff too well.) What this word actually [...]]]></description>
			<content:encoded><![CDATA[<p>Catamorphisms. Recently I&#8217;ve seen this word popping up in some blog posts (often Haskell-related). Sounds fancy, and when I try to look it up, I <a href="http://caos.di.uminho.pt/~ulisses/blog/2007/12/19/catamorphisms-in-haskell/">run</a> <a href="http://en.wikipedia.org/wiki/Catamorphism#Catamorphisms_in_functional_programming">into</a> <a href="http://209.85.207.104/search?q=cache:WVcG30Q525AJ:research.microsoft.com/~emeijer/Papers/ags.pdf+catamorphisms&amp;hl=en&amp;ct=clnk&amp;cd=3&amp;gl=us&amp;client=firefox-a">stuff</a> that is probably really deep, but looks like gobbledygook to me. (Likely because my brain doesn&#8217;t really grok complex math stuff too well.)</p>
<p>What this word actually means is a technique where you take a number of values, process them in some way, and end up with fewer values (often a single one). A good example would be, computing the sum of a list of numbers.</p>
<p>In Python, one way to do this used to be using <em>reduce</em> (and that still works, but has been superseded by the <em>sum</em> built-in). Using this approach actually illustrates the concept well, known as <a href="http://en.wikipedia.org/wiki/Fold_%28higher-order_function%29">folding</a> in functional languages.</p>
<pre>&gt;&gt;&gt; numbers = [3, 6, 8, 12, -5]
&gt;&gt;&gt; reduce(lambda x, y: x+y, numbers)
24</pre>
<p>In other words, a catamorphism is just a fold. Oh, and the opposite (an &#8220;unfold&#8221;) is called an <a href="http://weblog.raganwald.com/2007/11/really-simple-anamorphisms-in-ruby.html">anamorphism</a>.</p>
<p>That&#8217;s really all there is to it. (Of course, folding can and does get much more complex, but that&#8217;s a different story.)</p>
]]></content:encoded>
			<wfw:commentRss>http://4.flowsnake.org/archives/24/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
