<?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 C#: Writing a &#8216;partition&#8217; function</title>
	<atom:link href="http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Philip Schwarz</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31473</link>
		<dc:creator>Philip Schwarz</dc:creator>
		<pubDate>Thu, 04 Feb 2010 23:45:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31473</guid>
		<description>@Jonas, @Manuel

The following Scala also works: 

val (evens,odds) = 0 to 10 partition ( _ % 2 == 0)</description>
		<content:encoded><![CDATA[<p>@Jonas, @Manuel</p>
<p>The following Scala also works: </p>
<p>val (evens,odds) = 0 to 10 partition ( _ % 2 == 0)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rx: MemoizeAll , Jerome Laban</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31433</link>
		<dc:creator>Rx: MemoizeAll , Jerome Laban</dc:creator>
		<pubDate>Thu, 04 Feb 2010 05:24:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31433</guid>
		<description>[...] exemple concret de problème posé par l’énumération multiple est la création d’un opérateur de partitionnement d’énumérable. Dans l’exemple donné dans cet article, on peut voir que l’énumérable passé en source est [...]</description>
		<content:encoded><![CDATA[<p>[...] exemple concret de problème posé par l’énumération multiple est la création d’un opérateur de partitionnement d’énumérable. Dans l’exemple donné dans cet article, on peut voir que l’énumérable passé en source est [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas G Mayfield</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31411</link>
		<dc:creator>Thomas G Mayfield</dc:creator>
		<pubDate>Wed, 03 Feb 2010 21:35:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31411</guid>
		<description>@Naveen, your GroupBy variant assumes that you&#039;ll always have both positive and negative matches.  If they all match positive or all match negative, your First and Second will be the same.  And checking against an empty set of objects will result in exceptions.</description>
		<content:encoded><![CDATA[<p>@Naveen, your GroupBy variant assumes that you&#8217;ll always have both positive and negative matches.  If they all match positive or all match negative, your First and Second will be the same.  And checking against an empty set of objects will result in exceptions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manuel</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31398</link>
		<dc:creator>Manuel</dc:creator>
		<pubDate>Wed, 03 Feb 2010 15:57:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31398</guid>
		<description>@Jonas Elfström: I&#039;d say some characters are wasted compared to what you get with Scala&#039;s _ placeholder:

// In hypothetical Scala/Ruby hybrid syntax:
evens,odds = (1..10) partition ( _%2==0)</description>
		<content:encoded><![CDATA[<p>@Jonas Elfström: I&#8217;d say some characters are wasted compared to what you get with Scala&#8217;s _ placeholder:</p>
<p>// In hypothetical Scala/Ruby hybrid syntax:<br />
evens,odds = (1..10) partition ( _%2==0)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonas Elfström</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31380</link>
		<dc:creator>Jonas Elfström</dc:creator>
		<pubDate>Wed, 03 Feb 2010 08:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31380</guid>
		<description>@Philip Schwarz, yes and powerful. Had to check out if Ruby has it.

evens,odds=(1..10).partition{&#124;n&#124; n%2==0}

Not a character wasted and still clear (at least for me).</description>
		<content:encoded><![CDATA[<p>@Philip Schwarz, yes and powerful. Had to check out if Ruby has it.</p>
<p>evens,odds=(1..10).partition{|n| n%2==0}</p>
<p>Not a character wasted and still clear (at least for me).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonas Elfström</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31344</link>
		<dc:creator>Jonas Elfström</dc:creator>
		<pubDate>Tue, 02 Feb 2010 14:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31344</guid>
		<description>Apart from the multiple variable assignment, couldn&#039;t this be considered a kind of GroupBy?

var evensAndOdds = Enumerable.Range(1, 10).GroupBy(n =&gt; n%2==0);

or something like

var evensAndOdds = Enumerable.Range(1, 10).Select(n =&gt; new {number=n,first=(n%2==0)});
var evens = evensAndOdds.Where(n =&gt; n.first).Select(n =&gt; new { n.number });
var odds = evensAndOdds.Where(n =&gt; !n.first).Select(n =&gt; new { n.number });</description>
		<content:encoded><![CDATA[<p>Apart from the multiple variable assignment, couldn&#8217;t this be considered a kind of GroupBy?</p>
<p>var evensAndOdds = Enumerable.Range(1, 10).GroupBy(n =&gt; n%2==0);</p>
<p>or something like</p>
<p>var evensAndOdds = Enumerable.Range(1, 10).Select(n =&gt; new {number=n,first=(n%2==0)});<br />
var evens = evensAndOdds.Where(n =&gt; n.first).Select(n =&gt; new { n.number });<br />
var odds = evensAndOdds.Where(n =&gt; !n.first).Select(n =&gt; new { n.number });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Warren</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31333</link>
		<dc:creator>Matt Warren</dc:creator>
		<pubDate>Tue, 02 Feb 2010 11:25:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31333</guid>
		<description>@Manuel, yeah it does see http://blogs.msdn.com/bclteam/archive/2009/07/07/building-tuple-matt-ellis.aspx for more info. But I guess this code is from a .NET 3.5 project.</description>
		<content:encoded><![CDATA[<p>@Manuel, yeah it does see <a href="http://blogs.msdn.com/bclteam/archive/2009/07/07/building-tuple-matt-ellis.aspx" rel="nofollow">http://blogs.msdn.com/bclteam/archive/2009/07/07/building-tuple-matt-ellis.aspx</a> for more info. But I guess this code is from a .NET 3.5 project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #530</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31325</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #530</dc:creator>
		<pubDate>Tue, 02 Feb 2010 08:41:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31325</guid>
		<description>[...] Functional C#: Writing a &#8216;partition&#8217; function - Mark Needham continues his series looking at writing more functional code in C# with a look at the implementation of a partition function to allow collections to be split. [...]</description>
		<content:encoded><![CDATA[<p>[...] Functional C#: Writing a &#8216;partition&#8217; function &#8211; Mark Needham continues his series looking at writing more functional code in C# with a look at the implementation of a partition function to allow collections to be split. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manuel</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31323</link>
		<dc:creator>Manuel</dc:creator>
		<pubDate>Tue, 02 Feb 2010 08:30:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31323</guid>
		<description>I thought the new version of .NET (4.0) had tuples?</description>
		<content:encoded><![CDATA[<p>I thought the new version of .NET (4.0) had tuples?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naveen</title>
		<link>http://www.markhneedham.com/blog/2010/02/01/functional-c-writing-a-partition-function/comment-page-1/#comment-31312</link>
		<dc:creator>Naveen</dc:creator>
		<pubDate>Tue, 02 Feb 2010 04:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=2110#comment-31312</guid>
		<description>I guess this is more Succinct.

public static Tuple&lt;IEnumerable, IEnumerable&gt; Partition(this IEnumerable enumerableOf, Func predicate)
            {
                var partitioned = enumerableOf.GroupBy(predicate).Select(e =&gt; new {e.Key, e});
                return new Tuple&lt;IEnumerable, IEnumerable&gt;(partitioned.First().e, partitioned.Last().e);
             }</description>
		<content:encoded><![CDATA[<p>I guess this is more Succinct.</p>
<p>public static Tuple&lt;IEnumerable, IEnumerable&gt; Partition(this IEnumerable enumerableOf, Func predicate)<br />
            {<br />
                var partitioned = enumerableOf.GroupBy(predicate).Select(e =&gt; new {e.Key, e});<br />
                return new Tuple&lt;IEnumerable, IEnumerable&gt;(partitioned.First().e, partitioned.Last().e);<br />
             }</p>
]]></content:encoded>
	</item>
</channel>
</rss>

