<?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>porges &#187; Thought</title>
	<atom:link href="http://porg.es/blog/tag/thought/feed" rel="self" type="application/rss+xml" />
	<link>http://porg.es/blog</link>
	<description></description>
	<lastBuildDate>Sun, 06 May 2012 22:13:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Music you didn&#8217;t expect to hear in places you didn&#8217;t expect to hear it</title>
		<link>http://porg.es/blog/music-you-didnt-expect-to-hear-in-places-you-didnt-expect-to-hear-it</link>
		<comments>http://porg.es/blog/music-you-didnt-expect-to-hear-in-places-you-didnt-expect-to-hear-it#comments</comments>
		<pubDate>Tue, 07 Oct 2008 10:22:07 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[music]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[Thought]]></category>
		<category><![CDATA[what]]></category>

		<guid isPermaLink="false">http://porg.es/blog/?p=207</guid>
		<description><![CDATA[The M.I.A./Diplo mixtape Piracy Funds Terrorism includes samples from the game Emperor: Rise of the Middle Kingdom in tracks 10 &#038; 11 (“You&#8217;re Good [Diplo mix]” and “Pop [Diplo mix]”). Neato! Big props to Diplo]]></description>
			<content:encoded><![CDATA[<p>The M.I.A./Diplo mixtape <i>Piracy Funds Terrorism</i> includes samples from the game <i>Emperor: Rise of the Middle Kingdom</i> in tracks 10 &#038; 11 (“You&#8217;re Good [Diplo mix]” and “Pop [Diplo mix]”). Neato!</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/zK2b0lqrvVY?rel=0" frameborder="0" allowfullscreen></iframe><br />
<iframe width="420" height="315" src="http://www.youtube.com/embed/Ymrmk5o9OYk?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>Big props to Diplo <img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_wink.gif" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/music-you-didnt-expect-to-hear-in-places-you-didnt-expect-to-hear-it/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compare and Contrast</title>
		<link>http://porg.es/blog/compare-and-contrast</link>
		<comments>http://porg.es/blog/compare-and-contrast#comments</comments>
		<pubDate>Thu, 04 Sep 2008 01:40:39 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[music]]></category>
		<category><![CDATA[compare]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[contrast]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[sudden]]></category>
		<category><![CDATA[Thought]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://porg.es/blog/?p=162</guid>
		<description><![CDATA[Coldplay’s ‘42’ from Viva la Vida or Death and All His Friends (starting about 1:45), Nine Inch Nails ‘Complication’ from The Fragile.]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://upload.wikimedia.org/wikipedia/en/0/06/VivaLaVida.jpg" title="Viva La Vida album cover" class="aligncenter" width="300" height="300" /></p>
<p>Coldplay’s ‘42’ from <i><a href="http://en.wikipedia.org/wiki/Viva_la_Vida">Viva la Vida or Death and All His Friends</a></i> (starting about 1:45), Nine Inch Nails ‘Complication’ from <i><a href="http://en.wikipedia.org/wiki/The_Fragile">The Fragile</a></i>.</p>
<p><img alt="" src="http://upload.wikimedia.org/wikipedia/en/6/6a/Nin-the_fragile800.jpg" title="The Fragile album cover" class="aligncenter" width="300" height="263" /></p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/compare-and-contrast/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Music Post #1</title>
		<link>http://porg.es/blog/music-post-1</link>
		<comments>http://porg.es/blog/music-post-1#comments</comments>
		<pubDate>Mon, 01 Sep 2008 11:45:51 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[music]]></category>
		<category><![CDATA[maybe]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[Thought]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://porg.es/blog/?p=160</guid>
		<description><![CDATA[Is it just me, or does &#8220;Race: In&#8221; from Battles&#8217; album Mirrored reference Mike Oldfield’s Tubular Bells heavily? Update: Fleet Foxes ‘Quiet Houses’ does this even more.]]></description>
			<content:encoded><![CDATA[<p>Is it just me, or does &#8220;Race: In&#8221; from Battles&#8217; album <i><a href="http://en.wikipedia.org/wiki/Mirrored_(album)">Mirrored</a></i> reference Mike Oldfield’s <i><a href="http://en.wikipedia.org/wiki/Tubular_Bells">Tubular Bells</a></i> heavily?</p>
<p>Update: Fleet Foxes ‘Quiet Houses’ does this even more.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/music-post-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NullPointerException</title>
		<link>http://porg.es/blog/nullpointerexception</link>
		<comments>http://porg.es/blog/nullpointerexception#comments</comments>
		<pubDate>Thu, 24 May 2007 21:26:41 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Broken]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Critique]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thought]]></category>
		<category><![CDATA[Types]]></category>

		<guid isPermaLink="false">http://porg.es/blog/nullpointerexception</guid>
		<description><![CDATA[Why is this such an insidious error in Java? (An opinion piece!) A Comparison Firstly, I&#8217;ll show a short comparison between some Java code and some code from a language that doesn&#8217;t have NullPointerExceptions, but does have something that allows you to accomplish anything you might want to do with null pointers. This Java code: [...]]]></description>
			<content:encoded><![CDATA[<p>Why is this such an insidious error in Java? (An opinion piece!)</p>
<h3>A Comparison</h3>
<p>Firstly, I&#8217;ll show a short comparison between some Java code and some code from a language that doesn&#8217;t have <code>NullPointerException</code>s, but does have something that allows you to accomplish anything you might want to do with null pointers.</p>
<p>This Java code:</p>
<pre><code>AnObject thing = someMethod();</code></pre>
<p>is equivalent to the following Haskell:</p>
<pre><code>let thing = Maybe AnObject</code></pre>
<p>That is, every Java object reference is possibly null. What this means is that (using the type notation mentioned in earlier posts) every Java reference has the type:</p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/80c7aa7402953bdabc5fcf23a7a9b406.gif' title='ObjectReference[Object] = 1 + Object' alt='ObjectReference[Object] = 1 + Object' align=absmiddle></p>
<p><small>(Every object reference for an object is either to &#8216;null&#8217; (<abbr title="also known as">AKA</abbr> &#8216;unit&#8217; or &#8216;singleton&#8217<img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_wink.gif" alt="" />, or the object itself.)</small></p>
<p>&#8230; and when you&#8217;re dealing with so many objects—Java is, after all, an object-oriented language, so (almost) everything is an object—this simple little &#8220;+1&#8243; gets lost easily.</p>
<h3>Why so bad?</h3>
<p>This wouldn&#8217;t seem to be such a big deal, but when contrasted against Java&#8217;s penchant for making things (sometimes painfully) explicit—think <code>public static void main (string argh!)</code>—a small, implicit item like this is easily overlooked. Conversely, one might say that the verbosity of Java <em>increases</em> the cognitive load of understanding its code; thus helping the chances of a small mistake like this sneaking through.</p>
<p>Either way, I think I can say that this is objectively A Bad Thing. C# has gone some of the way to a &#8216;correct&#8217; solution in its introduction of possibly-null primitives, which are explicitly marked with a <code>?</code> (such as <code>int?</code>), but unfortunately this hasn&#8217;t been &#8216;back-ported&#8217; to the rest of the language. If one were able to force between possibly-null and definitely-not-null references in C#—perhaps by the analogous <code>object?</code> vs. <code>object</code>, this would help to reduce the number of errors &#8216;hidden&#8217; by the syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/nullpointerexception/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Surreal and natural numbers</title>
		<link>http://porg.es/blog/surreal-and-natural-numbers</link>
		<comments>http://porg.es/blog/surreal-and-natural-numbers#comments</comments>
		<pubDate>Tue, 17 Apr 2007 22:20:00 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Thought]]></category>

		<guid isPermaLink="false">http://porg.es/blog/surreal-and-natural-numbers</guid>
		<description><![CDATA[After reading a recent post on Good Math, Bad Math concerning surreal numbers, I got to thinking about how to model these in Haskell. I came up with the following formulation: data Surreal = Zero &#124; Plus Surreal &#124; Minus Surreal &#8230; which also seems very similar to the usual construction for natural numbers: data [...]]]></description>
			<content:encoded><![CDATA[<p>After reading <a href="http://scienceblogs.com/goodmath/2007/04/signexpanded_surreal_numbers_1.php">a recent post on Good Math, Bad Math concerning surreal numbers</a>, I got to thinking about how to model these in Haskell. I came up with the following formulation:</p>
<pre><code>data Surreal = Zero | Plus Surreal | Minus Surreal</code></pre>
<p>&#8230; which also seems very similar to the usual construction for natural numbers:</p>
<pre><code>data Nat = Zero | Succ Nat</code></pre>
<p><small>(I noted this in a comment on the original post.)</small></p>
<p>This got me thinking about how this construction (the sign-expanded version) mapped onto the original construction of the surreal numbers, which uses a left and a right set:</p>
<pre><code>data Surreal = Surreal [Surr] [Surr]</code></pre>
<p>These types translate to the following (in order of appearance):</p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/eaa6c4cf2842115a727f9910baf907a1.gif' title='\begin{aligned}S &amp;= 1 + S + S\\&amp;= 1 + 2S\\N &amp;= 1 + N\\S &amp;= e^S \times e^S \\&amp;= e^{2S}\end{aligned}' alt='\begin{aligned}S &amp;= 1 + S + S\\&amp;= 1 + 2S\\N &amp;= 1 + N\\S &amp;= e^S \times e^S \\&amp;= e^{2S}\end{aligned}' align=absmiddle></p>
<p>This last type is suggestive for the natural numbers as well, and of course there is a analogous construction for the naturals:</p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/1bff22f7d420900aca0c5631b811d1b8.gif' title='N = e^N' alt='N = e^N' align=absmiddle></p>
<p>&#8230;which is a set-based construction for the naturals. (Note that in the above formulas multisets are used instead of true sets, but I don&#8217;t think this makes a difference in this context.)</p>
<p>Of course this raises the question of what is possible with three sets (or a 3-enum (3-num?)). More on this in another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/surreal-and-natural-numbers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exponential Bags: Integration of Types, continued</title>
		<link>http://porg.es/blog/exponential-bags-integration-of-types-continued</link>
		<comments>http://porg.es/blog/exponential-bags-integration-of-types-continued#comments</comments>
		<pubDate>Wed, 11 Apr 2007 10:49:16 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Functional programming]]></category>
		<category><![CDATA[Odd]]></category>
		<category><![CDATA[Thought]]></category>

		<guid isPermaLink="false">http://porg.es/blog/exponential-bags-integration-of-types-continued</guid>
		<description><![CDATA[Derivatives of Containers claims to look for the &#8216;container which is its own derivative&#8217;; in other words, a type analogue of ex. They arrive at (approximated in ASCII and the notation used in my previous post): T[X] = Forall(n : N) Xn / Autn This is a little much for me, since I don&#8217;t understand [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cs.nott.ac.uk/~ctm/derivcont.ps.gz">Derivatives of Containers</a> claims to look for the &#8216;container which is its own derivative&#8217;; in other words, a type analogue of <i>e<sup>x</sup></i>. They arrive at (approximated in ASCII and the notation used in my previous post):</p>
<pre><code>T[<i>X</i>] = Forall(<i>n</i> : N) <i>X</i><sup><i>n</i></sup> / Aut<sub><i>n</i></sub></code></pre>
<p>This is a little much for me, since I don&#8217;t understand the symbolism and terminology used in the other 99% of the paper, either! However, as they note that it closely matches the Taylor-series expansion of <i>e<sup>x</sup></i>. I think that using the simple concepts I linked to in the previous post, I can approach a similar definition.</p>
<p>First of all, start with a simple (identity?) type:</p>
<pre><code>F[X] = X</code></pre>
<p>Now, since what we want is a type that when differentiated, gives itself, we should start by integrating:</p>
<pre><code>F[X]  = X<sup>2</sup> ÷ 2</code></pre>
<p>As shown in the previous post, we can interpret the division operator as &#8216;missing information&#8217;. In this case, the missing information is a 2-enum stating where the new type element was to be inserted&#8230; thus we have a type consisting of two elements, only we don&#8217;t know in what order they should appear. If we repeat this process several times, we obtain:</p>
<pre><code>F[X] = X<sup>3</sup> ÷ (2×3)
F[X] = X<sup>4</sup> ÷ (2×3×4)
F[X] = X<sup>5</sup> ÷ (2×3×4×5)</code></pre>
<p>Now we can begin to see a pattern emerging. Each time we integrate the function, we are adding an element to the type, without saying where it should be inserted&#8212;in other words, we are creating an unordered set of objects (note that these aren&#8217;t true sets, but merely bags: sets which can contain duplicates). Now if we take the literal Taylor expansion of <i>e<sup>x</sup></i>, we can see what it really is as a type:</p>
<pre><code>E[X] = Σ (X<sup>n</sup> ÷ n!)</code></pre>
<p>It is either a bag with one element, or a bag with two elements, or a bag with three elements&#8230; it is in fact the union of all bag types! That is, the exponential function interpreted as a type, is the type of bags.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/exponential-bags-integration-of-types-continued/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Types as Functions (and Integration thereof)</title>
		<link>http://porg.es/blog/types-as-functions-and-integration-thereof</link>
		<comments>http://porg.es/blog/types-as-functions-and-integration-thereof#comments</comments>
		<pubDate>Wed, 11 Apr 2007 00:34:19 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Functional programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Thought]]></category>

		<guid isPermaLink="false">http://porg.es/blog/types-as-functions-and-integration-thereof</guid>
		<description><![CDATA[After reading Differention of Datastructures, I think I finally understand what is meant by &#8220;types as functions&#8221;, and immediately I can see one direction in which to go from what is presented there. If we take integration to be the logical inverse of differentiation (which is defined in the article as &#8216;removal of an element [...]]]></description>
			<content:encoded><![CDATA[<p>After reading <a href="http://homepage.mac.com/sigfpe/Computing/diff.html">Differention of Datastructures</a>, I think I finally understand what is meant by &#8220;types as functions&#8221;, and immediately I can see one direction in which to go from what is presented there.</p>
<p>If we take integration to be the logical inverse of differentiation (which is defined in the article as &#8216;removal of an element from a type&#8217<img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_wink.gif" alt="" />, then we have integration as the addition of an element to a type.</p>
<p>For example, take the type of an array of 3 elements of the same type:</p>
<pre><code>F[T] = T<sup>3</sup></code></pre>
<p>If we are to add an element to this array, we want to integrate it. This gives us:</p>
<pre><code>F[T] = T<sup>4</sup> ÷ 4</code></pre>
<p>Clearly this is not what we expected. If we want to add an element to a 3-element array, we are expecting a 4-element array. However, if we look again at the above result, we can reinterpret it as telling us something: the mere integration of the type is not supplying the expected result; and if we interpret division as &#8216;without&#8217; (just as addition is &#8216;or&#8217; and multiplication is &#8216;and&#8217<img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_wink.gif" alt="" />, then we can understand the result obtained.</p>
<p>What this is in fact telling us is that we need to provide another parameter (an enum in this case), which will give us the required result. In other words (if we do it backwards&#8230<img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_wink.gif" alt="" />:</p>
<pre><code>F[T] = T<sup>4</sup> -- wanted
F'[T] = 4.T<sup>3</sup> -- needed</code></pre>
<p>In order to obtain a 4-element array, we need a 3-element array and a 4-enum. This makes sense, because if we have a 3-element array:</p>
<pre><code>x y z</code></pre>
<p>&#8230;and we wish to add an element &#8216;w&#8217; to it, we need to know where to insert it. The number of insertion points is:</p>
<pre><code>(1) x (2) y (3) z (4)</code></pre>
<p>&#8230;and thus we need to supply a 4-enum to specify exactly where we want the insertion to take place. Once we have done this, we obtain our 4-element array with no &#8216;missing&#8217; parameters.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/types-as-functions-and-integration-thereof/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Functional programming, APL and Unix pipes</title>
		<link>http://porg.es/blog/functional-programming-apl-and-unix-pipes</link>
		<comments>http://porg.es/blog/functional-programming-apl-and-unix-pipes#comments</comments>
		<pubDate>Sun, 04 Mar 2007 05:27:52 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Functional programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Thought]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://porg.es/blog/functional-programming-apl-and-unix-pipes</guid>
		<description><![CDATA[I&#8217;ve noticed that when reading rather deeply-nested functional code in Haskell, the process taking place in reading the code seems to resemble trying to decipher APL more than anything else. This seems to be because functions which operate over lists are easily concatenated (possibly using the $ operator), because they operate on lists in their [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed that when reading rather deeply-nested functional code in Haskell, the process taking place in reading the code seems to resemble trying to decipher <abbr title="A Programming Language">APL</abbr> more than anything else. This seems to be because functions which operate over lists are easily concatenated (possibly using the <code>$</code> operator), because they operate on lists in their last parameters. For example: </p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="font-weight: bold;">foldr</span> getCounts <span style="color: green;">&#40;</span><span style="color: red;">0</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">0</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">0</span><span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">$</span> <span style="font-weight: bold;">map</span> classify <span style="color: #339933; font-weight: bold;">$</span> <span style="font-weight: bold;">concat</span> <span style="color: green;">&#91;</span><span style="color: green;">&#91;</span><span style="color: red;">20</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">30</span><span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: green;">&#91;</span><span style="color: red;">490</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">500</span><span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: green;">&#91;</span><span style="color: red;">8120</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">8130</span><span style="color: green;">&#93;</span><span style="color: green;">&#93;</span></pre></div></div>

<p>In order to understand what is happening here, one needs to start from the <abbr title="right-hand side">RHS</abbr> of the expression and then work backwards&mdash;much the same as in this snippet of <abbr>APL</abbr>:</p>
<pre><code>(∼R∈R∘.×R)/R←1↓⍳R</code></pre>
<p><small>(See the <a href="http://en.wikipedia.org/wiki/APL_(programming_language)">Wikipedia article on APL</a> for what is happening here.)</small></p>
<p>In both cases, the code is operating upon a common parameter which is modified by each function in turn. Similarly, there seems to be a rather high-level isomorphism between these kinds of functional code and the concept of Unix pipes:</p>
<pre><code>sort file | uniq -c | sort -n</code></pre>
<p>&#8230;with the difference being that in this case, the common parameter is being passed from the left instead of from the right.</p>
<p>Now, in Haskell I can define a new &#8220;pipe&#8221; operator (<code>|</code> is already taken):</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">~&gt;</span><span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">::</span> a <span style="color: #339933; font-weight: bold;">-&gt;</span> <span style="color: green;">&#40;</span>a<span style="color: #339933; font-weight: bold;">-&gt;</span>b<span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">-&gt;</span> b
<span style="color: green;">&#40;</span><span style="color: #339933; font-weight: bold;">~&gt;</span><span style="color: green;">&#41;</span> x f <span style="color: #339933; font-weight: bold;">=</span> f x</pre></div></div>

<p>Which just has the reverse signature to the <code>$</code> operator, and:</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="font-weight: bold;">foldr</span> getCounts <span style="color: green;">&#40;</span><span style="color: red;">0</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">0</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">0</span><span style="color: green;">&#41;</span> <span style="color: #339933; font-weight: bold;">$</span> <span style="font-weight: bold;">map</span> classify <span style="color: #339933; font-weight: bold;">$</span> <span style="font-weight: bold;">concat</span> <span style="color: green;">&#91;</span><span style="color: green;">&#91;</span><span style="color: red;">20</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">30</span><span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: green;">&#91;</span><span style="color: red;">490</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">500</span><span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: green;">&#91;</span><span style="color: red;">8120</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">8130</span><span style="color: green;">&#93;</span><span style="color: green;">&#93;</span></pre></div></div>

<p>&#8230;becomes&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="haskell" style="font-family:monospace;"><span style="color: green;">&#91;</span><span style="color: green;">&#91;</span><span style="color: red;">20</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">30</span><span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: green;">&#91;</span><span style="color: red;">490</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">500</span><span style="color: green;">&#93;</span><span style="color: #339933; font-weight: bold;">,</span> <span style="color: green;">&#91;</span><span style="color: red;">8120</span><span style="color: #339933; font-weight: bold;">..</span><span style="color: red;">8130</span><span style="color: green;">&#93;</span><span style="color: green;">&#93;</span> <span style="color: #339933; font-weight: bold;">~&gt;</span> <span style="font-weight: bold;">concat</span> <span style="color: #339933; font-weight: bold;">~&gt;</span> <span style="font-weight: bold;">map</span> classify <span style="color: #339933; font-weight: bold;">~&gt;</span> <span style="font-weight: bold;">foldr</span> getCounts <span style="color: green;">&#40;</span><span style="color: red;">0</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">0</span><span style="color: #339933; font-weight: bold;">,</span><span style="color: red;">0</span><span style="color: green;">&#41;</span></pre></div></div>

<p>&#8230;which makes it a bit easier to read, at least in my (used-to-Linux) eyes.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/functional-programming-apl-and-unix-pipes/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>lyre</title>
		<link>http://porg.es/blog/lyre</link>
		<comments>http://porg.es/blog/lyre#comments</comments>
		<pubDate>Tue, 03 Oct 2006 09:16:38 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[self]]></category>
		<category><![CDATA[Odd]]></category>
		<category><![CDATA[Thought]]></category>

		<guid isPermaLink="false">http://porg.es/blog/lyre</guid>
		<description><![CDATA[I fear that I&#8217;m losing myself in an R. G. B. horizon. But at least I can say it&#8217;s not CMYK.]]></description>
			<content:encoded><![CDATA[<p style="text-align:center"><i>I fear that I&#8217;m losing myself<br />
in an R. G. B. horizon.<br />
But at least I can say<br />
it&#8217;s not CMYK.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/lyre/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

