<?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: Prelude golf: what can we learn by rewriting the partition function?</title>
	<atom:link href="http://blog.patch-tag.com/2009/10/28/prelude_golf_partition/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.patch-tag.com/2009/10/28/prelude_golf_partition/</link>
	<description>give your code a home</description>
	<lastBuildDate>Fri, 13 Jul 2012 17:30:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: loopzy</title>
		<link>http://blog.patch-tag.com/2009/10/28/prelude_golf_partition/#comment-101</link>
		<dc:creator><![CDATA[loopzy]]></dc:creator>
		<pubDate>Thu, 03 Dec 2009 15:21:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=229#comment-101</guid>
		<description><![CDATA[Thanks this was a good read]]></description>
		<content:encoded><![CDATA[<p>Thanks this was a good read</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomashartman1</title>
		<link>http://blog.patch-tag.com/2009/10/28/prelude_golf_partition/#comment-78</link>
		<dc:creator><![CDATA[thomashartman1]]></dc:creator>
		<pubDate>Fri, 30 Oct 2009 13:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=229#comment-78</guid>
		<description><![CDATA[I tested this, and it&#039;s good -- same time profile as partitionSL.

Interesting point, for your function it was fast in ghci without precompiling, whereas for partitionSL I had to ghc --make first to get reasonable performance.

The filter version is present in the current ghc prelude as a commment prior to the real definition.]]></description>
		<content:encoded><![CDATA[<p>I tested this, and it&#8217;s good &#8212; same time profile as partitionSL.</p>
<p>Interesting point, for your function it was fast in ghci without precompiling, whereas for partitionSL I had to ghc &#8211;make first to get reasonable performance.</p>
<p>The filter version is present in the current ghc prelude as a commment prior to the real definition.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kamil Dworakowski</title>
		<link>http://blog.patch-tag.com/2009/10/28/prelude_golf_partition/#comment-76</link>
		<dc:creator><![CDATA[Kamil Dworakowski]]></dc:creator>
		<pubDate>Thu, 29 Oct 2009 20:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=229#comment-76</guid>
		<description><![CDATA[Here is a definition of partition function in terms of foldr which works for infinite lists.

import Control.Arrow
part f xs = foldr g ([],[]) xs where
    g x rec = let mod = if f x then first else second in mod (x:) rec

The trick is not to force rec to soon. In you definition you have a pattern matching, which is convenient but forces the recursive call which then loops until stack overflow.]]></description>
		<content:encoded><![CDATA[<p>Here is a definition of partition function in terms of foldr which works for infinite lists.</p>
<p>import Control.Arrow<br />
part f xs = foldr g ([],[]) xs where<br />
    g x rec = let mod = if f x then first else second in mod (x:) rec</p>
<p>The trick is not to force rec to soon. In you definition you have a pattern matching, which is convenient but forces the recursive call which then loops until stack overflow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Brubeck</title>
		<link>http://blog.patch-tag.com/2009/10/28/prelude_golf_partition/#comment-73</link>
		<dc:creator><![CDATA[Matt Brubeck]]></dc:creator>
		<pubDate>Wed, 28 Oct 2009 21:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=229#comment-73</guid>
		<description><![CDATA[Very interesting!  By the way, my initial approach was this very short version:

partition p xs = (filter p xs, filter (not . p) xs)

which I believe is inefficient because it will call p twice on each  element of the list, but on the other hand it&#039;s both short and lazy.]]></description>
		<content:encoded><![CDATA[<p>Very interesting!  By the way, my initial approach was this very short version:</p>
<p>partition p xs = (filter p xs, filter (not . p) xs)</p>
<p>which I believe is inefficient because it will call p twice on each  element of the list, but on the other hand it&#8217;s both short and lazy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
