<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Comment Feed for Channel 9 - Erik Meijer: Functional Programming</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming/RSS"></atom:link>
	<image>
		<url>http://ecn.channel9.msdn.com/o9/previewImages/100/249593_100x75.jpg</url>
		<title>Channel 9 - Erik Meijer: Functional Programming</title>
		<link></link>
	</image>
	<description>I caught up with the venerable Erik Meijer recently to discuss functional programming languages, academic versus real-world application of functional programming languages (there are very good reasons why people don&#39;t program Windows applications in, say,
 Haskell...) and, well, Erik. Why does Erik work here? What&#39;s his history?&amp;nbsp;Of course, as an academic type (he also ships software so he&#39;s not purely academic...), Erik is a big fan of strict functional or pure functional, as it were.
This is a deep interview and Erik spends most of the time on the whiteboard. Enjoy. There&#39;s lots to learn in this one...For those who are bandwidth challenged, 
here&#39;s&amp;nbsp;a low res version for download.</description>
	<link></link>
	<language>en</language>
	<pubDate>Wed, 19 Jun 2013 04:17:37 GMT</pubDate>
	<lastBuildDate>Wed, 19 Jun 2013 04:17:37 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Oh man I've been waiting for this since Brian's video on Monads. Awesome! <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-2.gif' alt='Big Smile' /><p>posted by tomkirbygreen</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362913650000000</link>
		<pubDate>Fri, 18 Jan 2008 22:16:05 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362913650000000</guid>
		<dc:creator>tomkirbygreen</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>This doesn't make any sense at all.</p>
<p>If in order to be truly &quot;pure&quot;, why don't we just replace our code with nothing but a bunch of constants?</p>
<p>We could then go around saying I write constants instead of I write code.</p>
<p>I don't understand the thinking that in order to be truly pure, it has to return the same value.&nbsp; Why can't it be pure if it returns the data type specified?&nbsp; I.e., if I say I'm goign to pass you back a string, then you can know for a fact you are going
 to get a string returned.&nbsp; </p>
<p>Why do we care what the actual value is?</p>
<p>Why would it make sense to have to specify not only the data type returned, but also that it's not a constant value by plaing &lt;IO&gt; in front of it?</p>
<p>Also, what's up with the Let?&nbsp; Why can't we just say x = &quot;whatever&quot;</p>
<p>I think it would be better if you show a sample application, where this type of functional programming language shines.</p>
<p>When we don't want our &quot;world&quot; to change, why doesn't it make more sense to use the concept of Interfaces when needed?</p>
<p>I think the problem with the concept of purity and functional programming, is that it's trying to force programmers into a box of how mathmeticians think.&nbsp;&nbsp;&nbsp; That logic falls apart because the need for a programming language is not simply to solve mathmetical
 equations.</p>
<p>To step back and keep it simple, rather than talking about how it works;</p>
<p>What problems does it solve?</p>
<p>How does it make programming or the end-result better?</p>
<p>posted by MetaGunny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362923420000000</link>
		<pubDate>Fri, 18 Jan 2008 22:32:22 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362923420000000</guid>
		<dc:creator>MetaGunny</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>Let me answer my own question here a little bit.<br /><br />Where I think this would be useful is as a feature in an existing language.<br /><br />For example, if you could create a certain type with a certain state.&nbsp; That way, if you have that special type you also know it has a certain state, or&nbsp;a certain value.&nbsp; The equivalent (somewhat) of saying what Erik said in his video of you know you're going
 to get a certain type and a certain value, but really I mean state.<br /><br />This would be beneficial in the case of a string for example.&nbsp; Let's say you create a new stringempty type, where whenever you get this value you back you know it will never be nothing.<br /><br />Why would this matter?<br /><br />It would eliminate all of the exceptions for&nbsp;people who don't check if string is nothing before trying to call the Trim() method on it for example.<br /><br />Imagine how many exceptions this would elimnate and how many lines of code it would eliminate.<br /><br />The bottom line is I don't care if a string is nothing, I just want to get the value, trim it, and see if it's equal or not equal to a certain value.</p>
<p>posted by MetaGunny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362931050000000</link>
		<pubDate>Fri, 18 Jan 2008 22:45:05 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362931050000000</guid>
		<dc:creator>MetaGunny</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Why functional programming? See Joe Duffy's video on ParallelFx here on C9 and Simon Peyton Jones' papers on Software Transactional Memory on the MS Research site for a couple approachs to improving the concurrency of applications in this multi-core age
 we live in.<p>posted by JChung2006</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362939800000000</link>
		<pubDate>Fri, 18 Jan 2008 22:59:40 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362939800000000</guid>
		<dc:creator>JChung2006</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[I've watched all of the related videos.<br /><br />However, I'm assuming that you reference reading other material because you yourself don't truly understand the why.<br /><br />If you did, you could have explained it.<p>posted by MetaGunny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362942240000000</link>
		<pubDate>Fri, 18 Jan 2008 23:03:44 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362942240000000</guid>
		<dc:creator>MetaGunny</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[FP is&nbsp;a toolset&nbsp;that makes some problems easier to tackle and some problems harder to tackle.<br /><br />You'll get better at your craft&nbsp;as you take the time to learn your tools, what they're good for and what they arent.
<br /><br />I think what is often taken for granted and omitted in these conversations is what real world scenarios certain techiques shine<br /><br />Here are some places where functional programming concepts are put to good use:<br /><br />&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;<br />A nice use of Monads to model async queries<br /><a href="http://www.aboutcode.net/2008/01/14/Async&#43;WebRequest&#43;Using&#43;LINQ&#43;Syntax.aspx">http://www.aboutcode.net/2008/01/14/Async&#43;WebRequest&#43;Using&#43;LINQ&#43;Syntax.aspx</a><br />Based on<br /><a href="http://blogs.msdn.com/wesdyer/archive/2008/01/11/the-marvels-of-monads.aspx">http://blogs.msdn.com/wesdyer/archive/2008/01/11/the-marvels-of-monads.aspx</a><br /><br />Throw in a Maybe Monad or an Exception Monad and you could get robust error handling in there too.<br /><br />&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;<br />Benefits of and a series on immutabability in C#<br /><a href="http://blogs.msdn.com/ericlippert/archive/2007/11/13/immutability-in-c-part-one-kinds-of-immutability.aspx">http://blogs.msdn.com/ericlippert/archive/2007/11/13/immutability-in-c-part-one-kinds-of-immutability.aspx</a><br /><br />BTW System.String is immutable and that alone removes so many headaches compared to dealing with LPCTSTR or even CString<br /><br />&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;<br />The ability to clearly describe and implement certain kinds of computations. (The Monads sample counts toward this)<br /><a href="http://notes-on-haskell.blogspot.com/2007_12_01_archive.html">http://notes-on-haskell.blogspot.com/2007_12_01_archive.html</a><br /><br />Take a look around and experiment a bit with languages. You dont have to use them but you can be surprised what they can bring to the table.<p>posted by ifeanyie</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362964460000000</link>
		<pubDate>Fri, 18 Jan 2008 23:40:46 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362964460000000</guid>
		<dc:creator>ifeanyie</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>Excellent points, ifeanyie.</p>
<p>C</p>
<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362965880000000</link>
		<pubDate>Fri, 18 Jan 2008 23:43:08 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362965880000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>Ifeanyie,<br /><br />Of course.&nbsp; I would had said the same thing.</p>
<p>However, a couple of things:<br /><br />1) The samples you gave used object oriented languages, not functional programming languages exclusively.</p>
<p>2) I've watched all of the C9 videos on these functional programming languages.&nbsp;&nbsp;I only remember one referring to a real world scenario which was in telecommunications.&nbsp; I even watched a video on youtube when the interviewee was younger and the demo showed&nbsp;them
 crashing the system, where only one process or&nbsp;thread would die,&nbsp;and it wouldn't bring down the whole system.&nbsp; How they could make changes live to the system and it would only affect new processes, etc.<br /><br />However,&nbsp;that really didn't relate&nbsp;back to the concepts of &quot;purity&quot;, etc&quot;, of the why someone should use functional programming languages.<br /><br />I'm not approaching this with an argument of why not to use functional programming.<br /><br />Rather, I'm simply asking someone to explain the reasoning behind FP&nbsp;in a &quot;KISS&quot; way on why it's better than an existing programming language.<br /><br />Or, maybe it's not meant for real world use in today's world.&nbsp; Maybe it's more of theory and bits and pieces are taken to enhance existing languages.<br /><br />I'm just looking for clarity on this subject.<br /></p>
<p>posted by MetaGunny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362994940000000</link>
		<pubDate>Sat, 19 Jan 2008 00:31:34 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362994940000000</guid>
		<dc:creator>MetaGunny</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[MetaGunny, it matters because purity is easier to reason about, and it's also easier for the compiler to process (if you want the compiler to help you sort out parallelism and concurrency, it almost always needs your code to be pure -- if the language
 is pure the compiler can guarantee that this is the case).<br />For example if you have a function that writes to a global variable when you call it, then you can not safely perform 100 tasks simultaneously which all use this function - the side effects mean that sequencing matters all of a sudden. And even if sequencing
 doesn't matter it's very likely that you'll need to protect the global variable with a lock, which destroys parallelism because of contention.<br /><br />If you instead write your algorithms in a functional style then not only is it easy to reason about (e.g. if you ever see that a function returns the wrong results given a set of input parameters, then you already have all the information you need to fix the
 bug, whereas in C&#43;&#43; you may have hours of &quot;quality time&quot; with the debugger before you're even able to figure out exactly what series of events lead to an inconsistent state). It's just more explicit, whereas with side effects everywhere you have all these
 hidden data flows that can mess up your program but are very difficult to find.<br />I work at a games company, so I do use C&#43;&#43; every day, and I would estimate that probably 80%&#43; or so of all bugs I encounter simply could not happen in a functional language because you'd just write things differently.<br /><br />Basically the issue I find is that when you write imperative code where you update state you need to sort of keep a &quot;mental log&quot; of what your code does as you read it. So at any point in the code you have to keep track of what happend before and go &quot;Okay, so
 if I end up in this branch then X is not null, and Y is greater than zero&quot; etc. etc. It just fills up your mental resources book-keeping all the state changes that you've done to make sure you're doing the right thing at the right time. In a purely functional
 world all that disappears. All you have is input and output. You combine the input into the output somehow, but you don't have to keep track of N previous operations to do it correctly, you only have to worry about inputs and outputs. You can feel how much
 more &quot;mental resources&quot; you have to spend on the actual problem, as opposed to book-keeping.<br /><br />Also, in an imperative programming language the &quot;meaning&quot; in a program consists of both &quot;values&quot; and &quot;statements&quot;. The values can be statically typechecked, but statements can not. In other words, if you swap parameters around in a function call, chances are
 good that the compiler will tell you about it, but if you swap the order of two statements around chances are good that it will keep compiling happily (and chances are high that the program will not do the right thing anymore). In a purely functional language
 the meaning is 100% values, so everything gets statically checked. It may not always be enough to ensure no bugs get through, but I think you'd be surprised at how often Haskell programs &quot;just work&quot; when you compile them, even after large changes (which almost
 never happens in C&#43;&#43;!).<br /><br />Finally the merits of being able to split effects up into separate monads is notable for example in STM. With STM the &quot;readTVar&quot; etc. operations are all in the &quot;STM&quot; monad (not &quot;IO&quot;), in that monad you can only read and write transactional variables (no other
 effects). This means that the compiler can statically guarantee that no irrevocable effects happen inside a transaction (which is dangerous because a transaction can be preempted and have to be re-run).<br /><p>posted by sylvan</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362998150000000</link>
		<pubDate>Sat, 19 Jan 2008 00:36:55 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362998150000000</guid>
		<dc:creator>sylvan</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>Thanks Sylvan.&nbsp; That clarified it for me.&nbsp; </p>
<p>Although I'm sure there are other benefits, I'm presuming functional programming is being talked about more and coming back because of multi-core.</p>
<p>So, the question is, is this all theory or is there a functional programming language I could start using today and write a massively parrell program in it easily?</p>
<p>posted by MetaGunny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362999690000000</link>
		<pubDate>Sat, 19 Jan 2008 00:39:29 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633362999690000000</guid>
		<dc:creator>MetaGunny</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">MetaGunny wrote:</div>
<div class="quoteBody">&#65279;
<p>Thanks Sylvan.&nbsp; That clarified it for me.&nbsp; </p>
<p>Although I'm sure there are other benefits, I'm presuming functional programming is being talked about more and coming back because of multi-core.</p>
<p></p>
</div>
</blockquote>
<p></p>
Yes that's probably true.<br />I guess languages always strive to improve productivity and correctness, and I personally think that functional programming provides enough benefits in these areas. I think Ericsson, from that telecom stuff you mentioned, meassured something like a 20x productivity
 boost compared to C&#43;&#43; (they switched to Erlang when their C&#43;&#43; implementation collapsed under its own complexity IIRC).<br /><br />But yes, it seems like the &quot;killer app&quot; that may finally convince the last remaining skeptics is the observation that it's immensly more suited to parallell and concurrent programming.<br /><p></p>
<blockquote>
<div class="quoteAuthor">MetaGunny wrote:</div>
<div class="quoteBody">&#65279;
<p>So, the question is, is this all theory or is there a functional programming language I could start using today and write a massively parrell program in it easily?</p>
</div>
</blockquote>
<br /><br />Yes, Haskell for sure. Download GHC at www.haskell.org/ghc<br />It has parallelism annotations (stick a &quot;par&quot; in the code and it will evaluate it in parallel), STM for the shared state concurrency, lightweight threads (you can easily kick of thousands of them - they're almost free and get mapped down onto actual OS threads
 by the runtime), and it's in the process of getting nested data parallelism, there's experimental code already in GHC (essentially you specify the parallelism on the data structures rather then on the control flow - this is pretty much the most fine grained
 parallelism you can get, e.g. it's what games use to process vertices and pixels, but Haskell's version will support nested data structures and not just flat arrays, and it will work for arbitrary code, not just shaders -- NDP requires purity btw, otherwise
 all the flattening and fusion transformations that the compiler needs to do wouldn't work).<br /><br />They mention it as &quot;useless&quot; but I think Eric got side tracked from the orginal graph and meant to show (like Simon PJ did in the interview they referred to) how Haskell over the last 20 years have moved &quot;up&quot; into the &quot;useful&quot; area by starting with the pure
 and elegant (but useless) and gradually shaping it into something that's actually useful. So now we have the pure and elegant foundation, but it's a fully general purpose language that you can use to write real applications (with GUIs, networking, database
 access, C interop and whatever you can imagine).<br /><p>posted by sylvan</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363008220000000</link>
		<pubDate>Sat, 19 Jan 2008 00:53:42 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363008220000000</guid>
		<dc:creator>sylvan</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Very interesting.&nbsp; Thanks Sylvan.<p>posted by MetaGunny</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363011280000000</link>
		<pubDate>Sat, 19 Jan 2008 00:58:48 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363011280000000</guid>
		<dc:creator>MetaGunny</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>And don't forget about <strong><a href="http://blogs.msdn.com/dsyme/default.aspx">F#</a>.</strong> It's a fantastic language that offers a huge amount of usefulness! Check it out.</p>
<p>C</p>
<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363016990000000</link>
		<pubDate>Sat, 19 Jan 2008 01:08:19 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363016990000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[That was an excellent video.<br /><br />As an old-school, impure programmer, I especially liked the way you cleared up what is meant by functional - in my old-school (C&#43;&#43;) ways, I kept thinking 'volatile results'... <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br />One could argue, though, that your starting premise is what is wrong with regards to the 'contract' each function call has, at least in terms of adding 'functional' features to an imperative language. And I suspect Charles may have thought that as well, which
 is why I suspect he asked about wether it was worthwhile to be able to 'flag' a call/routine as being 'functional' - f(x) called with the same 'x' returning the same result. Always. That is, we know
<b>our</b> (default) implementation of an (imperative) function (routine) is not pure, but look here, this function (routine) is meant to be pure, so please beef up the (static?) analysis, and tell me if this gets broken.<br /><br /><br />Anyway, thanks Erik and Charles. Excellent... [A]<br /><p>posted by RichardRudek</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363138380000000</link>
		<pubDate>Sat, 19 Jan 2008 04:30:38 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363138380000000</guid>
		<dc:creator>RichardRudek</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">MetaGunny wrote:</div>
<div class="quoteBody">&#65279;I've watched all of the related videos.<br /><br />However, I'm assuming that you reference reading other material because you yourself don't truly understand the why.<br /><br />If you did, you could have explained it.</div>
</blockquote>
<p>No, I referenced them, because they explain some of the benefits of pure functional programming where the minimization of shared mutable state can enable opportunities to simplify the construction of highly concurrent software.</p>
<p>Not sure why I wasted my time though. You're rude.</p>
<p>posted by JChung2006</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363212440000000</link>
		<pubDate>Sat, 19 Jan 2008 06:34:04 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363212440000000</guid>
		<dc:creator>JChung2006</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>It's interesting I think to observe just how much 'push back' / hostility there can to be Functional programming from the old-school / career predicated Object Orientated folks. I guess this is exactly what happened when OO was new and folks thought that
 C&#43;&#43; would never be a viable alternative to C, or going back further that HLLs would ever be a better choice than pure assembly. Of course it’s ironic that FP has been around since pretty much the dawn of computing.</p>
<p>When trying to convey quickly to folks at my company why I think FP &#43; the .NET Framework is such a incredibly powerful combination I usually direct then to read Erik's foreword to Don Syme's new 'Expert F#' book. Since I probably should quote it verbatim
 here I can just encourage folks to seek out Erik foreword - it's beautifully succinct and forms a very compelling argument.<br /></p>
<p>posted by tomkirbygreen</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363339900000000</link>
		<pubDate>Sat, 19 Jan 2008 10:06:30 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363339900000000</guid>
		<dc:creator>tomkirbygreen</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Charles, I really wished you would have brought up Spec# and asked Eric how that may play into the honest/dishonest comparison. If you used Spec# contracts, couldn't the compiler guarantee honesty so that you could have a mixture of honest and dishonest
 functions by examining the contracts?<br /><br />The thing that left me a little confused is that for the last 2 years we have been hearing how Orcas is bringing in functional programming concepts to C#. Maybe I missunderstood Eric, but it sounds like that is not true and seemed to contradict some of the
 past C9 videos that were promoting the products.<br /><br />This was a great interview though and was very stimulating....classic Channel 9.<br /><p>posted by JAlexandrian</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363586160000000</link>
		<pubDate>Sat, 19 Jan 2008 16:56:56 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363586160000000</guid>
		<dc:creator>JAlexandrian</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">JAlexandrian wrote:</div>
<div class="quoteBody">&#65279;Charles, I really wished you would have brought up Spec# and asked Eric how that may play into the honest/dishonest comparison. If you used Spec# contracts, couldn't the compiler guarantee honesty so that you could have a mixture of
 honest and dishonest functions by examining the contracts?<br /><br />The thing that left me a little confused is that for the last 2 years we have been hearing how Orcas is bringing in functional programming concepts to C#. Maybe I missunderstood Eric, but it sounds like that is not true and seemed to contradict some of the
 past C9 videos that were promoting the products.<br /><br />This was a great interview though and was very stimulating....classic Channel 9.<br /></div>
</blockquote>
<br /><br />LINQ is implemented as a monad (a functional construct). Lamda expressions and closures are functional contructs that are first class citizens in C#, an imperative language. We are not advocating that you throw away tools. Rather, add new ones to your toolbox.
 C# will continue to evolve as will VB.NET and C&#43;&#43;. F#, the newest member of the .NET family of languages, is a really powerful functional language that offers all of the benefits of functional plus full force .NET functionality.
<br /><br />The multi-core problem is not going to be solved by requiring developers to become functional programmers. The Parallel Computing Platform, for example,&nbsp;will be equally accessible from any CLI-based language. Parallel Extensions for .NET are implemented as
 a manged library and there is a lot more going on in the Developer Division that you haven't heard about yet... Stay tuned to Channel 9 for the details.<br /><br />Again, functional programming is one way of writing software and it&nbsp;does not have to&nbsp;replace the ways you are already comfortable with as we head into the highly concurrent future&nbsp;(so, C# will not
<em>become</em> a functional language even though it employs mechanisms that are functional in nature...).<br /><br />The more tools you have in your toolbox the more you can do. <br /><br />Exciting times indeed! <br /><br />Keep on learning,<br /><br />C<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363651430000000</link>
		<pubDate>Sat, 19 Jan 2008 18:45:43 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363651430000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[From the video, the main point seems to be that there are pure and impure functions. A pure function will give you the same result each time when you pass it the same arguments. An impure function will not.<br /><br />Now it seems to me, that there can not be such a thing as a pure function. Because every function takes some time to be executed, so every function has as a side-effect that time has passed, or ticks increased. So if you use Ticks anywhere in your program,
 as in the example in the clip, all functions would become instantly&nbsp;impure.<br /><br /><br />I&nbsp;liked&nbsp;the distinction between honest and dishonest functions. An honest function gives you an indication of wether or not it changes anything other then the parameters passed while a dishonest does not.<br /><br />What i liked most though was the explanation of how lambda functions were just a shorthand notation for a kind of class. That made lambda functions alot easier to understand.<br /><br />It's a bit strange though that instead of getting to see alot of benefits that you can get from using pure functions, about 40 minutes of the video were actually about the disadvantages of it and why only having pure functions doesn't work.<br /><br />Now i'm not sure if this is the right place to ask questions, but i wonder why functions still give a result. When you&nbsp;follow the convention that any result given , can also just be an out parameter of the function. It's easy to see that y = f(x) is the same
 as f(x,out y). However, when taking c# for example, there are a lot of things i could do in the second form that aren't possible in the first form. Like having multiple out parameters f(x, out y, out z). Or even overloading the function with a different type
 for the out parameter: f(int x, out int y) and f(int x, out string y).&nbsp;<br /><br />As a second pondering, switching between functional and object oriented, is just passing the object data as first parameter to the object function. So all object oriented programming is also functional programming. It's just grouped together with a bit more
 intuitive syntax. <br /><br />ps: thank you for providing a smaller download channel 9 crew. With a download cap of 12 GB&nbsp;a month in this backwards country, it is really appreciated to be able to get those vids in smaller sizes.<p>posted by ditonthouikwel</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363809340000000</link>
		<pubDate>Sat, 19 Jan 2008 23:08:54 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363809340000000</guid>
		<dc:creator>ditonthouikwel</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[(this is a response to people who are befuddled by purely functional programming)<br /><br />I can answer your questions with a thought experiment:<br /><br />If it's ok for a function to return arbitrary values when you call it with the same parameters, how does this affect the behaviour of other functions? Should 1&#43;1 always = 2? Should Console.WriteLine(&quot;Foo&quot;) print &quot;bar&quot;? If functions don't behave only according
 to the parameters you pass in, how do you specify how the function <b><i>should </i>
</b>behave? In other words, how do you program? Further, how can you ever hope to reason about or debug code that changes behaviour arbitrarily?<br /><br />This is why current languages provide a mix of purely functional behaviour (like integer addition), and &quot;impure&quot; behaviour which is harder to reason about. The more &quot;pure&quot; the behaviour, the more predictable and deterministic the program is, which means it's
 easier to understand and debug, and you can gain a higher confidence in its correctness.<br /><br />I wrote a post about a number of advanced languages features which I think most people misunderstand or downplay the value of:<br /><br /><a href="http://higherlogics.blogspot.com/2007/10/on-importance-of-purity.html">http://higherlogics.blogspot.com/2007/10/on-importance-of-purity.html</a><br /><p>posted by naasking</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363932510000000</link>
		<pubDate>Sun, 20 Jan 2008 02:34:11 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633363932510000000</guid>
		<dc:creator>naasking</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Here are a couple of questions to consider:<br /><br />static class A<br />{<br />&nbsp;&nbsp;&nbsp; static double f (double x) { return Math.Sin(x); }<br />}<br /><br />static class B<br />{<br />&nbsp;&nbsp;&nbsp; static double phi;<br />&nbsp;&nbsp;&nbsp; static double f (double x)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var r =&nbsp;Math.Sin (x &#43; phi);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; phi = Math.Sin(x);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return r;<br />&nbsp;&nbsp;&nbsp; }<br />}<br /><br />What are the types of A.f and B.f? In .NET languages, both of them have type double -&gt; double, but one of them is pure and the other one isn't, so their *types* say nothing about their purity.<br /><br />In Haskell, B.f couldn't be written that way, and would&nbsp;have to be in a state monad (one way or another <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />, so its type would be
<br />double -&gt; StateMonad double <br />or some such like that, distinct from the type of A.f, which remains double -&gt; double. Thus, the compiler can *help* you compose pure functions like A.f with side-effecting functions like B.f by preventing non-sensical combinations. A programming language that
 can't tell you the difference between a side-effecting function from a non-side-effecting function can't help you avoid certain goofups.<br /><br />Side effects are available in pure functional programming, it's just that the side-effected stuff must be threaded through function arguments and return values, and Monads provide very solid abstractions for doing that.
<br /><br />It's a real pain, however, to have a beautiful, fully pure functional program, and then you want to plunk a Console.WriteLine down at the lower levels. You end up having to rewrite all the higher layers to be in the IO monad (unless you're an old hand and you
 foresaw the need <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />&nbsp;The mixed mode languages, where the type systems &quot;fibs&quot; to you about side-effecting functions having the same types as non-side-effecting functions, are real nice in the plunking department, precisely because they can't TELL that you've
 just converted your beautiful functional palace into a side-effecting frat house by plunking down a Console.WriteLine.<br /><br /><p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364001410000000</link>
		<pubDate>Sun, 20 Jan 2008 04:29:01 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364001410000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>Brian,</p>
<p>In my humble opinion, that's one of the best posts I've ever read on Channel 9. Love the frat house analogy <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />
<br /><br />Thank you.</p>
<p>C</p>
<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364016810000000</link>
		<pubDate>Sun, 20 Jan 2008 04:54:41 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364016810000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[naasking,<br /><br />Great blog. Thanks for the link.<br />C<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364020610000000</link>
		<pubDate>Sun, 20 Jan 2008 05:01:01 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364020610000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Brian is a genius, so you might find my example more simple to understand:<br /><br />static int doesSideEffects(string text, int a, int b){<br />&nbsp; Console.Write(text);<br />&nbsp; return a &#43; b;<br />}<br /><br />static void Main(){<br />&nbsp; int result1, result2;<br /><br />&nbsp;// statement 1:<br />&nbsp; result1 = doesSideEffects(&quot;first one!&quot;, 1, 2);<br />&nbsp;// statement 2:<br />&nbsp; result2 = doesSideEffects(&quot;second one!&quot;, 3, 4);<br /><br />&nbsp; Console.Write(result1 &#43; result2);<br />}<br /><br /><br />Can we shuffle the statement 1 and 2? Can we do them at the same time? The answer is no, because we must guarrantee that the first statement's Console.Write() happens before the second one.<br /><br />static int noEffects(string text, int a, int b){<br />&nbsp; Console.Write(text);<br />&nbsp; return a &#43; b;<br />}<br /><br />static void Main(){<br />&nbsp; int result1, result2;<br /><br />&nbsp;// statement 1:<br />&nbsp; result1 = noEffects(&quot;first one!&quot;, 1, 2);<br />&nbsp;// statement 2:<br />&nbsp; result2 = noEffects(&quot;second one!&quot;, 3, 4);<br /><br />&nbsp; Console.Write(result1 &#43; result2);<br />}<br /><br /><br />Can we shuffle the statement 1 and 2? Can we do them at the same time? The answer is yes, because result2 does not rely on result1, and the function call has no sideeffects, so it doesn't matter if result2 is computed before result1.<br /><br /><br /><br />Some things that a pure (or shall we say a function which is constant with respect to it's arguments) function have that a side-effecting function doesn't have include:<br /><br />Let A and B be one or more statements, which contain no side-effects.<br />Let AB denote the instruction or set of instructions A followed by the instructions in B.<br /><br />1. AB has no side-effects.<br />2. If B does not depend on A, then AB = BA<br />3. If A is a function that takes arguments c1 ... cn, and c1... cn are known at the time of compilation, then the result of A can be fully determined at compile-time (i.e. never needs to be computed in the program, which makes your program faster).<br />4. If B does not depend on A, then A and B can be executed on different threads at the same time.<br />5. If A1 ... An are independent, non-side-efffecting blocks, then loops such as<br /><br />int[] arr = new int[10000];<br />for(int i=0;i&lt;arr.Length;i&#43;&#43;){<br />&nbsp; arr[i] = noEffectButLongFunction(i);<br />}<br /><br />Can be split across a number of threads without penalty.<br /><br />6. If A is a constructor which is fully disposed before it is ever passed to, or assigned from a side-effecting function, it can be at least partly optimised away, e.g.<br /><br />class ComplexNumer {<br />&nbsp; int re, im;<br />&nbsp; [NoEffects]<br />&nbsp; ComplexNumer(int re, int im){<br />&nbsp;&nbsp;&nbsp; this.re = re; this.im = im;<br />&nbsp; }<br />&nbsp; [NoEffects]<br />&nbsp; public static operator ComplexNumber &#43;(ComplexNumber a, ComplexNumber b){<br />&nbsp;&nbsp;&nbsp; return new ComplexNumber(a.re &#43; b.re, a.im &#43; b.im);<br />&nbsp; }<br /><br />&nbsp; [NoEffects]<br />&nbsp; public double Magnitude {<br />&nbsp;&nbsp;&nbsp; // sqrt has no side-effects.<br />&nbsp;&nbsp;&nbsp; return Math.Sqrt(re * re &#43; im*im);<br />&nbsp; }<br />}<br /><br />public int Main(){<br />&nbsp; double mag = (new ComplexNumber(1,0) &#43; new ComplexNumber(4,3)).Magnitude;<br />}<br /><br />What optimisations can we do to Main?<br /><br />Step1: Let's make everything explicit:<br /><br />int mag = Operator&#43;( new ComplexNumber(1,0), new ComplexNumber(4, 3) );<br /><br />but because new ComplexNumber() is constant with respect to its arguments, we know at compile time the value of new ComplexNumber(1,0) and ComplexNumber(4,3).<br /><br />but Operator&#43; is constant with respect to its arguments, so we <u>know</u> that it's value can be fully determined at compile time, so we evaluate it to get<br /><br />new ComplexNumber(5, 3).Magnitude.<br /><br />But .Magnitude is constant with respect to it's arguments, and we know ComplexNumber(5,3) at compile time, so we can evaluate it to be Math.Sqrt(34). But Math.Sqrt is c wrt. args, so we can even evaluate it at compile time!<br /><br />So ultimately we have reduced a potentially costly expression like<br />public int Main(){<br />&nbsp; double mag = (new ComplexNumber(1,0) &#43; new ComplexNumber(4,3)).Magnitude;<br />}<br />to<br />public int Main(){<br />&nbsp; double mag = 5.830952;<br />}<br /><br />entirely at compile time, and thus your program will run faster, and more errors can be caught before you ever ship the program to your customers.<br /><br />And less errors for customers and more (provably correct) parrallized code means that your programs will be more reliable and faster. So to sum up, pure functions and functional programming techniques leads to more money and prestige for you. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' /><br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364020630000000</link>
		<pubDate>Sun, 20 Jan 2008 05:01:03 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364020630000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Ooh, ooh, I really like the AB = BA observation ... it reminds me of group theory, where we consider commutators<br /><br />[AB] =def= AB - BA<br /><br />which are members of the group that *measure* the extent to which two other members of the group, namely A and B, do not commute. If you've solved Rubik's cube, you'll remember such commutators as one of the only two building blocks&nbsp;you need to solve it (the
 other being PQp =def= PQ(P^-1), the conjugator or &quot;change-of-coordinates&quot; gadget).<br /><br />So two statements are perhaps just mutually non-side-effecting if their commutator is zero. They may side-effect a whole bunch of other stuff, but they don't hurt each other.
<br /><br />In solving the cube, the general strategy is to find some brute-force operation, say Q,&nbsp;that does something you want, but may side-effect the bejeebers out of other cubelets. First, get the cubelets you CAN'T&nbsp;afford to hurt out of the way of the bejeebers with
 another brute-force op, P, then do the Q you want, then put the cubelets you saved back with a p = (P^-1), undoing all the deleterious side effects!<br /><br />If we could UNDO side-effects in programs (Rollback, anyone?), then we could do all the mess we wanted (Q) so long as we got stuff out of the way first (P), then undid the mess (cleaned up the frat house, p=P^-1)<br /><br />The Time Warp operating system allowed us to undo side-effects by sending antimessages and canceling things that never should have been done.&nbsp;Hmmm, maybe there's a group-theory accounting of Time Warp available.<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364104340000000</link>
		<pubDate>Sun, 20 Jan 2008 07:20:34 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364104340000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">brianbec wrote:</div>
<div class="quoteBody"><br />So two statements are perhaps just mutually non-side-effecting if their commutator is zero.</div>
</blockquote>
<br /><br />Can I use this as my email signature?<img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br />C<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364214290000000</link>
		<pubDate>Sun, 20 Jan 2008 10:23:49 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364214290000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[This is really interesting stuff Charles..<br />I hope we can have a video with Anders Hejlsberg on things like that...&amp; further any notion of what in future can be added to our toolbox in C#...<br /><br /><a href="http://programming.reddit.com/info/64th1/comments/c02u9mb">http://programming.reddit.com/info/64th1/comments/c02u9mb</a><br /><br />THis one for guys who are still trying to understand Monads..<br /><br />Thx Charles...<p>posted by gaurav.net</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364372390000000</link>
		<pubDate>Sun, 20 Jan 2008 14:47:19 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364372390000000</guid>
		<dc:creator>gaurav.net</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[As said and to sum it up: the deal here is to give the compiler hints to optimize the code for you... That's why side effects should be visible in the code.<br /><br />Nice video. Well done and good questions <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> I hope you have more of these in the pipeline, Charles...<p>posted by littleguru</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364418640000000</link>
		<pubDate>Sun, 20 Jan 2008 16:04:24 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364418640000000</guid>
		<dc:creator>littleguru</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">gaurav.net wrote:</div>
<div class="quoteBody">&#65279;This is really interesting stuff Charles..<br />I hope we can have a video with Anders Hejlsberg on things like that...&amp; further any notion of what in future can be added to our toolbox in C#...<br /><br /><a href="http://programming.reddit.com/info/64th1/comments/c02u9mb">http://programming.reddit.com/info/64th1/comments/c02u9mb</a><br /><br />THis one for guys who are still trying to understand Monads..<br /><br />Thx Charles...</div>
</blockquote>
<br /><br />Absolutely. It's important to showcase various perspectives on interesting topics in programming. I'd imagine Anders et al (including Erik) are busy at work innovating C# V.Next. When we can talk about what they're working on publicly, you can bet we will.
 This goes for VB.NET, C&#43;&#43; and F# as well. All of these <strong><em>great</em></strong> languages deserve deep-dive and compelling interviews! Certainly, the people who create them are unusually gifted in the art of language design and implementation&nbsp;and we
 want to showcase them on C9.<br /><br />C<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364463830000000</link>
		<pubDate>Sun, 20 Jan 2008 17:19:43 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364463830000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">brianbec wrote:</div>
<div class="quoteBody">&#65279;<br />If we could UNDO side-effects in programs (Rollback, anyone?), then we could do all the mess we wanted (Q) so long as we got stuff out of the way first (P), then undid the mess (cleaned up the frat house, p=P^-1)<br /></div>
</blockquote>
<br /><br />Madness! Sheer madeness! Sounds fun though. I suppose you could implement it by buffering all of the side-effects (store backups of mutated memory in objects, and buffer external requests like writes etc), although there are some side-effects that you would
 never be able to do:<br /><br />(Assume, for argument's sake that atomic blocks are rolled back when any exception occurs):<br /><br />atomic {<br />&nbsp; int i =readIntFromConsole();<br />&nbsp; Console.Write(i / 0);<br />}<br /><br />Naturally the (i / 0) would throw an error, but you can't rollback a user-interaction request, without some more complicated memory-wiping device (illegal in the States, shucks). But in principle statements such as
<br /><br />atomic {<br />&nbsp; int i, j<br />&nbsp; i = 4; j = 0;<br />&nbsp; Console.WriteLine(&quot;Writing a line&quot;);<br />&nbsp; i / j;<br />}<br /><br />Could maybe be changed to catch the write line... did anyone say Linq?<br /><br />List&lt; FutureFunc &gt; atomicBlock = new List&lt; FutureFunc &gt;();<br />try {<br />&nbsp; &nbsp; int i, j;<br />&nbsp; &nbsp; i = 4; j = 0;<br />&nbsp;&nbsp;&nbsp; // this happens because we know Console.WriteLine() is a side-effects function<br />&nbsp;&nbsp;&nbsp; atomicBlock.Add ( x&nbsp; =&gt; Console.WriteLine(&quot;Writing a line&quot;);<br />&nbsp;&nbsp;&nbsp; i / j;<br /><br />&nbsp;&nbsp;&nbsp; // commit changes:<br />&nbsp;&nbsp;&nbsp; foreach( FutureFunc f in atomicBlock) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // this also assumes that f doesn't rely on certain things, or mutate structures that we later rely on in non-side-effecting functions<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f.Invoke();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }catch(Exception e){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // it's more difficult to work out what to do with<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // exceptions if they happen here:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw e;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}catch(Exception e){<br />&nbsp; // rethrow, or do something;<br />&nbsp; throw e;<br />}<br /><br /><br />Generally a hard problem, methinks.<br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364474440000000</link>
		<pubDate>Sun, 20 Jan 2008 17:37:24 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364474440000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[It would be great to see a C9 video on Spec# (I couldn't find one with a search, I appologize if one already exists). A compiler that could verify which functions had side-effects in your C# code and what they are could make C# more &quot;honest.&quot; It seems
 to me that development of this project could solve some of the problems Erik mentioned in terms of unknown side-effects.<br /><br /><a href="http://research.microsoft.com/specsharp/">Spec# Microsoft Research Project</a><br /><a href="http://geekswithblogs.net/Podwysocki/archive/2007/12/10/117542.aspx">Great explination of Spec# by Matthew Podwysocki</a><br /><p>posted by JAlexandrian</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364477660000000</link>
		<pubDate>Sun, 20 Jan 2008 17:42:46 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364477660000000</guid>
		<dc:creator>JAlexandrian</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Just to be pedantic: I used physics lingo for the commutator<br /><br />[AB] = AB - BA<br /><br />but in group theory this must, of course, be written<br /><br />ABab, <br /><br />where a = A inverse, b = B inverse, and &quot;- BA&quot; = (BA) inverse = ab<br /><br />because we don't have the &quot;-&quot; in a group. Just mixing my metaphors all over the place.<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364494740000000</link>
		<pubDate>Sun, 20 Jan 2008 18:11:14 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364494740000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[That is exactly how Time Warp works. <br /><br />Every&nbsp;object has a local virtual time (LVT) clock that says what time it is &quot;now,&quot; virtually and locally, of course.
<br /><br />Every method call generates an &quot;activation record&quot; in the operating system, which is realized as a &quot;message&quot; M from a Sender object S, to a Receiver object R, from a virtual SendTime (ST), to a virtual ReceiveTime (RT).
<br /><br />Messages also have an algebraic sign, plus or minus. Messages are always created and destroyed in &#43; / - pairs. Everything else in the messages of a matching pair is bit-wise identical (optimize via hashes). More on creation and destruction in a bit.<br /><br />For each object O, the operating system maintains an InputQueue IQ of&nbsp;incoming&nbsp;messages, ordered by ReceiveTimes RTs; an OutputQueue OQ of sent messages, ordered by SendTimes STs; and a StateQueue SQ of instance-variable blocks, ordered by the time &quot;just-before-which&quot;
 the state is needed to process an input message, denoted &quot;t minus epsilon&quot;<br /><br />The operating system schedules execution by the &quot;lowest-virtual-time-first&quot; discipline. When a method is entered at time T,&nbsp;user code &quot;wakes up&quot; with an input message with RT = T and a state with T-epsilon. When the method returns, the OS saves a state at time
 T for later method calls. When O makes a method call to receiver object R,&nbsp;OS generates a message pair for the call, saves the negative copy&nbsp;in O's OQ for later potential cancelation, and sends the positive copy to the receiver R.
<br /><br />When the positive copy of M arrives at R, there are two cases: either R is scheduled to run at a time later than M.RT (that is, R is sitting in the OS's scheduling Queue at a time later than local virtual &quot;now&quot; for the OS), or R is scheduled to run at some
 time earlier than M.RT. In case 1, OS ROLLS BACK object R to time M.RT (that is, reschedules R to run at the earlier time M.RT), and OS cancels (perhaps lazily) ALL the negative messages in R's output queue by sending them to their receivers, where they potentially
 annihilate their matching messages and cascade the rollbacks, canceling all deleterious side effects!<br /><br />The whole thing works like magic and gets REAL speedup (with lazy cancellation) on big networks and huge distributed apps like discrete-event simulations. It's also used inside game physics libraries to do optimistic collision response. I'd love a good excuse
 to resurrect Time Warp <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br />Search &quot;Time Warp Operating System&quot; and &quot;Theory of Virtual Time.&quot;<br /><br />There is some subtlety about multiple method calls at the same receive time, but just pick any deterministic sub-ordering and the system will work, I promise.<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364506730000000</link>
		<pubDate>Sun, 20 Jan 2008 18:31:13 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364506730000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Wow, our papers are kind of hard-to-find now (but they're still great reads, I promise <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br /><span class="slicetext" dir="ltr"><b>Jefferson</b> D. R. <b>85</b>, <b>Virtual Time</b>. ACM TOPLAS 7-3 pp. 404-425.
<b>Jefferson</b>. D. <br />R., Beckman B., et al. 87, The <b>Time</b> Warp. Operating System Operating Systems
<b>...</b></span><br /><br />still searching will post more<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364510520000000</link>
		<pubDate>Sun, 20 Jan 2008 18:37:32 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364510520000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[<a href="http://www.merl.com/papers/docs/TR2000-17.pdf">http://www.merl.com/papers/docs/TR2000-17.pdf</a><br /><br />for optimistic collision response<br /><p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364512310000000</link>
		<pubDate>Sun, 20 Jan 2008 18:40:31 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364512310000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">JAlexandrian wrote:</div>
<div class="quoteBody">&#65279;It would be great to see a C9 video on Spec# (I couldn't find one with a search, I appologize if one already exists). A compiler that could verify which functions had side-effects in your C# code and what they are could make C# more
 &quot;honest.&quot; It seems to me that development of this project could solve some of the problems Erik mentioned in terms of unknown side-effects.<br /><br /><a href="http://research.microsoft.com/specsharp/">Spec# Microsoft Research Project</a><br /><a href="http://geekswithblogs.net/Podwysocki/archive/2007/12/10/117542.aspx">Great explination of Spec# by Matthew Podwysocki</a><br /></div>
</blockquote>
<br /><br />spec# is very interesting. I will make this happen.<br /><br />Thanks for the suggestion.<br />C<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364512910000000</link>
		<pubDate>Sun, 20 Jan 2008 18:41:31 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364512910000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<table>
<tbody>
<tr>
<td valign="top" width="900">
<div class="slice">For some reason I can't click through any of these links, but this is a good list<br /><a class="slicetitle" href="http://portal.acm.org/citation.cfm%3Fid%3D37508"><b><br />Time warp operating system</b></a><br /><span class="slicetext" dir="ltr">This paper describes the <b>Time Warp Operating System</b>, under development for three
<br /><b>...</b> <b>Jefferson</b> 85 David R. <b>Jefferson</b>, Virtual <b>time</b>, ACM Transactions on
<b>...</b></span><br /><span class="sliceurl" dir="ltr">portal.acm.org/citation.cfm?id=37508</span></div>
<div class="slice"><a class="slicetitle" href="http://portal.acm.org/citation.cfm%3Fid%3D62392%26coll%3Dportal%26dl%3DACM"><br />The status of the <b>time warp operating system</b></a><br /><span class="slicetext" dir="ltr">The <b>Time Warp Operating System</b> (TWOS) is a special-purpose
<b>operating system</b> <b>...</b> <br /><b>Beckman</b>, B., <b>Jefferson</b>, D., DiLoretto, M., Sturdevant, K., Hontalas, P.,
<b>...</b></span><br /><span class="sliceurl" dir="ltr">portal.acm.org/citation.cfm?id=62392&amp;coll=portal&amp;dl=ACM</span><br /></div>
<div class="slice"><a class="slicetitle" href="http://citeseer.ist.psu.edu/344314.html"><br />Parallel Simulation Using The <b>Time Warp Operating System</b> - Reiher <b>...</b></a><br /><span class="slicetext" dir="ltr">Both are based on <b>Jefferson</b> s (<b>Jefferson</b> 1985) work on virtual
<b>time</b> and use <b>...</b> <br />and the <b>Time Warp Operating System</b> (context) - <b>Jefferson</b>, <b>Beckman</b> et al.
<b>...</b></span><br /><span class="sliceurl" dir="ltr">citeseer.ist.psu.edu/344314.html - 23k</span><br /></div>
<div class="slice"><a class="slicetitle" href="http://citeseer.ist.psu.edu/67112.html"><br />Providing Determinism In the <b>Time Warp Operating System</b> - Costs <b>...</b></a><br /><span class="slicetext" dir="ltr">44 Distributed Simulation and the <b>Time Warp Operating System</b> (context) -
<b>Jefferson</b>, <br /><b>Beckman</b> et al. - 1987 21 Benchmarking the <b>Time Warp Operating System</b>
<b>...</b></span><br /><span class="sliceurl" dir="ltr">citeseer.ist.psu.edu/67112.html - 23k</span></div>
<div class="slice"><a class="slicetitle" href="http://www.netlib.org/utk/lsi/pcwLSI/text/node364.html"><br />15.3 <b>Time Warp</b></a><br /><span class="slicetext" dir="ltr">We designed the <b>Time Warp Operating System</b> (TWOS) to address this problem.
<b>...</b> <br />project were David <b>Jefferson</b>, Peter Reiher, Brian <b>Beckman</b>, Frederick Wieland,
<b>...</b></span><br /><span class="sliceurl" dir="ltr">www.netlib.org/utk/lsi/pcwLSI/text/node364.html - 10k</span><br /></div>
<div class="slice"><a class="slicetitle" href="http://www.lib.uci.edu/online/fellows/jefferson.html"><br />Chancellor's Distinguished Fellows: David R. <b>Jefferson</b> (UC Irvine <b>...</b></a><br /><span class="slicetext" dir="ltr">&quot;Distributed Simulation and the <b>Time Warp Operating System</b>,&quot; with
<b>Beckman</b>, Brian, <br />et al., UCLA Computer Science Department 1987, CSE Series #870042. <b>...</b></span><br /><span class="sliceurl" dir="ltr">www.lib.uci.edu/online/fellows/jefferson.html - 16k</span></div>
<div class="slice"><a class="slicetitle" href="http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/j/Jefferson:David_R%3D.html"><br />DBLP: David R. <b>Jefferson</b></a><br /><span class="slicetext" dir="ltr">David R. <b>Jefferson</b>. List of publications from the DBLP Bibliography Server - FAQ
<br /><b>...</b> R. <b>Jefferson</b>: Limitation of optimism in the <b>time warp operating system</b>.
<b>...</b></span><br /><span class="sliceurl" dir="ltr">www.informatik.uni-trier.de/~ley/db/indices/a-tree/j/Jefferson:David_R=.html - 13k</span><br /></div>
<div class="slice"><a class="slicetitle" href="http://ieeexplore.ieee.org/iel3/3070/8690/00383681.pdf"><br />Parallel discrete event simulation on a T9000 transputer net <b>...</b></a><br /><span class="slicetext" dir="ltr">Hontalas, B. <b>Beckman</b>, M. Di Loreto, L. Blume,
<b>...</b> Wieland, and D. <b>Jefferson</b>. <br />Benchmarking the <b>Time Warp Operating</b>. <b>System</b> with <b>...</b></span><br /><span class="sliceurl" dir="ltr">ieeexplore.ieee.org/iel3/3070/8690/00383681.pdf<br /></span></div>
</td>
</tr>
</tbody>
</table>
<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364514300000000</link>
		<pubDate>Sun, 20 Jan 2008 18:43:50 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364514300000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">brianbec wrote:</div>
<div class="quoteBody"><br />&nbsp; ...<br /></div>
</blockquote>
<br /><br /><br />You, sir, are a godsend. On the downside, I will get nothing done over the next three months as I'll be spending all my time writing code to do this in practise.<br /><br /><br />I have to admit I've been looking at compiler theory including optimisations, autoconcurrency and proofs of correctness over the past couple of weeks, and it's pretty astounding how deep this rabbithole goes. It also means that when people say &quot;how bad can
 a goto / unsafe block be?&quot; I nearly die of a heart attack.<br /><br />One of the crazy notions I had was to label functions within the .NET framework (such as Console.WriteLine) as side-effecting monads and to label functions (such as Math.Sin) as constant with respect to argument functions in order to get some of these benefits
 out, but I had completely forgotten about you folks down in Cambridge. Seems you beat me to it.<br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364549850000000</link>
		<pubDate>Sun, 20 Jan 2008 19:43:05 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364549850000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p class="MsoNormal"><span><strong>The great programming languages singularity<br /><br /></strong>It is interesting to see the &quot;effects&quot; of this video and the interesting discussions it generates. In particular it is fascinating to see people sharpening their understanding of what functional programming entails.<br /><br />Just as I like to eat as wide an variety of food as possible (for instance&nbsp;I drink three different kinds of tea at a time), I like to program in and learn about as many different languages as possible. For a while I was literelly collecting every language definition
 I could lay my hands on. So, I am not taking any sides in this context, and neither am I reflecting the official Microsoft position on this topic. I am making some personal observations, pointing out the fundamental assumptions behind each possible interpretation
 of what functional programming means, thereby hopefully offering Channel 9 viewers the opportunity to learn and increase their understanding of the field of programming languages and type systems.&nbsp;
<br /><br />According to Graham Hutton (<a href="http://www.cs.nott.ac.uk/~gmh/book.html">http://www.cs.nott.ac.uk/~gmh/book.html</a>) functional programming is defined as:
<em><span>Broadly speaking, functional programming is a style of programming in which the basic method of computation is the application of functions to arguments.</span></em> There are at least two ways to interpret this broad definition. First of all you
 can consider functional programming as a particular <em><span>style</span></em> of programming that values compositionality. The second way is to concentrate on the mathematical definition of
<em><span>function</span></em>, which implies purity.&nbsp; In order to bring clarity is often good to look at both sides of the coin and just like in coding, to really understand something you need to explore the edges of an idea. This is what Seth Godin (<a href="<a href="http://sethgodin.typepad.com/">http&#58;&#47;&#47;sethgodin.typepad.com&#47;</a>)%20calls"><a href="http://sethgodin.typepad.com/">http&#58;&#47;&#47;sethgodin.typepad.com&#47;</a>)
 calls</a> looking for the &quot;purple cow&quot;, or the &quot;free prize inside&quot;. I just love coins, both heads and tails.<br /><br />The Haskell interpretation of functional programming is <i>programming with pure mathematical functions</i>. The free prize inside Haskell is the observation that you can deal with effects by making all effects explicit in the type system and distinguishing
 pure values from side-effecting computations of values via monads. These computations are themselves values that can be combined using pure functions, which allows programmers to define their own &quot;control structures&quot;. This is why Simon Peyton Jones calls Haskell
 the world's best imperative language (<a href="http://research.microsoft.com/~simonpj/papers/marktoberdorf/">http://research.microsoft.com/~simonpj/papers/marktoberdorf/</a>). Another way of looking at this is that Haskell enables Landin's &quot;the next 700 programming
 languages&quot; <a href="http://www.cs.utah.edu/~eeide/compilers/old/papers/p157-landin.pdf">
http://www.cs.utah.edu/~eeide/compilers/old/papers/p157-landin.pdf</a>&nbsp;where you define a domain specific imperative sublanguage of effects (a monad plus non-proper morphisms) and glue together effectful computations using pure functions.
<br /><br />In Haskell, the type-system keeps track of effects. However, as anyone that has programmed in Haskell has experienced, this purity comes at a high price. As soon as one sub-expression has an effect, every expression that depends on that expression has a potential
 effect as well, and the monadness percolates all the way up.<br /><br />The underlying glue language in Haskell is based on three principles <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-13.gif' alt='Angel' /> abstraction, (b) parameterization, and (c) correspondence (<a href="http://people.cis.ksu.edu/~schmidt/text/info.html">http://people.cis.ksu.edu/~schmidt/text/info.html</a>), which brings
 us to the functional programming <em><span>style</span></em>. In normal words adhering to the functional programming style means allowing programmers to create closures of everything.
<br /><br />The purple cow in languages that use the functional programming <em><span>style</span></em> without insisting on absolute purity such as
<a href="http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf">
Lisp</a>, <a href="http://swiss.csail.mit.edu/projects/scheme/">Scheme</a>, <a href="http://www.smlnj.org/">
ML</a>, <a href="http://caml.inria.fr/">OCaml</a>, <a href="http://www.pragprog.com/titles/jaerlang">
F#</a>, <a href="http://www.pragprog.com/titles/jaerlang">Erlang</a>, <a href="http://www.scala-lang.org/">
Scala</a>, <span>&nbsp;</span><a href="http://www.algol68.org/">Algol68</a>, <a href="http://www.python.org/">
Python</a>, <a href="http://www.ruby-lang.org/en/">Ruby</a>, <a href="http://www.squeak.org/">
Smalltalk</a>, C#, Visual Basic, Java, .. is that <i>the compositional style allows for very concise programs, even in the presence of effects</i>. As a &quot;terminology purist&quot;, I like to refer to languages that embrace the functional style as “closure oriented”
 programming. Note that it is no coincidence that there is really just one major pure functional language and many more pragmatic closure-oriented languages.
<br /><br />This pragmatism is invaluable in practice. It is much easier to deal with reality if you are pragmatic. For example, if you write a compiler in F#, you can generate fresh identifiers and still use a nice functional style whereas in Haskell the fact that generating
 a fresh name is a side effect, you are forced to switch to a monadic style forcing the programming to explicitly order all effects. One of the problems is that Haskell lumps all effects together, so it is not possible to distinguish between &quot;benign&quot; effects
 that are commutative or idempotent,&nbsp;…&nbsp; and real &quot;bad&quot; effects.<br /><br />While closure-oriented languages make certain effects implicit (such as evaluation, state, exception, threads, events) that leaves many other effects that need to be dealt with explicitly, for example non-determinism (the IEnumerable monad).
<span>&nbsp;</span>So we increasingly see that languages that use the functional programming style also factor out certain effects explicitly and provide a monadic sublanguage for creating effectful computations. Query comprehensions in C# and VB directly correspond
 to monad comprehensions in Haskell and are applicable way beyond just queries. <br /><br />F# in particular is a noteworthy language since in F# this trend of making effects explicit is used extremely effectively (pun intended) and elegantly. For example it is advantageous to make events explicit (<a href="http://blogs.msdn.com/dsyme/archive/2006/03/24/559582.aspx">http://blogs.msdn.com/dsyme/archive/2006/03/24/559582.aspx</a>),
 or asynchronous workflows (<a href="http://blogs.msdn.com/dsyme/archive/2007/10/11/introducing-f-asynchronous-workflows.aspx">http://blogs.msdn.com/dsyme/archive/2007/10/11/introducing-f-asynchronous-workflows.aspx</a>), or computation expressions (<a href="http://blogs.msdn.com/dsyme/archive/2007/09/22/some-details-on-f-computation-expressions-aka-monadic-or-workflow-syntax.aspx">http://blogs.msdn.com/dsyme/archive/2007/09/22/some-details-on-f-computation-expressions-aka-monadic-or-workflow-syntax.aspx</a>),
 or query expressions (<a href="http://research.microsoft.com/fsharp/manual/lexyacc.aspx#Comprehensions">http://research.microsoft.com/fsharp/manual/lexyacc.aspx#Comprehensions</a>). As I have said before, I am especially excited and proud that Microsoft has
 decided to productize F# (<a href="http://www.apress.com/book/view/1590598504">http://www.apress.com/book/view/1590598504</a>).<br /><br />What is really great to see is that the pragmatic languages were influenced by Haskell, but created much more powerful comprehensions than Haskell to deal with real world problems, which in turn has influenced Haskell to incorporate some of these innovations
 back into Haskell l(<a href="http://homepages.inf.ed.ac.uk/wadler/topics/links.html#list-comp">http://homepages.inf.ed.ac.uk/wadler/topics/links.html#list-comp</a>). This is a truly beautiful programming language singularity (<a href="http://flakenstein.net/lib/flake-singularity.pdf">http://flakenstein.net/lib/flake-singularity.pdf</a>).
<br /><br /></span><span>These are great times for language designers and programmers alike!</span><br /><br />Erik Meijer&nbsp;aka <a href="http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/vbtv/default.asp">
Head In The Box</a></p>
<p>posted by Head.In.TheBox</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364650860000000</link>
		<pubDate>Sun, 20 Jan 2008 22:31:26 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364650860000000</guid>
		<dc:creator>Head.In.TheBox</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[It's pretty amazing how much you can prove about a program in a high level language such as C# or Haskell, given that fundamentally it compiles (or runs as) assembly code, which is in principle difficult to reason about.<br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364654640000000</link>
		<pubDate>Sun, 20 Jan 2008 22:37:44 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364654640000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>cool <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> erik is awsome as usual <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p>
<p>i had hoped to hear a bit more about the good reasons why one dont write windows programs in haskell though.. thats the one thing that i think is making it hard for me to understand fp. in general it seems that fp is like the philosophers stone,&nbsp;once you
 master it you can do anything and not only that, it will have free scalability and will be error proof to boot <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />
<br /><br />clearly this is not so and i dont think even the most hardcore fp buffs really think that, but im just trying to describe how it feels to me as a simple c#/java programmer <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />
<br /><br />so what are the reasons according to the masters why, say haskell is not used for general purpose programing? charles i know you asked the question but i think that could be a topic for a whole interview<br /><br />again, im not trying to debunk fp or question its usefullness, but i think a more well rounded discussion where both the pros and cons get equal time whould be great <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> to get discouraged about fp just because one tried to apply it in the wrong area whould
 be a great shame and&nbsp;i think part of the reason why im yet to understand monads fully (besides beeing slightly daft;P) is because i have been trying to apply it to the wrong real world c# problems..<br /><br />i'd really really like to see more interviews that point out the cases where we (as in general purpose programmers)
<strong>already use monads today without realizing it</strong>. from what i understand from blogs/other c9 vids, that happens quite alot, ive just not connected the dots yet <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif' alt='Sad' /><br /><br />also id like to see more of the monads-are-sort-of-generic-classes type examples <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> (are they? if not, what are the diffrances/conditions?)<br /><br />thanks again charles and erik <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> </p>
<p>posted by aL_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364709660000000</link>
		<pubDate>Mon, 21 Jan 2008 00:09:26 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364709660000000</guid>
		<dc:creator>aL_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody">&#65279;
<p>cool <img src="/emoticons/emotion-1.gif" border="0"> erik is awsome as usual <img src="/emoticons/emotion-1.gif" border="0"></p>
<p>i had hoped to hear a bit more about the good reasons why one dont write windows programs in haskell though.. thats the one thing that i think is making it hard for me to understand fp. in general it seems that fp is like the philosophers stone,&nbsp;once you
 master it you can do anything and not only that, it will have free scalability and will be error proof to boot
<img src="/emoticons/emotion-1.gif" border="0"> <br /><br />clearly this is not so and i dont think even the most hardcore fp buffs really think that, but im just trying to describe how it feels to me as a simple c#/java programmer
<img src="/emoticons/emotion-1.gif" border="0"> <br /><br />so what are the reasons according to the masters why, say haskell is not used for general purpose programing? charles i know you asked the question but i think that could be a topic for a whole interview<br /><br />again, im not trying to debunk fp or question its usefullness, but i think a more well rounded discussion where both the pros and cons get equal time whould be great
<img src="/emoticons/emotion-1.gif" border="0"> to get discouraged about fp just because one tried to apply it in the wrong area whould be a great shame and&nbsp;i think part of the reason why im yet to understand monads fully (besides beeing slightly daft;P) is
 because i have been trying to apply it to the wrong real world c# problems..<br /><br />i'd really really like to see more interviews that point out the cases where we (as in general purpose programmers)
<strong>already use monads today without realizing it</strong>. from what i understand from blogs/other c9 vids, that happens quite alot, ive just not connected the dots yet
<img src="/emoticons/emotion-6.gif" border="0"><br /><br />also id like to see more of the monads-are-sort-of-generic-classes type examples <img src="/emoticons/emotion-1.gif" border="0"> (are they? if not, what are the diffrances/conditions?)<br /><br />thanks again charles and erik <img src="/emoticons/emotion-1.gif" border="0"> </p>
</div>
</blockquote>
<br /><br />FP remains arcane and unpopular for a bunch of reasons: historical and pedagogical, mostly. The grandfather of FP, LISP, got a bad reputation for performance in the early days, and suffered further guilt-by-association with the failures of AI in the 80's. This
 guilt by association was completely undeserved, as the failures of AI had little to do with choice of programming language (I know of some underperforming AI programs written in FORTRAN).<br /><br />FORTRAN and C early-on got the reputation as being THE choice languages for the discriminating programmer who had REAL problems to solve and needed to squeeze performance out of the machines. Many miracles in science and engineering were enabled because of
 number-crunching FORTRAN&nbsp;programs and operating systems written in C (yes, Windows is a miracle of engineering, despite its warts and wrinkles).
<br /><br />Can you name a famous program or system written LISP, ML (any dialect), Scheme, Haskell, etc.? There are some great programs out there, but not any famous ones, and new programmers are attracted by fame and naturally gravitate to the languages of the famous
 programs.&nbsp;(BTW, there is a really famous LISP program: it's the scripting language in AutoCAD)<br /><br />Finally, for people who are not fully trained in mathematics or physics, FP feels weird and hard to learn, especially if they have lots of programming experience in imperative languages. To a mathematician or physicist, FP is the most natural thing in the world.
 We all get this &quot;Oh, where has THIS been all my life&quot; feeling when we encounter it. But to the business or systems programmer with no exposure even to LISP, it feels &quot;inside-out.&quot; And it should, because FP starts with the math and SUBTRACTS abstraction where
 necessary to get to the machine. Imperative programming starts with the machine and ADDS abstraction up to the math.
<br /><br />The situation is just like that of colors: there are additive colors (red, green, and blue) and subtractive colors (cyan, magenta, yellow). It's possible to make up any picture by composing each kind within its own system, but it's difficult to mix the two.<br /><br />The future of FP is very bright. It's more than possible, it's plain EASIER to write real-world, high-performance apps and systems code in FP, because you don't have to keep reinventing over and over and over again all the math you need to make the programs
 small, beautiful, and RIGHT. Programmers are becoming more mathematical by training, and they've already seen some of the ideas of FP in school by the time they hit the streets. And, finally, it won't be long before there are some famous programs on the street
 and FP will capture some of the glitter and spotlight. There are already some miraculous F# programs (F# is not Haskell, but you get the drift)<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364868070000000</link>
		<pubDate>Mon, 21 Jan 2008 04:33:27 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633364868070000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">brianbec wrote:</div>
<div class="quoteBody"><br /><br />FP remains arcane and unpopular for a bunch of reasons: historical and pedagogical, mostly. The grandfather of FP, LISP, got a bad reputation for performance in the early days, and suffered further guilt-by-association with the failures of AI in the 80's. This
 guilt by association was completely undeserved, as the failures of AI had little to do with choice of programming language (I know of some underperforming AI programs written in FORTRAN).<br /><br />FORTRAN and C early-on got the reputation as being THE choice languages for the discriminating programmer who had REAL problems to solve and needed to squeeze performance out of the machines. Many miracles in science and engineering were enabled because of
 number-crunching FORTRAN&nbsp;programs and operating systems written in C (yes, Windows is a miracle of engineering, despite its warts and wrinkles).
<br /><br />Can you name a famous program or system written LISP, ML (any dialect), Scheme, Haskell, etc.? There are some great programs out there, but not any famous ones, and new programmers are attracted by fame and naturally gravitate to the languages of the famous
 programs.&nbsp;(BTW, there is a really famous LISP program: it's the scripting language in AutoCAD)<br /><br />Finally, for people who are not fully trained in mathematics or physics, FP feels weird and hard to learn, especially if they have lots of programming experience in imperative languages. To a mathematician or physicist, FP is the most natural thing in the world.
 We all get this &quot;Oh, where has THIS been all my life&quot; feeling when we encounter it. But to the business or systems programmer with no exposure even to LISP, it feels &quot;inside-out.&quot; And it should, because FP starts with the math and SUBTRACTS abstraction where
 necessary to get to the machine. Imperative programming starts with the machine and ADDS abstraction up to the math.
<br /><br />The situation is just like that of colors: there are additive colors (red, green, and blue) and subtractive colors (cyan, magenta, yellow). It's possible to make up any picture by composing each kind within its own system, but it's difficult to mix the two.<br /><br />The future of FP is very bright. It's more than possible, it's plain EASIER to write real-world, high-performance apps and systems code in FP, because you don't have to keep reinventing over and over and over again all the math you need to make the programs
 small, beautiful, and RIGHT. Programmers are becoming more mathematical by training, and they've already seen some of the ideas of FP in school by the time they hit the streets. And, finally, it won't be long before there are some famous programs on the street
 and FP will capture some of the glitter and spotlight. There are already some miraculous F# programs (F# is not Haskell, but you get the drift)</div>
</blockquote>
<br /><br />thanks for the reply <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> <br />to awnser your question, no i can tof the top of my head name a popular program written in the languages you mention, but then again, i usually dont know what language a program is written in <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> (i can guess its c&#43;&#43;/c# or java but i dont really know)<br /><br />again, im not trying to imply that FP is bad or something but surely there must be areas where its less useful than say imperative techniques? i think those areas are as important to highlight as the ones where FP is very useful such as concurrency. knowing
 the pros <strong>and</strong> the cons will make it&nbsp;easier for noobs such as me to understand fp, because we wont try and apply it in unneccesarily difficult situations. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br />as a side note, again from a semi noob in both areas, i find it sligtly odd that both dynamic languages and FP languages are haveing a second coming at the same time. they seem to be at opposing ends of the spectrum somehow.
<br /><br />dynamic languages are, according to to those who know, great because one is not &quot;restricted&quot; by the type system (like the one in java/c#)&nbsp;and can do anything.
<br />but say haskell, (as i understand it) has a whole lot stronger type system, so for a dynamic guy, shouldnt that be even worse&nbsp; than say&nbsp; c#?:O<br /><br />and it goes both ways, if youre a haskell guy and you think c#/java is bad because of all the potential side effects, whouldnt say, ruby be even worse? in ruby one dont even know what type you get back from a function, much less if it has a side effect.<br /><br />and yet, both these paradigms are on the rise..&nbsp;am i missing something?&nbsp;<img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-7.gif' alt='Perplexed' /> whats a simple programmer to do <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />
<p>posted by aL_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365065850000000</link>
		<pubDate>Mon, 21 Jan 2008 10:03:05 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365065850000000</guid>
		<dc:creator>aL_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody">&#65279;<br />again, im not trying to imply that FP is bad or something but surely there must be areas where its less useful than say imperative techniques? i think those areas are as important to highlight as the ones where FP is very useful such as concurrency. knowing
 the pros <strong>and</strong> the cons will make it&nbsp;easier for noobs such as me to understand fp, because we wont try and apply it in unneccesarily difficult situations.
<img src="/emoticons/emotion-1.gif" border="0"><br /></div>
</blockquote>
<br /><br />Yes. It's worth pointing out that there are a number of areas that for the foreseeable<b>
</b>future functional programming techniques won't be playing a part.<br /><br />Basically as Brian said, languages like C and Fortran start with the machine and add from there, whereas languages like Lisp and Haskell start with the math and subtract from there, so in applications that are very close to the machine your languages like C
 and C&#43;&#43; are going to remain more popular for a reasonably long time. Examples include the low level operating system, device drivers and the 3D rendering agent inside 3D programs (e.g. games).<br /><br />This being said, most tasks are problem-orientated, rather than machine-orientated, and it is these types of problems that are often best solved in languages like Haskell and Lisp. Where problem-oreientated programs turn into rich client applications, languages
 like F# bridge the final gap between solving the problem and allowing the user to use it.<br /><br /><blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody"><br />as a side note, again from a semi noob in both areas, i find it sligtly odd that both dynamic languages and FP languages are haveing a second coming at the same time. they seem to be at opposing ends of the spectrum somehow.
<br /><br />dynamic languages are, according to to those who know, great because one is not &quot;restricted&quot; by the type system (like the one in java/c#)&nbsp;and can do anything.
<br />but say haskell, (as i understand it) has a whole lot stronger type system, so for a dynamic guy, shouldnt that be even worse&nbsp; than say&nbsp; c#?<img src="/emoticons/emotion-3.gif" border="0"><br /><br /></div>
</blockquote>
<br /><br />For someone like me who's worked quite a lot with C and C&#43;&#43;, I know first hand the problems that can happen when you pass something around which isn't what you thought it was, usually crashing the application at point-of-use. The type system in C#, Haskell
 etc counteracts this to a large extent - instead of crashing the application at point of use, it stops the compiler at compile-time, which is nearly always a better idea. If you have 100 errors in your program, wouldn't you prefer to see them before you ship
 your application, rather than only catching 99 of them in test?<br /><br />Languages such as PHP and other essentially type-less languages help you to make errors by their lack of type checking. Consider the code:<br /><br />echo &quot;Twelve is &quot; &#43;&nbsp; (&quot;1&quot; &#43; &quot;2&quot;);<br />echo &quot;Twelve is &quot;. (&quot;1&quot; . &quot;2&quot; );<br /><br />Note that in PHP the dot '.' is the string-concatenator, and &#43; is a mathematical operator. In the first example (which happens remarkably often), I've accidentally used plus instead of dot. PHP doesn't mind however, since it can convert a string to an integer
 silently. &quot;Twelve is&quot; doesn't look like an integer, so becomes the value 0, &quot;1&quot; and &quot;2&quot; become 1 and 2 respectively and although echo expects a string, and (0 &#43; 1 &#43; 2) is an integer, it doesn't matter because PHP can convert it straight back into the string
 &quot;3&quot;!.<br /><br />If this little code snippet occurred hidden away somewhere, and I didn't test for it, I might never notice that I've used this incorrectly. Haskell would object to my using &#43; with strings and echo with ints respectively, and would never have run the first time.<br /><br />Ultimately this means that type-less or mostly type-less languages are great for scripting small programs, but when it comes to proper applications of more than a couple of hundred lines, it becomes incredibly important to have strong type checking, to reduce
 the strain of testing, and to catch as many of the obvious little errors before you ship your application to users.<br /><br /><blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody"><br />and it goes both ways, if youre a haskell guy and you think c#/java is bad because of all the potential side effects, whouldnt say, ruby be even worse? in ruby one dont even know what type you get back from a function, much less if it has a side effect.<br /><br />and yet, both these paradigms are on the rise..&nbsp;am i missing something?&nbsp;<img src="/emoticons/emotion-7.gif" border="0"> whats a simple programmer to do
<img src="/emoticons/emotion-1.gif" border="0"> </div>
</blockquote>
<br /><br />True, although you have to be careful with Ruby. It's actually strongly typed behind-the-scenes, which helps catch a number of errors, even if you don't force the types at compile time - it can usually infer them from context.<br /><br /><br />Basically, the benefits in FP and strong static typing come through most promintently in large, real world apps. They catch silly mistakes and abstract things like concurrency so the programmer doesn't have to think about it.<br /><br />The languages where strong static typing are not commonly used are nearly invariably designed to be used as small, quick scripts, such as Bash, or on webpages such as PHP and Javascript. One could argue that these uses are sufficiently small that the benefits
 of FP and static typing don't come through, (although I would disagree).<br /><br />In all real world applications there are errors (yes, even in Microsoft programs), however the number of these can be reduced by extensive testing (expensive) or by automatic detection, which is what static typing is designed to do. By enfocing this by using
 strong static typing, you guarrantee that errors are errors of logic or input, rather than silly errors such as forgetting what parameters a function takes, using the wrong operator etc.<br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365164860000000</link>
		<pubDate>Mon, 21 Jan 2008 12:48:06 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365164860000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody">&#65279;<br /><br />and yet, both these paradigms are on the rise..&nbsp;am i missing something?&nbsp;<img src="/emoticons/emotion-7.gif" border="0"> whats a simple programmer to do
<img src="/emoticons/emotion-1.gif" border="0"> <br /><br /></div>
</blockquote>
<br /><br />Here's the doctor's prescription for you:<br /><br />In your daily work, use C#, VB, and F#.&nbsp;<br /><br />Get, read, and work EVERY problem in Structure and Interpretation of Computer Programs, by Abelson and Sussman. (Use PLT Scheme to do the problems).<br /><br />When done with SICP, get, read, and work EVERY problem in Expert F# by Don Syme, et al. Use F#, obviously<br /><br />When done with that, come back for a Haskell prescription. The stuff above should take you three years.<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365285210000000</link>
		<pubDate>Mon, 21 Jan 2008 16:08:41 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365285210000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>It took me a while to understand what was being expressed in the video.. but still I think I managed to miss the usage concepts..<br /><br />Ok, so we have functions (methods?) that are more transparent about how they work, they provide an overview how the return data is aquired, I don't think you said anything about if exceptions are noted here (like with; as was noted, java)..<br /><br />So ok, great, we have a system where everything is 'honest' about it's workings, why is that useful?</p>
<p>posted by stevo_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365327410000000</link>
		<pubDate>Mon, 21 Jan 2008 17:19:01 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365327410000000</guid>
		<dc:creator>stevo_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">stevo_ wrote:</div>
<div class="quoteBody">&#65279;
<p>It took me a while to understand what was being expressed in the video.. but still I think I managed to miss the usage concepts..<br /><br />Ok, so we have functions (methods?) that are more transparent about how they work, they provide an overview how the return data is aquired, I don't think you said anything about if exceptions are noted here (like with; as was noted, java)..<br /><br />So ok, great, we have a system where everything is 'honest' about it's workings, why is that useful?</p>
</div>
</blockquote>
<br /><br />I'm glad you put the term honest in quotes. I don't think it's the precise way to express what Erik is talking about (then again, I'm not precisely qualified to debate Erik - he's a programming&nbsp;language expert. I'm not.). Perhaps a clearer (and less contentious)&nbsp;way
 to think about this is in terms of surpise-capable(unexpected side effectual)&nbsp;versus surprise-free (a priori side-effectual or side effect free (also known as 'useless'))&nbsp;functions. So, if you call a 'pure' function then you can expect, and rely upon up front(prior
 to execution of said function - a priori...), no invokations of Surprise that could end up breaking your algorithm or befuddling your critical operation because, well, that's what Surprises are all about&nbsp;- you are not expecting them and therefore you have
 no way to handle them since you didn't write code that expects them (and code that calls your code is in the same boat so the Surprise bubbles up through the system surprising callers, which is not very composable, right?)
<br /><br />Does this make sense?<br /><br />C<p>posted by Charles</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365336230000000</link>
		<pubDate>Mon, 21 Jan 2008 17:33:43 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365336230000000</guid>
		<dc:creator>Charles</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">Charles wrote:</div>
<div class="quoteBody">&#65279;<br /><br />I'm glad you put the term honest in quotes. I don't think it's the precise way to express what Erik is talking about (then again, I'm not precisely qualified to debate Erik - he's a programming&nbsp;language expert. I'm not.). Perhaps a clearer (and less contentious)&nbsp;way
 to think about the this is in terms of surpise-capable(unexpected side effectual)&nbsp;versus surprise-free (a priori side-effectual or side effect free (also known as 'useless'))&nbsp;functions. So, if you call a 'pure' function then you can expect, and rely upon up
 front(prior to execution of said function - a priori...), no invokations of Surprise that could end up breaking your algorithm or befuddling your critical operation because, well, that what Surprises are - you are not expecting them and therefore you have
 no way to handle them since you didn't write code that expects them (and code that calls your code is in the same boat so the Surprise bubbles up through the system surprising callers, which is not very composable, right?
<br /><br />Does this make sense?<br /><br />C<br /><br /></div>
</blockquote>
<br /><br />Charles speaks the truth <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /><br /><br />I like to focus on the type system: if the type system cannot tell you the difference between a side-effecting function and a non-side-effecting function, then the type system isn't telling you &quot;the whole truth.&quot; That is, it's not telling you everything about
 your program that it is possible, mathematically, to say. <br /><br />How about this:<br /><br />side-effecting function = useful function<br />non-side-effecting function = useless function<br /><br />type system that can always tell the difference = wholly truthful<br />type system that can't always tell the difference = partially truthful<br /><br />monadic function = useful function, helps a partially truthful type system to tell the whole truth.<p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365341750000000</link>
		<pubDate>Mon, 21 Jan 2008 17:42:55 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365341750000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody"><br /><br />dynamic languages are, according to to those who know, great because one is not &quot;restricted&quot; by the type system (like the one in java/c#)&nbsp;and can do anything.
<br />but say haskell, (as i understand it) has a whole lot stronger type system, so for a dynamic guy, shouldnt that be even worse&nbsp; than say&nbsp; c#?<img src="/emoticons/emotion-3.gif" border="0"><br />&#65279;<br />&nbsp;</div>
</blockquote>
<br /><br />I think there is a lot of misunderstanding &quot;in the air&quot; about &quot;dynamic typing.&quot; I think it's often confused with &quot;weak typing.&quot; Scheme is a great example of a &quot;dynamically typed&quot; language that is also (mostly) &quot;strongly typed.&quot;
<br /><br />&quot;Dynamically typed&quot; just means that types are carried around with data and are checked at run time, not at compile time.<br />&nbsp;<br />&quot;Strongly typed&quot; just means that there are not a lot of implicit conversions going on. If you call a function that expects a double and you pass it a string, you will get an error. In a statically typed, strongly typed language, you will get the error at compile
 time. In a dynamically typed, strongly typed language, you will get the error at run time.<br /><br />Math.Sin(&quot;32.6&quot;) --&gt; compile-time error if statically typed, strongly typed.<br /><br />Math.Sin(&quot;32.6&quot;) --&gt; run-time error if dynamically typed, strongly typed.<br /><br />&quot;Weakly typed&quot; just means the compiler and run time will do lots of implicit conversions for you, so, it will convert your string to a double or your double to a string or what not. You may still get an error at run time, but the conversion routine will throw
 it rather than the ultimate function you're trying to call:<br /><br />Math.Sin(&quot;32.6&quot;) --&gt; Math.Sin(StringToDouble(&quot;32.6&quot;)), rewritten by compiler if weakly typed, either static or dynamic.<br /><br />Math.Sin(&quot;ABC&quot;) --&gt; Math.Sin(StringToDouble(&quot;ABC&quot;)), run-time error if weakly typed, static or dynamic (though some super dynamic languages might do the following (sketching):<br /><br />Math.Sin(&quot;ABC&quot;) --&gt;<br />Math.Sin (<br />&nbsp;&nbsp;&nbsp; try {&nbsp;StringToDouble(&quot;ABC&quot;);&nbsp;}<br />&nbsp;&nbsp;&nbsp; except { try { AnyToDouble(LookupVariable(&quot;ABC&quot;)) } } )<br /><br />I think Javascript will do that.<br /><br /><br /><br /><p>posted by brianbec</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365352150000000</link>
		<pubDate>Mon, 21 Jan 2008 18:00:15 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365352150000000</guid>
		<dc:creator>brianbec</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">stevo_ wrote:</div>
<div class="quoteBody">&#65279;So ok, great, we have a system where everything is 'honest' about it's workings, why is that useful?</div>
</blockquote>
<br /><br />It's useful because it not only allow more robust systems, but also allows various other &quot;optimisations&quot;.
<br /><br />This idea of (bad) side-effect free permeates most of modern day computing. For example, at the macro-level, we have Operating Systems with protected memory systems, privilege levels, etc, which then allows robust multi-tasking, etc.<br /><br />Moving to the micro-level, we have instruction-level parallelism, which CPU designers (at the chip, transistors level) needed in order to improve throughput [1]. Things like super-scalar, pipelining, out-of-order execution, etc, I believe, can all trace their
 roots back to this idea of (bad) side-effect free operations. Sure, they had to introduce a slew peripheral hardware to cache or hide the various (good and bad) side-effects, but they did it.<br /><br />Now were moving into the age where they are trying (again) to do it at the programmer level. At least, that's my take on it... <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif' alt='Wink' /><br /><br /><br />[1] The root causes for this are many. But from my perspective, the primary cause is the unwillingness of the 'industry' to move to vastly faster memory sub-systems - orders of magnitude, in some cases. (And yes, it would be extremely expensive, which is why
 it's not being done, considering -&gt;). So far, they've been able to hide the huge differences between the the throughput achieveable from the various 'levels' in&nbsp; the memory heirachy: register to register, register to L1 cache, register to L2 cache, etc.<br /><p>posted by RichardRudek</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365521250000000</link>
		<pubDate>Mon, 21 Jan 2008 22:42:05 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365521250000000</guid>
		<dc:creator>RichardRudek</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">brianbec wrote:</div>
<div class="quoteBody">&#65279;
<blockquote>
<table class="quoteTable">
<tbody>
<tr>
<td valign="top" width="10"><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td class="txt3"><strong>aL_ wrote:</strong>
<hr size="1">
<i><br /><br />dynamic languages are, according to to those who know, great because one is not &quot;restricted&quot; by the type system (like the one in java/c#)&nbsp;and can do anything.
<br />but say haskell, (as i understand it) has a whole lot stronger type system, so for a dynamic guy, shouldnt that be even worse&nbsp; than say&nbsp; c#?<img src="/emoticons/emotion-3.gif" border="0"><br />&#65279;<br />&nbsp;</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br /><br />I think there is a lot of misunderstanding &quot;in the air&quot; about &quot;dynamic typing.&quot; I think it's often confused with &quot;weak typing.&quot; Scheme is a great example of a &quot;dynamically typed&quot; language that is also (mostly) &quot;strongly typed.&quot;
<br /><br />&quot;Dynamically typed&quot; just means that types are carried around with data and are checked at run time, not at compile time.<br />&nbsp;<br />&quot;Strongly typed&quot; just means that there are not a lot of implicit conversions going on. If you call a function that expects a double and you pass it a string, you will get an error. In a statically typed, strongly typed language, you will get the error at compile
 time. In a dynamically typed, strongly typed language, you will get the error at run time.<br /><br />Math.Sin(&quot;32.6&quot;) --&gt; compile-time error if statically typed, strongly typed.<br /><br />Math.Sin(&quot;32.6&quot;) --&gt; run-time error if dynamically typed, strongly typed.<br /><br />&quot;Weakly typed&quot; just means the compiler and run time will do lots of implicit conversions for you, so, it will convert your string to a double or your double to a string or what not. You may still get an error at run time, but the conversion routine will throw
 it rather than the ultimate function you're trying to call:<br /><br />Math.Sin(&quot;32.6&quot;) --&gt; Math.Sin(StringToDouble(&quot;32.6&quot;)), rewritten by compiler if weakly typed, either static or dynamic.<br /><br />Math.Sin(&quot;ABC&quot;) --&gt; Math.Sin(StringToDouble(&quot;ABC&quot;)), run-time error if weakly typed, static or dynamic (though some super dynamic languages might do the following (sketching):<br /><br />Math.Sin(&quot;ABC&quot;) --&gt;<br />Math.Sin (<br />&nbsp;&nbsp;&nbsp; try {&nbsp;StringToDouble(&quot;ABC&quot;);&nbsp;}<br />&nbsp;&nbsp;&nbsp; except { try { AnyToDouble(LookupVariable(&quot;ABC&quot;)) } } )<br /><br />I think Javascript will do that.<br /><br /></div>
</blockquote>
<br /><br />It would be nice if we could:<br /><br />DateTime dt = &quot;1/1/08&quot;;<br />int i = textbox1.Text<br /><br />Naturally, we are saving the manual Convert which will throw anyway if the parsing fails so don't think this change would hurt.<br /><br />At a minimum, having Operator Extention methods would allow our programs to opt-in to this.<br /><p>posted by staceyw</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365625580000000</link>
		<pubDate>Tue, 22 Jan 2008 01:35:58 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365625580000000</guid>
		<dc:creator>staceyw</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Thanks Erik.&nbsp; Helped me understand more about FP and what you&nbsp;and BrianB&nbsp;have been talking about in last few videos.&nbsp; I think this was the first time I heard clearly that &quot;state&quot; is needed and not bad.&nbsp; We &quot;state&quot; folks are not all in the weeds rubbing
 our gold rings.&nbsp; At the same time I am more confused (which is good):&nbsp; <br /><br />1) If we had &quot;public void IO GetSum(1,2,3) {...}&quot;, does this really help?&nbsp; In a typical windows app, most functions will now have IO&nbsp;tacked on.&nbsp; But&nbsp;does that make my app better/easier to understand?&nbsp; Moreover, I can still lie.&nbsp; I can say func Throws Exception1,
 but still throw Exception2.&nbsp; Or would compiler prevent such&nbsp;madness from me?&nbsp; I am a baby on&nbsp;FP, but I can find precious little functions that would not&nbsp;need IO in my current WinForms app (btw, using Linq and local DB for Disconnected&nbsp;operation&nbsp;- Thanks much!).&nbsp;<br /><br />2) If I&nbsp;declare all possible exceptions that a&nbsp;function &quot;may&quot; throw; a moderately complex&nbsp;function may have reams of ThrowsException attributes.&nbsp; By calling .Net libs which may call other libs, which may call Win32Apis, you could end up with all Exceptions
 in the world under that call tree.&nbsp; Not to mention some Exceptions we can't know (i.e. OutOfMemory, ThreadInterupt, ThreadAbort) in advance.&nbsp; So we are kinda forced to lie with the unperfect information we have and external forces.&nbsp; How would this be handled,
 or did I miss the idea (which is&nbsp;probable).<br /><br />3) I heard state was good and FP was good, and started to see some light on &quot;IO&quot;.&nbsp; But I did not &quot;gleen&quot; the solution path from the video.&nbsp; Do you see a clear path opening here?<br /><br />4) It seems like&nbsp;Windows message pumb was ahead of its' time!&nbsp; Single threaded with a Message Queue (rock on Erlang).&nbsp; Even with that &quot;good&quot; design, we still have challenges in that area (i.e. invokes, dead locking ourselfs, live locks, etc)&nbsp; As you say, given
 just a sliver of daylight,&nbsp;we&nbsp;can/will hang proverbial<font size="3"> </font>self.<br /><br />William<br /><br /><p>posted by staceyw</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365658110000000</link>
		<pubDate>Tue, 22 Jan 2008 02:30:11 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633365658110000000</guid>
		<dc:creator>staceyw</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">evildictaitor wrote:</div>
<div class="quoteBody">&#65279;<br />If you have 100 errors in your program, wouldn't you prefer to see them before you ship your application, rather than only catching 99 of them in test?<br /></div>
</blockquote>
<br /><br />I whould prefer to find errors&nbsp;at complie time. but im a&nbsp;static typing kind of guy <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> i totaly agree that its better to find errors at compile time and not run time. but alot of&nbsp;people prefer languages without and static checks at all. are they &quot;wrong&quot;? or
 are we (the static guys) &quot;wrong&quot;? perhaps there is something inbetween? i just think thats an interesting discussion.. (and one that can lead to infinite flame wars im sure <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' />)<br /><br /><blockquote>
<div class="quoteAuthor">evildictaitor wrote:</div>
<div class="quoteBody">&#65279;<br />True, although you have to be careful with Ruby. It's actually strongly typed behind-the-scenes, which helps catch a number of errors, even if you don't force the types at compile time - it can usually infer them from context.<br /></div>
</blockquote>
<br /><br />alright <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> i dont know very much about the internals of ruby. but meant general dynamicly(i.e not staticaly) typed languages.<br /><br /><blockquote>
<div class="quoteAuthor">evildictaitor wrote:</div>
<div class="quoteBody">&#65279;<br />One could argue that these uses are sufficiently small that the benefits of FP and static typing don't come through, (although I would disagree).<br /></div>
</blockquote>
<br /><br />i do too. i <em>vastly</em> prefer static typing to dynamic.<br /><br />but my point was that a lot of people feel that dynamic typing is the way to go and looking at the jaoo vids for example one get the feeling that more dynamically typed languages are coming back(as well functional languages).
<br />the DLR, iron python and iron ruby are hot stuff right now too <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> for general computing too it seems if one listens to some of the guys at jaoo:)<br /><br />im not dissing FP or static typing at all,&nbsp;i'd pick static typing over dynamic any day of the week. i just think its interesting that both types of programing &quot;are the future&quot; at the same time <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> it'd be interesting to have an interview with the masters (brian
 erik and anders among others) to talk about that.. or perhaps to hear some dynamic typing buffs view on say haskell and f# <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />
<br /><br />but yeah, i share your feeling that dynamicly typed languages are best suited for small programs/scripts and staticly typed languages are better for larger ones<p>posted by aL_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366013550000000</link>
		<pubDate>Tue, 22 Jan 2008 12:22:35 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366013550000000</guid>
		<dc:creator>aL_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">brianbec wrote:</div>
<div class="quoteBody">&#65279;<br />Here's the doctor's prescription for you:<br />In your daily work, use C#, VB, and F#.&nbsp;<br />Get, read, and work EVERY problem in Structure and Interpretation of Computer Programs, by Abelson and Sussman. (Use PLT Scheme to do the problems).<br />When done with SICP, get, read, and work EVERY problem in Expert F# by Don Syme, et al. Use F#, obviously<br />When done with that, come back for a Haskell prescription. The stuff above should take you three years.</div>
</blockquote>
<br /><br />so no python, ruby, smalltalk or indeed c then? <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> <p>posted by aL_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366014710000000</link>
		<pubDate>Tue, 22 Jan 2008 12:24:31 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366014710000000</guid>
		<dc:creator>aL_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">brianbec wrote:</div>
<div class="quoteBody">&#65279;<br />I think there is a lot of misunderstanding &quot;in the air&quot; about &quot;dynamic typing.&quot; I think it's often confused with &quot;weak typing.&quot;
<br /></div>
</blockquote>
<br /><br />true, true. i do know the diffrence between static/dynamic typing and strong/weak typing (belive it or not <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' />) even though i slipped up and use the wrong trem in my post. my bad <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />
<br /><br />what i meant was that for a haskell programmer, c# seems to have weak typing because its not visible in the types if there are any side effects.. but in like (as you mention)javascript, vb(not vb.net) and possebly c/c&#43;&#43;, the types are even weaker, there you
 dont even know what you get back.&nbsp;true?&nbsp;(this is meant as an observation)<br /><br />after some consideration it seems to me that FP and dynamic typing dont really conflict with one and other. i whould simply get &quot;cant implicitly convert IO&lt;int&gt; to int&quot; errors at runtime and not at comiple time. right?<br /><br />but isnt it sort of the point of functional programing to prove the correctness of a program by using a static analysis? (im sure the awnser is &quot;sort of&quot; but i hope you get my point <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />) doesnt use of dynamic typing sort of negate that?
<br /><br />that whould be&nbsp;make very interesting interview <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> <br /><br />oh and btw, is it really impossible to be dishonest in haskell (or f# for that matter)?
<br />cant you do something like:<br /><br />int DoSeeminglyPureStuff(int input){<br />//disregarding the input int and doing evil things instead<br />IO&lt;int&gt; myIoInt = sourceOfInpureInt();<br />return myIoInt.Value; // i.e. the &quot;real/pure&quot; int<br />}<br /><br />(sorry i dont know haskell syntax) <br />but perhaps the IO monad doesnt have something like &quot;Value&quot; to get the value inside the monad? or is there something else stopping you from doing something like this?<br /><p>posted by aL_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366057830000000</link>
		<pubDate>Tue, 22 Jan 2008 13:36:23 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366057830000000</guid>
		<dc:creator>aL_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody">&#65279;<br /><br />but isnt it sort of the point of functional programing to prove the correctness of a program by using a static analysis? (im sure the awnser is &quot;sort of&quot; but i hope you get my point <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' />) doesnt use of dynamic typing sort of negate that?
<br /></div>
</blockquote>
<br /><br />My totally un-diplomatic answer is: Yes, it does, which is why dynamically typed languages will prove to be a dead end for anything but the simplest of shell scripting.
<br />The benefits of dynamically typed languages usually have nothing to do with the lack of static type checking (easy access to data structures, high level expression-based syntax, etc.). And almost all of those benefits can be had in statically typed languages
 too.<br /><br />Programs are getting more complex, not less, and anything that can go wrong, will eventually go wrong (Murphy's law). So the more potential crashes that the compiler can
<i>rule out entirely</i> with 100% guarantees, the better.<br />We still need testing, but testing is a poor substitute for proof (especially when those proofs can be had for a price as cheap as just running the type checker).<br /><br />Furthermore, types aren't a burden, they're a big help. Do people complain about the
<i>burden</i> of drawing their OOP classes out in UML before starting to program? Types give an overal shape of a program (especially in FP - UML may be better when everything is based on state).<br /><br />We need <i>more</i> static checking, not less.<br /><br />&lt;/rant&gt;<br /><br /><blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody">&#65279;<br />oh and btw, is it really impossible to be dishonest in haskell (or f# for that matter)?
<br />cant you do something like:<br /><br />int DoSeeminglyPureStuff(int input){<br />//disregarding the input int and doing evil things instead<br />IO&lt;int&gt; myIoInt = sourceOfInpureInt();<br />return myIoInt.Value; // i.e. the &quot;real/pure&quot; int<br />}<br /><br />(sorry i dont know haskell syntax) <br />but perhaps the IO monad doesnt have something like &quot;Value&quot; to get the value inside the monad? or is there something else stopping you from doing something like this?<br /></div>
</blockquote>
<br /><br />Exactly, the IO monad simply doesn't have a way to get out of it*. It's &quot;sticky&quot; and infects anything it touches.<br />However there are other monads that do have functions that can &quot;run&quot; a monadic value. For example the ST monad can work with mutable variables (only, no networking, or disk writes etc.), and once you've written your algorithm that requires mutable state, you
 pass it to &quot;runST&quot; which will give you back a pure value.<br />The STM monad can deal with concurrent acccess to shared mutable state (only), and once you've written an STM action (a &quot;transaction&quot;) you pass it to &quot;atomically&quot; which will run it atomically, and return... an IO action! So you can get from ST to pure, and
 from STM to IO, and you can get from pure to any monad via the &quot;return&quot; function.
<br /><br />This gives you a nicely &quot;layered&quot; program, where you have this thin layer of IO at the bottom that does your IO, and then some STM on top of that which handles your concurrency synchronisations, then the bulk of your program is pure, but some of those pure
 calls may use the ST monad for local encapsulated mutable state.<br /><br /><br /><font size="1">* actually there's the unsafePerformIO which let's you escape when you
<i>really</i> need it, and when you <i>really</i> know what you're doing. If you do use this, just must absolutely guarantee that the thing you're wrapping actually does have pure semantics (and even then things can go wrong - so you
<i>really</i> need to know what you're doing!).</font><br /><p>posted by sylvan</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366267220000000</link>
		<pubDate>Tue, 22 Jan 2008 19:25:22 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633366267220000000</guid>
		<dc:creator>sylvan</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Hi.<br /><br />A question for the monad experts (I don't know alot about monads but I want to learn):<br /><br />How are monads combined, and what would that look like in C#?<br /><br />Say, for instance, that I have an IO layer over a file system or a database that returns the IO monad, and I want to combine that with the maybe monad. Do I create a new monad that combines them, or do I wrap the Maybe monad on top of the IO monad?<br /><br />/Erik<br /><p>posted by Erik_H</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633367876310000000</link>
		<pubDate>Thu, 24 Jan 2008 16:07:11 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633367876310000000</guid>
		<dc:creator>Erik_H</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[If you are new to functional programming you might be interested in this tutorial:<br /><a href="http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf">http://www.cs.utah.edu/~hal/docs/daume02yaht.pdf</a><br />I found it very useful and interesting.<p>posted by akopacsi</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633367885840000000</link>
		<pubDate>Thu, 24 Jan 2008 16:23:04 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633367885840000000</guid>
		<dc:creator>akopacsi</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">Erik_H wrote:</div>
<div class="quoteBody">&#65279;<br />Say, for instance, that I have an IO layer over a file system or a database that returns the IO monad, and I want to combine that with the maybe monad. Do I create a new monad that combines them, or do I wrap the Maybe monad on top of the IO monad?<br /></div>
</blockquote>
<br /><br />I'm not sure I can convert all of this into pseudo C# so I'll just use Haskell. Shouldn't be too hard to follow.<br /><br />In Haskell you have something called &quot;Monad transformers&quot;. It's basically a monad which takes an &quot;inner monad&quot;, and let's you access that inner monad using the function &quot;lift&quot;. The convention is that the monad transformer's types end with &quot;T&quot;.
<br />Sadly there is no MaybeT, but it can easily be defined ( <a href="http://www.haskell.org/haskellwiki/New_monads/MaybeT">http&#58;&#47;&#47;www.haskell.org&#47;haskellwiki&#47;New_monads&#47;MaybeT</a> ).<br />I'll use the ErrorT transformer instead.<br /><br />So a transformer for &quot;errors&quot; is called &quot;ErrorT&quot;. It basically takes an error type, and an &quot;inner monad&quot;, and allows you to call &quot;throwError&quot; to signal an error, and if anything signals an error the whole thing will signal an error.<br /><br /><br />Anyway, here's the Haskell type when the error type is a string &quot;like an error message).<br /><br /><p><font face="Courier New">type ErrorIO a = ErrorT String IO a<br /></font></p>
<p><font face="Verdana">This just declares a type synonym (for convenience) called ErrorIO with one type parameter, and says that it's equal to the error monad with an error of type String, and an IO as the inner monad.</font> These&nbsp; transformers nest, so you
 can wrap another transformer around the ErrorIO monad to stack even more features on.</p>
<font face="Courier New"><br /></font>And an example usage:<br /><br /><font face="Courier New">test :: Bool -&gt; ErrorIO Int<br />test fail = do {<br />&nbsp;&nbsp;&nbsp; lift $ putStrLn&nbsp; &quot;Hello!&quot;;<br />&nbsp;&nbsp;&nbsp; when fail $ throwError &quot;Error!!!&quot;;<br />&nbsp;&nbsp;&nbsp; return 5;<br />}</font><br /><br />Notice the &quot;lift&quot; in there which lets you get at the inner monad (IO in this case, which we use to print &quot;Hello!&quot; to he terminal).
<br />Normally when you do this you'd define shorthands for all the methods you want to use from the various inner monads so you don't have to use &quot;lift&quot; everywhere (which can get messy when you want to access a monad that's several layers deep since you have to
 apply &quot;lift&quot; several times). Or if you want easy access to any monadic actions in the inner monads you would define shorthand &quot;lift&quot; functions for each of the inner monads so you at least only have to use a single lift function (&quot;liftIO&quot;, &quot;liftState&quot;, etc.).<br /><br />And here's some exploring in GHCi (interactive GHC), which &quot;runs&quot; the monadic value returns by the function test. This simply &quot;unwraps&quot; the transformer and returns the inner monadic value (if there were no errors):<br /><br /><font face="Courier New">*Main&gt; runErrorT ( test True )<br />Hello!<br />Left &quot;Error!!!&quot;<br />*Main&gt; runErrorT ( test False )<br />Hello!<br />Right 5</font><br /><br />This just tries the &quot;test&quot; function in the two cases, the first one returns &quot;Left&quot; which signals that the ErrorT monad failed, and the error message is &quot;Error!!!&quot;. The second one returns &quot;Right&quot; (memory rule: &quot;Right means Correct&quot;) and the value that came out
 of the inner monad.<br /><font face="Courier New"><br />*Main&gt; :type runErrorT ( test False )<br />runErrorT ( test False ) :: IO (Either String Int)</font><br /><br />This just shows the type inferred for the return value when running the outer error monad. As you can see it unwraps the outer monad, and returns an action of the type of the inner monad, that returns &quot;Either&quot; the error type (String) or the value type (Int).<br /><br /><font face="Courier New">*Main&gt; runErrorT ( test True `catchError` (\err -&gt; do {lift $ print &quot;error!&quot;; return 0; }))<br />Hello!<br />&quot;error!&quot;<br />Right 0</font><br /><br />This uses the &quot;catchError&quot; function to catch an error, which just prints the message &quot;error!&quot; on to the screen, and then returns 0 (without errors), and as you can see we get &quot;Right 0&quot; at the end. The stuff to the right of catchError is a lambda expression
 which takes the error, and returns a monadic expression that handles it (which may throw a new error).<br /><br /><br /><p>posted by sylvan</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633368034700000000</link>
		<pubDate>Thu, 24 Jan 2008 20:31:10 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633368034700000000</guid>
		<dc:creator>sylvan</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;<br />My totally un-diplomatic answer is: Yes, it does, which is why dynamically typed languages will prove to be a dead end for anything but the simplest of shell scripting.
<br />...<br />We need <i>more</i> static checking, not less.<br /></div>
</blockquote>
<br /><br />Thats <em>exactly</em> my feeling as well.. in college we had a course in smalltalk and our professor happily exclaimed that &quot;its a great language, you can change anything! you can change the way everything from how strings behave &nbsp;to the core of the runtime
 behaves&quot; and i was like.. what? how can you possibly test that? or how could you possebly run anything not written (and rememberd) by yourself if some peice of code somewhere can change ToString to return strings backwards (just an example)<br />i got the awnser that &quot;ofcourse you whouldnt do anything like that!&quot; well.. lets hope so.. perhaps nothing so extreme but.. still.. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' />
<br />i do&nbsp;think there is a place for dynamic languages in gp programming and im sure there are lessons to be learned there <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> but as the sole language for large scale programs? i dont know..
<br /><br />perhaps in c#4.0 we'll have a &quot;inpure&quot;&nbsp; (or pure) keyword that marks the purity of a return value <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> i really do feel that optimal is some kind of middle road between totaly pure and inpure..<br /><br /><br /><blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;<br />Exactly, the IO monad simply doesn't have a way to get out of it*. It's &quot;sticky&quot; and infects anything it touches.<br /></div>
</blockquote>
<br /><br />cool <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> thanks for clearing that up <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> it seems more and more like the built in monads are things that make haskell program practical, just like the .net framework&nbsp;and the java framework makes c# and java practical <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> i wonder if you could port those monads
 to c#.. they whould make a nice addition to the .net framework i think <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /> (perhaps they are already in there somewhere?)<br /><p>posted by aL_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633368146050000000</link>
		<pubDate>Thu, 24 Jan 2008 23:36:45 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633368146050000000</guid>
		<dc:creator>aL_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[Thanks, Sylvan.<br /><br />I'll see if I can express it in C# myself =).<br /><br />I had another (stupid?) idea:<br /><br />With all the talk about SOA, would it be possible to hide the complexity of a webservice call in a monad, so that you could combine functions across a network seamlessly?<br /><br />/Erik<br /><p>posted by Erik_H</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633368514950000000</link>
		<pubDate>Fri, 25 Jan 2008 09:51:35 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633368514950000000</guid>
		<dc:creator>Erik_H</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<p>Erik, thanks for the great video. However I have a question, you said that we can integrate FP with imperative programming by ignoring the monads (IO()) from the type. I think this is feasible, but you can't do the other way around right?</p>
<p>posted by punkouter</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633373406160000000</link>
		<pubDate>Thu, 31 Jan 2008 01:43:36 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633373406160000000</guid>
		<dc:creator>punkouter</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">punkouter wrote:</div>
<div class="quoteBody">&#65279;
<p>Erik, thanks for the great video. However I have a question, you said that we can integrate FP with imperative programming by ignoring the monads (IO()) from the type. I think this is feasible, but you can't do the other way around right?</p>
</div>
</blockquote>
<br /><br />You mean integrate imperative programming into functional programming by inserting a monad into the type signature? That's certainly feasible.<br /><br />For a good example of a functional programming living alongside imperative programming, I'd really recommend having a bash at F# - it's all the power of C# with all the conciseness of Haskell.<br /><br />Although I'll never forgive Microsoft for having more people working on Haskell than Sun has working on Java <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' /><br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633373409030000000</link>
		<pubDate>Thu, 31 Jan 2008 01:48:23 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633373409030000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">evildictaitor wrote:</div>
<div class="quoteBody">&#65279;
<blockquote>
<table class="quoteTable">
<tbody>
<tr>
<td valign="top" width="10"><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td class="txt3"><strong>punkouter wrote:</strong>
<hr size="1">
<i>&#65279;
<p>Erik, thanks for the great video. However I have a question, you said that we can integrate FP with imperative programming by ignoring the monads (IO()) from the type. I think this is feasible, but you can't do the other way around right?</p>
</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br /><br />You mean integrate imperative programming into functional programming by inserting a monad into the type signature? That's certainly feasible.<br /><br />For a good example of a functional programming living alongside imperative programming, I'd really recommend having a bash at F# - it's all the power of C# with all the conciseness of Haskell.<br /><br />Although I'll never forgive Microsoft for having more people working on Haskell than Sun has working on Java
<img src="/emoticons/emotion-4.gif" border="0"><br /></div>
</blockquote>
<br /><br />not exactly, i mean, if right now i have a solution which i built using C#, and then suppose I want to make a 'parallel' library using Hashkell/CLR (if there is such a thing), or a FP, Erik said that it can be done by compiling the code to assembly and when
 I load it up to my C# solution ignoring the monads (IO(), etc ) will make it usable (or maybe, compiling it to CLI will strip the monads altogether). But, how about the other way around? Suppose that my FP library needs to use a business object (not necessarily
 a complex one, maybe a transfer object) from my C# assembly, can it be done?<p>posted by punkouter</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633373436060000000</link>
		<pubDate>Thu, 31 Jan 2008 02:33:26 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633373436060000000</guid>
		<dc:creator>punkouter</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">punkouter wrote:</div>
<div class="quoteBody">&#65279;not exactly, i mean, if right now i have a solution which i built using C#, and then suppose I want to make a 'parallel' library using Hashkell/CLR (if there is such a thing), or a FP, Erik said that it can be done by compiling the code
 to assembly and when I load it up to my C# solution ignoring the monads (IO(), etc ) will make it usable (or maybe, compiling it to CLI will strip the monads altogether). But, how about the other way around? Suppose that my FP library needs to use a business
 object (not necessarily a complex one, maybe a transfer object) from my C# assembly, can it be done?</div>
</blockquote>
<br /><br />There is such a thing - it's called F#, which is a sort of Haskell/CLR thing.<br /><br />If you're developing a program in F#, you can also do the reverse, and load a program written in C# or VB.NET - since both are compiled to CIL, F# reflects out the program, and attempts to work out which functions are monoidal and which are computational, and
 labels them accordingly.<br /><br />So in conclusion, yes, an F# application can use C# logic, and a C# solution can use code written in F#.<br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633374161270000000</link>
		<pubDate>Thu, 31 Jan 2008 22:42:07 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633374161270000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[I'm just joining this discussion. But, I can't help being reminded about where&nbsp;I was at in 2002 with C&#43;&#43; claiming that template basesd metaprogramming was revolutionary, when in fact, it was too complicated for most people to use&nbsp;to solve real world problems,
 and as a result of that (and other things) alot of those developers moved to the much more &quot;designed with the needs of the developer&quot; C# / .NET 1.1.<br /><br />I bought pared down generics, made sense to type collections for many reasons. Solved a very common problem.<br /><br />Now, I think that some of this stuff wont ever be used as much more than an intellectual curiosity&nbsp;- just like&nbsp;bind2() and whatnot wasn't ever used in C&#43;&#43; on any large scale,&nbsp;stl/boost whatever. They just didnt't meet any real need in particular, other than
 the needs of the developers to feel smart - and they had developers writing code that DID NOTHING (it was generic&nbsp;though, and it WOULD work on antyhing), but would if only if &nbsp;YOU used it correctly&nbsp;(Assuming you could figure out how). Which restates the last
 bit - lots of work went into writing generic libraries which never were used because they were felt to be WAY out of touch with the needs joe blow coder.<br /><br />A path siimiar to this killed C&#43;&#43; in my mind. Why do you feel that this wont end in the same result.<br /><br />Also - why do you have to even bother the developer with this at all. Can you do this using the intermediate representation? just like out of order execution of CPU instructions.<br /><br /><br /><br />The last thing that a developer likes to see are things in his code that he doesnt fully understand - those most likely get rewritten in the real world - since who wants to maintain code they dont understand.<br /><br /><p>posted by sylvaan</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633375286240000000</link>
		<pubDate>Sat, 02 Feb 2008 05:57:04 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633375286240000000</guid>
		<dc:creator>sylvaan</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[I haven't read all of the posts. But what does IO do besides telling me/compiler/whoever that the function is impure?
<br /><br />For example if I define a function which returns int, but could also&nbsp;have exceptions, than from a pure functional approach I can also&nbsp;get a super set of two. IE = {int U Exception}&nbsp; and let my funciton return IE, in that case it would be very &quot;honest&quot;, wouldn't
 it? Why not have some suffix? int impure_function(x)....? <p>posted by ivan_</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633383528320000000</link>
		<pubDate>Mon, 11 Feb 2008 18:53:52 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633383528320000000</guid>
		<dc:creator>ivan_</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer: Functional Programming</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">ivan_ wrote:</div>
<div class="quoteBody">&#65279;I haven't read all of the posts. But what does IO do besides telling me/compiler/whoever that the function is impure?
<br /><br />For example if I define a function which returns int, but could also&nbsp;have exceptions, than from a pure functional approach I can also&nbsp;get a super set of two. IE = {int U Exception}&nbsp; and let my funciton return IE, in that case it would be very &quot;honest&quot;, wouldn't
 it? Why not have some suffix? int impure_function(x)....? </div>
</blockquote>
<br /><br />The point of the type-purity is not to help the programmer (e.g. function suffixing), but to help the compiler to optimise your code.<br /><br />With regards to exceptions, they are generally a thing of the imperative world, since undefined behaviour is exceptional behaviour inside of functional languages by default, for example in C#:<br /><br />int factorial(int i){<br />&nbsp; if(i == 0) return 1;<br />&nbsp; return i * factorial(i-1);<br />}<br /><br />does bad things if you don't check for (i &lt; 0) and throw an exception - factorial(-2) should throw an exception. However, in Haskell:<br /><br />Factorial :: Int -&gt; Int<br />Factorial i<br />&nbsp; | i == 0&nbsp;&nbsp; = 1<br />&nbsp; | i &gt; 1 &nbsp; &nbsp; = i * (Factorial (i-1))<br /><br />throws a pattern-match failure (read &quot;argument exception&quot;) when you try Factorial -2.<br /><br />You can, of course, implement exceptions:<br /><br />Factorial :: Int -&gt; (Maybe Int)<br />Factorial i<br />&nbsp; | i == 0&nbsp;&nbsp; = Just 1<br />&nbsp; | i &gt; 1&nbsp;&nbsp;&nbsp;&nbsp; = Just (i * (Factorial (i-1)))<br />&nbsp; | i &lt; 0&nbsp;&nbsp;&nbsp;&nbsp; = Nothing&nbsp; -- Read &quot;exception&quot;<br /><br />It seems a lot of people are getting hung up on the notion of &quot;honest&quot;. The point is not that the programmer is &quot;honest&quot; about his intentions - it's that the compiler can prove things about the program - the contracts in Haskell and in other functional languages
 which employ such safeguards cannot be trivially broken, so it guarrantees honesty - breaking it takes some real effort.<br /><p>posted by evildictaitor</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633383891100000000</link>
		<pubDate>Tue, 12 Feb 2008 04:58:30 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Functional-Programming#c633383891100000000</guid>
		<dc:creator>evildictaitor</dc:creator>
	</item>
</channel>
</rss>