<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: MapReduce</title>
	<atom:link href="http://programmingpraxis.com/2009/10/06/mapreduce/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingpraxis.com/2009/10/06/mapreduce/</link>
	<description>A collection of etudes, updated weekly, for the education and enjoyment of the savvy programmer</description>
	<lastBuildDate>Mon, 28 May 2012 03:30:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Remco Niemeijer</title>
		<link>http://programmingpraxis.com/2009/10/06/mapreduce/#comment-660</link>
		<dc:creator><![CDATA[Remco Niemeijer]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 17:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1372#comment-660</guid>
		<description><![CDATA[My Haskell solution (see http://bonsaicode.wordpress.com/2009/10/06/programming-praxis-mapreduce/ for a version with comments):

[sourcecode lang=&quot;css&quot;]
mapReduce :: Ord k =&gt; (a -&gt; (k, v)) -&gt; (v -&gt; v -&gt; v) -&gt;
                      (k -&gt; k -&gt; Bool) -&gt; [a] -&gt; [(k, v)]
mapReduce m r lt = sortBy (\(a,_) (b,_) -&gt; if lt a b then LT else GT) .
                   M.assocs . M.map (foldl1 r) .
                   M.fromListWith (++) . map (second return . m)

mapReduceInput :: Ord k =&gt; (a -&gt; (k, v)) -&gt; (v -&gt; v -&gt; v) -&gt;
    (k -&gt; k -&gt; Bool) -&gt; (String -&gt; [a]) -&gt; FilePath -&gt; IO [(k, v)]
mapReduceInput m r lt g = fmap (mapReduce m r lt . g) . readFile
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>My Haskell solution (see <a href="http://bonsaicode.wordpress.com/2009/10/06/programming-praxis-mapreduce/" rel="nofollow">http://bonsaicode.wordpress.com/2009/10/06/programming-praxis-mapreduce/</a> for a version with comments):</p>
<pre class="brush: css;">
mapReduce :: Ord k =&gt; (a -&gt; (k, v)) -&gt; (v -&gt; v -&gt; v) -&gt;
                      (k -&gt; k -&gt; Bool) -&gt; [a] -&gt; [(k, v)]
mapReduce m r lt = sortBy (\(a,_) (b,_) -&gt; if lt a b then LT else GT) .
                   M.assocs . M.map (foldl1 r) .
                   M.fromListWith (++) . map (second return . m)

mapReduceInput :: Ord k =&gt; (a -&gt; (k, v)) -&gt; (v -&gt; v -&gt; v) -&gt;
    (k -&gt; k -&gt; Bool) -&gt; (String -&gt; [a]) -&gt; FilePath -&gt; IO [(k, v)]
mapReduceInput m r lt g = fmap (mapReduce m r lt . g) . readFile
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Programming Praxis &#8211; MapReduce &#171; Bonsai Code</title>
		<link>http://programmingpraxis.com/2009/10/06/mapreduce/#comment-659</link>
		<dc:creator><![CDATA[Programming Praxis &#8211; MapReduce &#171; Bonsai Code]]></dc:creator>
		<pubDate>Tue, 06 Oct 2009 17:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://programmingpraxis.com/?p=1372#comment-659</guid>
		<description><![CDATA[[...] Praxis &#8211;&#160;MapReduce By Remco Niemeijer  In today&#8217;s Programming Praxis exercise, we have to implement the famous MapReduce algorithm. Let&#8217;s get [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Praxis &#8211;&nbsp;MapReduce By Remco Niemeijer  In today&#8217;s Programming Praxis exercise, we have to implement the famous MapReduce algorithm. Let&#8217;s get [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

