<?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: Is this functional programming?</title>
	<atom:link href="http://codemonkeyism.com/functional-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://codemonkeyism.com/functional-programming/</link>
	<description></description>
	<lastBuildDate>Mon, 15 Mar 2010 13:03:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Florian Krüsch</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-252037</link>
		<dc:creator>Florian Krüsch</dc:creator>
		<pubDate>Wed, 11 Nov 2009 11:25:31 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-252037</guid>
		<description>sounds like you&#039;re saying that programming a filter pipeline contradicts or is not real functional programming... 
in fact functional programming is great for ensuring the correctness of the chaining, especially when using monads &#124; http://en.wikipedia.org/wiki/Monad_(functional_programming)</description>
		<content:encoded><![CDATA[<p>sounds like you&#8217;re saying that programming a filter pipeline contradicts or is not real functional programming&#8230;<br />
in fact functional programming is great for ensuring the correctness of the chaining, especially when using monads | <a href="http://en.wikipedia.org/wiki/Monad_(functional_programming)" rel="nofollow">http://en.wikipedia.org/wiki/Monad_(functional_programming)</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-249277</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Mon, 26 Oct 2009 20:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-249277</guid>
		<description>I&#039;m sorry, wordpress isn&#039;t very good with code in comments. [Generics] worked for Scala though.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry, wordpress isn&#8217;t very good with code in comments. [Generics] worked for Scala though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apocalisp</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-249248</link>
		<dc:creator>Apocalisp</dc:creator>
		<pubDate>Mon, 26 Oct 2009 16:13:32 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-249248</guid>
		<description>Hmm... there are supposed to be some angle brackets in that Haskell code, but your comments system eated them.</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; there are supposed to be some angle brackets in that Haskell code, but your comments system eated them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apocalisp</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-249247</link>
		<dc:creator>Apocalisp</dc:creator>
		<pubDate>Mon, 26 Oct 2009 16:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-249247</guid>
		<description>For comparison with a purely functional language, here&#039;s that code in Haskell:

&lt;code&gt;

getSlots n m = (zipWith (-)  tail)
               . sort
               . ([0, m] ++)
               . take (n - 1)
               . randomRs (1, m - 1)

&lt;/code&gt;

This is a pure function that takes a random number generator and returns an IO action within which the &quot;slots&quot; are provided.</description>
		<content:encoded><![CDATA[<p>For comparison with a purely functional language, here&#8217;s that code in Haskell:</p>
<p><code></p>
<p>getSlots n m = (zipWith (-)  tail)<br />
               . sort<br />
               . ([0, m] ++)<br />
               . take (n - 1)<br />
               . randomRs (1, m - 1)</p>
<p></code></p>
<p>This is a pure function that takes a random number generator and returns an IO action within which the &#8220;slots&#8221; are provided.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Dahlby</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248749</link>
		<dc:creator>Keith Dahlby</dc:creator>
		<pubDate>Wed, 21 Oct 2009 17:55:17 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248749</guid>
		<description>Thanks for the comments everyone, glad to stir up a discussion. I think it&#039;s important to realize that a &quot;pipeline&quot; just takes inputs from before the dot and returns new values out the &quot;other side&quot;. Assuming you&#039;re not modifying shared state, that&#039;s pretty much the definition of a function.

In this example, Values is always going to take the Random seed and return the sequence of values generated from it (technically this is modifying the state of the Random object, but in practice it doesn&#039;t matter). Similarly, Pairwise is always going to return a new sequence generated from calling a function on adjacent elements in the input sequence. Whether or not they are &quot;pure&quot; seems irrelevant: they are useful abstractions implemented as functions - functional abstraction.

&quot;While this chain looks elegant and concise the &#039;extension methods&#039; used to enable it look verbose and complex as hell.&quot;

Isn&#039;t that the point of any abstraction, be it object-oriented or functional? Implementing the complex details once allows us to reuse them forever in &quot;elegant and concise&quot; compositions that greatly reduce the complexity of the code you&#039;re actually interested in.

Cheers ~
Keith</description>
		<content:encoded><![CDATA[<p>Thanks for the comments everyone, glad to stir up a discussion. I think it&#8217;s important to realize that a &#8220;pipeline&#8221; just takes inputs from before the dot and returns new values out the &#8220;other side&#8221;. Assuming you&#8217;re not modifying shared state, that&#8217;s pretty much the definition of a function.</p>
<p>In this example, Values is always going to take the Random seed and return the sequence of values generated from it (technically this is modifying the state of the Random object, but in practice it doesn&#8217;t matter). Similarly, Pairwise is always going to return a new sequence generated from calling a function on adjacent elements in the input sequence. Whether or not they are &#8220;pure&#8221; seems irrelevant: they are useful abstractions implemented as functions &#8211; functional abstraction.</p>
<p>&#8220;While this chain looks elegant and concise the &#8216;extension methods&#8217; used to enable it look verbose and complex as hell.&#8221;</p>
<p>Isn&#8217;t that the point of any abstraction, be it object-oriented or functional? Implementing the complex details once allows us to reuse them forever in &#8220;elegant and concise&#8221; compositions that greatly reduce the complexity of the code you&#8217;re actually interested in.</p>
<p>Cheers ~<br />
Keith</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wedge</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248713</link>
		<dc:creator>Wedge</dc:creator>
		<pubDate>Wed, 21 Oct 2009 10:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248713</guid>
		<description>Sure it&#039;s functional programming. Don&#039;t get so caught up on the trendiness of functional programming to think that one way of using functional programming is less cool and less &quot;truly, really functional&quot; than another way. Using extension methods and other constructs to create a useful, readable, terse pipeline programming model is plenty &quot;functional&quot; even though it may not be quite as clever as a y-combinator or map reduce.

Remember that a Turing machine is the utter definition of the imperative, stateful programming model, yet every single function has its equivalent expression in Turing machine code form. They are two sides of the exact same coin. They are two levers under the same load, what matters is which lever is more useful to accomplish the task at hand.

Orthodoxy is for chumps, the important aspect is whether it&#039;s GOOD programming, regardless of style.</description>
		<content:encoded><![CDATA[<p>Sure it&#8217;s functional programming. Don&#8217;t get so caught up on the trendiness of functional programming to think that one way of using functional programming is less cool and less &#8220;truly, really functional&#8221; than another way. Using extension methods and other constructs to create a useful, readable, terse pipeline programming model is plenty &#8220;functional&#8221; even though it may not be quite as clever as a y-combinator or map reduce.</p>
<p>Remember that a Turing machine is the utter definition of the imperative, stateful programming model, yet every single function has its equivalent expression in Turing machine code form. They are two sides of the exact same coin. They are two levers under the same load, what matters is which lever is more useful to accomplish the task at hand.</p>
<p>Orthodoxy is for chumps, the important aspect is whether it&#8217;s GOOD programming, regardless of style.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apocalisp</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248624</link>
		<dc:creator>Apocalisp</dc:creator>
		<pubDate>Mon, 19 Oct 2009 22:42:53 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248624</guid>
		<description>Your fluent interfaces want to be function composition. Let them.</description>
		<content:encoded><![CDATA[<p>Your fluent interfaces want to be function composition. Let them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: walter higgins</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248616</link>
		<dc:creator>walter higgins</dc:creator>
		<pubDate>Mon, 19 Oct 2009 21:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248616</guid>
		<description>I don&#039;t think that&#039;s functional programming - just an examlpe of a fluent interface http://www.martinfowler.com/bliki/FluentInterface.html</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think that&#8217;s functional programming &#8211; just an examlpe of a fluent interface <a href="http://www.martinfowler.com/bliki/FluentInterface.html" rel="nofollow">http://www.martinfowler.com/bliki/FluentInterface.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spoon boy</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248612</link>
		<dc:creator>Spoon boy</dc:creator>
		<pubDate>Mon, 19 Oct 2009 20:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248612</guid>
		<description>Spoon boy: Do not try and bend the objects. That&#039;s impossible. Instead... only try to realize the truth.
Neo: What truth?
Spoon boy: There is no OOP.
Neo: There is no OOP?
Spoon boy: Then you&#039;ll see, that it is not the OOP that bends, it is only yourself.</description>
		<content:encoded><![CDATA[<p>Spoon boy: Do not try and bend the objects. That&#8217;s impossible. Instead&#8230; only try to realize the truth.<br />
Neo: What truth?<br />
Spoon boy: There is no OOP.<br />
Neo: There is no OOP?<br />
Spoon boy: Then you&#8217;ll see, that it is not the OOP that bends, it is only yourself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apocalisp</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248592</link>
		<dc:creator>Apocalisp</dc:creator>
		<pubDate>Mon, 19 Oct 2009 17:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248592</guid>
		<description>You&#039;re getting closer.

There is no Object-Oriented programming. There&#039;s only programming. Functional Programming is simply programming with pure functions.

Your &quot;objects&quot; want to be functions.</description>
		<content:encoded><![CDATA[<p>You&#8217;re getting closer.</p>
<p>There is no Object-Oriented programming. There&#8217;s only programming. Functional Programming is simply programming with pure functions.</p>
<p>Your &#8220;objects&#8221; want to be functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raoul Felix</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248577</link>
		<dc:creator>Raoul Felix</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248577</guid>
		<description>In addition to what Daniel Sobral said, another defining characteristic of functional programming is that the code should not produce any side effects. That is why there is no state and data has to be immutable.

There is also no notion of time in functional programming. If a function produces a result with a given set of parameters, it should always produce the same result given the same parameters.</description>
		<content:encoded><![CDATA[<p>In addition to what Daniel Sobral said, another defining characteristic of functional programming is that the code should not produce any side effects. That is why there is no state and data has to be immutable.</p>
<p>There is also no notion of time in functional programming. If a function produces a result with a given set of parameters, it should always produce the same result given the same parameters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Janko M.</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248568</link>
		<dc:creator>Janko M.</dc:creator>
		<pubDate>Mon, 19 Oct 2009 13:30:32 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248568</guid>
		<description>No. This is poor man&#039;s stack programming. 

Lucky for him he needed just one-level deep stack in this example. While this chain looks elegant and concise the &quot;extension methods&quot; used to enable it look verbose and complex as hell.</description>
		<content:encoded><![CDATA[<p>No. This is poor man&#8217;s stack programming. </p>
<p>Lucky for him he needed just one-level deep stack in this example. While this chain looks elegant and concise the &#8220;extension methods&#8221; used to enable it look verbose and complex as hell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Cormack</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248562</link>
		<dc:creator>Justin Cormack</dc:creator>
		<pubDate>Mon, 19 Oct 2009 12:44:14 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248562</guid>
		<description>If you want a real &quot;this is different&quot; example, you need to be returning functions. Something like the jquery pipeline model is more like it, where all the core library operations return functions not values. That example just returns a scalar, so it is not composable any more...</description>
		<content:encoded><![CDATA[<p>If you want a real &#8220;this is different&#8221; example, you need to be returning functions. Something like the jquery pipeline model is more like it, where all the core library operations return functions not values. That example just returns a scalar, so it is not composable any more&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Sobral</title>
		<link>http://codemonkeyism.com/functional-programming/comment-page-1/#comment-248555</link>
		<dc:creator>Daniel Sobral</dc:creator>
		<pubDate>Mon, 19 Oct 2009 11:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1299#comment-248555</guid>
		<description>Pipe lines are definitely one example of functional programming. There are few things that define functional programming:

1. Immutability. Data never changes, you just produce new data.

2. Functions as data. Functions can be passed around and manipulated just like any other type of data.

There, now you have Lisp. :-)

In traditional OO programming, each method called would change the data in-place. Not that this is a requirement of OOP, but it comes so naturally that it became the standard.</description>
		<content:encoded><![CDATA[<p>Pipe lines are definitely one example of functional programming. There are few things that define functional programming:</p>
<p>1. Immutability. Data never changes, you just produce new data.</p>
<p>2. Functions as data. Functions can be passed around and manipulated just like any other type of data.</p>
<p>There, now you have Lisp. :-)</p>
<p>In traditional OO programming, each method called would change the data in-place. Not that this is a requirement of OOP, but it comes so naturally that it became the standard.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
