<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx</link><description>How often do you write code that just works? It seems to happen so rarely that I find myself suspicious if code does just work. When was the last time that you wrote a non-trivial program that had no compile errors on the first try and then ran fine as</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1778711</link><pubDate>Thu, 01 Mar 2007 15:16:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1778711</guid><dc:creator>Tom Kirby-Green</dc:creator><description>&lt;p&gt;Another great post Wes, where do you find time? I'm really hoping some of the Spec# ideas make it into C# 4, at which point I think the language will essentially be complete (caveat: if STM ever becomes real then maybe we'll get a 'atomic' keyword, or language bindings for message based method invocation). I can see a real need for the constraints and stuff that Spec # offers - esp. when you think about being able to use things like DLINQ with confidence in a compositional manner. That said I also wonder about the comment in Charlie's Orcas Feb/March CTP video about is &amp;quot;C# begining too complicated?&amp;quot; I don't think so yet - but I'd hate to see it decay to the complexity of C++. I think one of the goals for C# is that the majority should be able to grok the entire language.&lt;/p&gt;
</description></item><item><title>A Tale about the Importance of Simplicity</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1779690</link><pubDate>Thu, 01 Mar 2007 18:33:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1779690</guid><dc:creator>Harald Radi's Weblog</dc:creator><description>&lt;p&gt;I just read another brilliant blog post of Wes Dyer that emphasizes the importance of simplicity of code. This is one of the paradigms of agile software development and I think this cannot be accentuated too much. It not only helps the author to keep&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1781040</link><pubDate>Thu, 01 Mar 2007 22:59:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1781040</guid><dc:creator>Patrick Lioi</dc:creator><description>&lt;p&gt;Not that this affects the point you were making in the QuickSort example, but do the implementations of Skip(int) and Concat(IEnumerable&amp;lt;T&amp;gt;) also work without changing &amp;nbsp;state? &amp;nbsp;It seems like at least Skip(int) would have to alter the state of the enumerable it is acting on, but does it instead create a new enumerable from the original one?&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1781980</link><pubDate>Fri, 02 Mar 2007 01:38:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1781980</guid><dc:creator>damien morton</dc:creator><description>&lt;p&gt;But unfortunately, object-oriented programming and mreo specifically, object oriented design, is completely incompatible with immutability and referential transparency.&lt;/p&gt;
&lt;p&gt;In particular, the idea of encapsulating (state) in an object, and providing methods to manipulate that state, just doesnt work with immutability and referential transparency.&lt;/p&gt;
&lt;p&gt;Theres ways around this, say my making each method return a new instance of the object (and its encapsulated state), but then things begin to get nasty.&lt;/p&gt;
&lt;p&gt;How do you do Model-View-Controller in a referentially transparent way? How do you do the Observer pattern? Is there any way to gho down this functional programming road without abandoning everything we know about making good programs?&lt;/p&gt;
</description></item><item><title>Community Convergence XXII</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1785843</link><pubDate>Fri, 02 Mar 2007 11:23:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1785843</guid><dc:creator>Charlie Calvert's Community Blog</dc:creator><description>&lt;p&gt;Welcome to the twenty-second Community Convergence, the March CTP issue. I'm Charlie Calvert, the C#&lt;/p&gt;
</description></item><item><title>Community Convergence XXII</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1785901</link><pubDate>Fri, 02 Mar 2007 11:36:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1785901</guid><dc:creator>RSS It All</dc:creator><description>&lt;p&gt;Welcome to the twenty-second Community Convergence, the March CTP issue. I&amp;amp;#39;m Charlie Calvert, the&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1786610</link><pubDate>Fri, 02 Mar 2007 13:39:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1786610</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;Tom:&lt;/p&gt;
&lt;p&gt;I would love to see the constraints stuff make it into a future rev of C# (hopefully the next one). &amp;nbsp;It is true that we need to be concerned about the language becoming too hard to grasp. &amp;nbsp;I remember two years ago we were talking about the possibility that perhaps we would soon be exceeding our complexity budget as a language. &amp;nbsp;I'm very interested to see what others have to say about this, so if someone has an opinion then please chime in.&lt;/p&gt;
&lt;p&gt;Patrick:&lt;/p&gt;
&lt;p&gt;It is very good that you noticed that. &amp;nbsp;Skip and Concat do not change state themselves. &amp;nbsp;They are passed IEnumerables and they return *new* IEnumerables. &amp;nbsp;Yes, iterators are codegened as little state machines so they have state that changes but those side-effects are relatively contained. The side-effects only are visible when it is accessed as an IEnumerator (assuming the enumerable itself isn't changing state). &amp;nbsp;Most code deals with IEnumerables and not IEnumerators (foreach, queries, ...). &amp;nbsp;But remember that it is best to not have side-effects but that if either clarity, conciseness, performance, or some other constraint demands otherwise then go ahead and add it at the appropriate scope.&lt;/p&gt;
&lt;p&gt;Damien:&lt;/p&gt;
&lt;p&gt;Object-oriented design is not incompatible with immutability. &amp;nbsp;Yes, I agree that providing methods to mutate state doesn't work well with immutability by definition but think of the string object. &amp;nbsp;It has a host of methods but each one returns a new string to act on and I don't think things get very nasty with strings. &amp;nbsp;Sometimes performance is a problem so there is a class that builds strings. &amp;nbsp;Note that this thing is not a string but builds them and once you ask for a string then that string is immutable. &amp;nbsp;The string builder has encapsulated all of the state changing and removed it from strings.&lt;/p&gt;
&lt;p&gt;You can certainly do either the Observer pattern or MVC following the principles that I outlined. &amp;nbsp;Object-oriented programming and functional programming are not mutually exclusive. &amp;nbsp;Do not throw away everything that you know!!! &amp;nbsp;That would be a terrible waste. &amp;nbsp;Just learn new things and incorporate them into your toolbox.&lt;/p&gt;
&lt;p&gt;Also, remember that I didn't say never use side-effects otherwise the basic Hello World program would be out of the question in C#. &amp;nbsp;I essentially said try to use them sparingly and understanding the tradeoffs that are being made when you do use them. &amp;nbsp;Know that there are alternatives that work very well in many cases.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1787112</link><pubDate>Fri, 02 Mar 2007 15:16:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1787112</guid><dc:creator>Tom Kirby-Green</dc:creator><description>&lt;p&gt;Well right now C# is going through it's 'data access evolution' period, and it's doing so in a manner which might well lead into its 'concurrency evolution' period.&lt;/p&gt;
&lt;p&gt;I'm aware that folks like Sutter are rightly cautious of over selling FP as a magic solution for concurrency. I think he's right about the over selling bit - but I also think the way FP tends to make you think about mutation vs. value and side effects and what not help hugely in expressing and partioning ones logic in a form that takes us a step closer towards Sutter's &amp;quot;sea of available concurrency&amp;quot;. If we don't decompose and express with a eye on mutation vs. value then it's going to be very hard for any runtime to infer intent and distribute without us having to explicitly decorate code (in a OpenMP or .NET attribute based manner).&lt;/p&gt;
&lt;p&gt;So I feel that with LINQ plus some carefully chosen bits of Spec# could position C# 4 or C# 5 as a great platform on which to build software that runs atop of the 16 to 32 hardware threads per socket we can expect by that time.&lt;/p&gt;
&lt;p&gt;Personally I think once constraints and maybe some language bindings for concurrency are in place then its pretty much &amp;quot;job done&amp;quot; for C#. It would I feel be a huge mistake for it to descend into the murky syntactic depths that C++ has got itself into.&lt;/p&gt;
&lt;p&gt;The beauty of .NET is the degree to which you can &amp;quot;mix it up&amp;quot;. It may well be I feel that C# 5 or 6 would best be realised as a different and complimentary language. Look at the way XAML compliments C#. Or the way you can mix up solutions using F# and C#. Better I feel to have a language which the majority can really grok and feel super comfortable with - that leads to better software in terms of being on time and defect free - which ultimately is better for Windows since its the software that runs on top of Windows that delivers the real value to the end user.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1791107</link><pubDate>Sat, 03 Mar 2007 02:30:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1791107</guid><dc:creator>jmlovero</dc:creator><description>&lt;p&gt;A very informative and insightful post as usual, Wes. &amp;nbsp;I'm afraid I have to take exception with these statements about performance, though:&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;At this point, some people will probably be thinking, &amp;quot;But isn't the first approach so much faster than the second approach?&amp;quot;&lt;/p&gt;
&lt;p&gt;Maybe, maybe not. &amp;nbsp;Perhaps it doesn't even matter.&lt;/p&gt;
&lt;p&gt;I think it is important to use the following principle: &amp;nbsp;Make it correct, make it clear, make it concise, make it fast. &amp;nbsp;In that order.&lt;/p&gt;
&lt;p&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/p&gt;
&lt;p&gt;I agree with you that for many of the problems that we encounter, a developer is better off writing clear, concise code that just works. &amp;nbsp;The re-worked QuickSort method is a great example of that principle. &amp;nbsp;However, the QuickSort example belongs to a class of problems for which such a laissez-faire attitude towards performance is likely to be unacceptable to many people. &amp;nbsp;This class of problems includes these very general sorts of methods where performance is important, you need an algorithm that scales well, and you are unlikely to modify the code much once it's written. If we were going to need the QuickSort method to operate on very large arrays, then you can bet that the difference between an O(n log n) algorithm and (for the sake of argument) an O(n^3) algorithm is going to be important. &amp;nbsp;Furthermore, once it is written and works correctly, you can use QuickSort on just about anything that implements IEnumerable&amp;lt;T&amp;gt; and IComparable&amp;lt;T&amp;gt; without modification, so chances are that you aren't going to need to do much to the method once it is created. &amp;nbsp;So, it would seem that this sort of problem is one for which our priorities are inverted: make it fast, make it clear, make it concise. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now, I'm sure you understand all of this and you were just trying to make a more general point. &amp;nbsp;I happen to agree with that point for the vast majority of problems. &amp;nbsp;Here's what really bothers me about the performance issue, though. &amp;nbsp;How do we tell which is faster, the original implementation of QuickSort or the implementation using LINQ? &amp;nbsp;You seem to be admitting that you don't know. &amp;nbsp;My fear is that we either can't know or that it will be very difficult to determine. &amp;nbsp;I might be willing to trade some performance for code clarity and simplicity, but to do so, I want to have some idea of what the performance is going to be. &amp;nbsp;Heck, the LINQ implementation could be faster, but I'm not willing to roll the dice on this sort of problem, so I'd approach it in the traditional way. &amp;nbsp;Is there a way to get a good approximation of the efficiency of a LINQ algorithm? &amp;nbsp;Sure, you can always profile the application, but I think many of us would like a more generic and rigorous way to analyze their performance. &amp;nbsp;Am I just overlooking something that should be really obvious? &lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1793833</link><pubDate>Sat, 03 Mar 2007 10:01:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1793833</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;Tom:&lt;/p&gt;
&lt;p&gt;Thanks for the input. &amp;nbsp;FP is no silver bullet ;) &amp;nbsp;Just another tool in the toolbox.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1794733</link><pubDate>Sat, 03 Mar 2007 12:11:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1794733</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;jmlovero:&lt;/p&gt;
&lt;p&gt;Great comments. &amp;nbsp;Just to be clear, I am pro performance. &amp;nbsp;I was actually getting at two things: first, having clear and concise code lends itself to be in better shape to be improved for performance and second optimizing code is not straightforward. &amp;nbsp;Some optimization choices while improving characteristics in some dimensions actually cause performance to degrade in others. &amp;nbsp;We need to make sure that we understand which scenarios are important and then optimize for those.&lt;/p&gt;
&lt;p&gt;I understand that you are talking about asymptoptic performance. &amp;nbsp;You are right that we don't want to just throw around O(n^3) algorithms, that would be irresponsible. &amp;nbsp;What I am saying is that the particular code in question may not be important to the overall performance depending upon our performance budget and the customer scenarios that we support. &amp;nbsp;You make a very good point that QuickSort is something that should just be written and stored away in a library and I agree with that. &amp;nbsp;Hopefully there will be at least two implementations: one which modifies the collection in place and another which just returns a new collection.&lt;/p&gt;
&lt;p&gt;Thank you for having me clear that up. -- Performance is important.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1795591</link><pubDate>Sat, 03 Mar 2007 14:02:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1795591</guid><dc:creator>Alex James</dc:creator><description>&lt;p&gt;I might be missing something but &lt;/p&gt;
&lt;p&gt;.Concat(pivot) fails because it isn't enumerable.&lt;/p&gt;
&lt;p&gt;To fix this I wrote this:&lt;/p&gt;
&lt;p&gt;public static IEnumerable&amp;lt;T&amp;gt; Enumerate&amp;lt;T&amp;gt;(this T t)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;yield return t;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;And modified the code to this:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!sequence.Any())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return sequence;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var pivot = sequence.First();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var remaining = sequence.Skip(1);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return ((from x in remaining where x.CompareTo(pivot) &amp;lt; 0 select x).QuickSort())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Concat(pivot.Enumerate())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Concat((from x in remaining where x.CompareTo(pivot) &amp;gt;= 0 select x).QuickSort());&lt;/p&gt;
&lt;p&gt;seems to work.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1798367</link><pubDate>Sat, 03 Mar 2007 22:06:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1798367</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;Alex:&lt;/p&gt;
&lt;p&gt;Good point. &amp;nbsp;I had written my own extension method called Concat that looked like this:&lt;/p&gt;
&lt;p&gt;IEnumerable&amp;lt;T&amp;gt; Concat&amp;lt;T&amp;gt;(this IEnumerable&amp;lt;T&amp;gt; sequence1, params T[] sequence2)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;foreach (var item in sequence1) yield return item;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;foreach (var item in sequence2) yield return item;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1804565</link><pubDate>Sun, 04 Mar 2007 18:24:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1804565</guid><dc:creator>Sadek Drobi</dc:creator><description>&lt;p&gt;i aree that Immutability brings clearity, i would like to c an example from the PLinq implementation where it uses several hardware threads for doing job, that will give some more arguments in my java-oriented consulting company :P&lt;/p&gt;
&lt;p&gt;i guess the complexity budget is higher than what u think,i even think that adding functional programming features has the opposite effect, because as long as you write side-effects free functions, and Intention revealing interfaces, u are free of complexity. But the overuse of mutability, in not encapsulating state , is the source of the complexity.&lt;/p&gt;
&lt;p&gt;I went through the implementation of the visitor of expressions, and i have two questions:&lt;/p&gt;
&lt;p&gt;1: why in a lambda expression you are not visiting the parameter expressions in the VisitLambdaExpression&lt;/p&gt;
&lt;p&gt;2: why u make the class as internal, it would be very helpfull if i could extend it, so that i can replace all the old parameters in my predicate's (LambdaExpression&amp;lt;Predicate&amp;gt;) implementation with the new one resulting from the &amp;quot;And&amp;quot; operator, i would only need to override the VisitParameterExpression to have it done.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1805246</link><pubDate>Sun, 04 Mar 2007 22:14:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1805246</guid><dc:creator>Alex James</dc:creator><description>&lt;p&gt;Wes&lt;/p&gt;
&lt;p&gt;That makes sense, and is much cleaner than mine. I'm just learning all this stuff, and to that end your blog posts are invaluable. &lt;/p&gt;
&lt;p&gt;Keep up the good work&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1807261</link><pubDate>Mon, 05 Mar 2007 08:13:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1807261</guid><dc:creator>Judah</dc:creator><description>&lt;p&gt;Great blog post. Keep it coming, Wes.&lt;/p&gt;
&lt;p&gt;Please push for Spec# ideas to be integrated into C#. IIRC, you can mark methods as [Pure], you can mark reference types as non-null, you can guarantee pre- and post-conditions. Seems to me these things would help us write more correct software.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1807293</link><pubDate>Mon, 05 Mar 2007 08:27:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1807293</guid><dc:creator>Tom Kirby-Green</dc:creator><description>&lt;p&gt;Totally agree. It's not just things like &amp;quot;[Pure]&amp;quot; but being able to constrain parameter values, not least &amp;quot;not null&amp;quot; that I think we have a real need for. Goodness knows how many developers hours get sunk into implementing #region Parameter Validation blocks at the start of every public and protected method.&lt;/p&gt;
&lt;p&gt;In that C9 video on Language Innovation (&lt;a rel="nofollow" target="_new" href="http://channel9.msdn.com/Showpost.aspx?postid=273697"&gt;http://channel9.msdn.com/Showpost.aspx?postid=273697&lt;/a&gt;) with Anders and Herb et al rapping on the motivations behind and directions in language design they certainly seem to hint that some form of formal contraints notation might, possibly, be coming ;-)&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1809629</link><pubDate>Mon, 05 Mar 2007 15:59:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1809629</guid><dc:creator>Mr Agile</dc:creator><description>&lt;p&gt;I vote for Judah's suggeestion! i love spec#!&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1809766</link><pubDate>Mon, 05 Mar 2007 16:25:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1809766</guid><dc:creator>Joost Morsink</dc:creator><description>&lt;p&gt;seems a lot like the haskell definition: &amp;lt;br/&amp;gt;&lt;/p&gt;
&lt;p&gt;qsort (x:xs) = qsort [y | y&amp;lt;-xs, y&amp;lt;=x] ++ (x: qsort [y | y&amp;lt;-xs, y&amp;gt;x]) &amp;lt;br/&amp;gt;&lt;/p&gt;
&lt;p&gt;qsort [] = []&lt;/p&gt;
&lt;p&gt;&amp;lt;br/&amp;gt;&lt;/p&gt;
&lt;p&gt;What about Monads? Is this haskell feature feasible to implement in C# 3.0?&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1810570</link><pubDate>Mon, 05 Mar 2007 19:04:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1810570</guid><dc:creator>Joost Morsink</dc:creator><description>&lt;p&gt;Or maybe a more generic way of putting this is:&lt;/p&gt;
&lt;p&gt;Can I add interface types to existing classes using extension methods? Like in Haskell I could define:&lt;/p&gt;
&lt;p&gt;instance Monad {a} where&lt;/p&gt;
&lt;p&gt; x&amp;gt;&amp;gt;=y = ...&lt;/p&gt;
&lt;p&gt; return x = ...&lt;/p&gt;
&lt;p&gt;I could make IList&amp;lt;T&amp;gt; a Monad by implementing:&lt;/p&gt;
&lt;p&gt;static IList&amp;lt;T&amp;gt; bind&amp;lt;U&amp;gt;(this IList&amp;lt;T&amp;gt; a, Func&amp;lt;T,IList&amp;lt;U&amp;gt;&amp;gt; f);&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;static IList&amp;lt;T&amp;gt; return&amp;lt;T&amp;gt;(T item);&lt;/p&gt;
&lt;p&gt;or something like that?&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1811723</link><pubDate>Mon, 05 Mar 2007 22:26:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1811723</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;I will relay all of the feedback about Spec# features in the next rev of C#.&lt;/p&gt;
&lt;p&gt;Joost:&lt;/p&gt;
&lt;p&gt;It is very similar to the haskell definition.&lt;/p&gt;
&lt;p&gt;Well, I think what you want is something like type classes in haskell. &amp;nbsp;I love them and we are working on some ideas to implement an interface with extension methods (post C# 3.0).&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1811866</link><pubDate>Mon, 05 Mar 2007 22:55:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1811866</guid><dc:creator>Alex James</dc:creator><description>&lt;p&gt;FYI I just did a post on this...&lt;/p&gt;
</description></item><item><title>The Essence Of Good Code</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1812051</link><pubDate>Mon, 05 Mar 2007 23:32:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1812051</guid><dc:creator>DonXml's All Things Techie</dc:creator><description>&lt;p&gt;In my recent Syntactic Sugar presentation I was trying to get to the essence of good code, and come up&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1812534</link><pubDate>Tue, 06 Mar 2007 01:16:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1812534</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;Sadek:&lt;/p&gt;
&lt;p&gt;1. &amp;nbsp;We don't visit the parameters because they are not part of the body of the lambda.&lt;/p&gt;
&lt;p&gt;2. &amp;nbsp;We wanted to expose it, but we were very short on resources so this feature was cut. &amp;nbsp;We may expose it in a sample.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1813227</link><pubDate>Tue, 06 Mar 2007 03:05:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1813227</guid><dc:creator>Sadek Drobi</dc:creator><description>&lt;p&gt;But you do visit arguments, so why to visit arguments and not paramters, anyway thats not a big deal as i can override the methods.&lt;/p&gt;
&lt;p&gt;I would really like to revisit all the everyday's patterns and think about them in an immutable implementation, maybe it will work for some, i like the new horizon a mixed language like c# offers.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1815580</link><pubDate>Tue, 06 Mar 2007 12:17:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1815580</guid><dc:creator>Joost Morsink</dc:creator><description>&lt;p&gt;Yeah type classes, that's exactly what I want. Too bad it isn;t going to be in the next release. I guess I'd better head back to Reflection :). But seriously I could write some interface transformer extension methods. In my example like:&lt;/p&gt;
&lt;p&gt;static IMonad&amp;lt;A&amp;gt; ToMonad(this IList&amp;lt;A&amp;gt; l);&lt;/p&gt;
&lt;p&gt;which brings me to my next question: Can I implement a preferably implicit, but otherwise explicit cast/conversion operator as an extension method, so when coding, it does look like it has the new type, but it really doesn't? &lt;/p&gt;
</description></item><item><title>Quicksort in C#, Ruby, Haskell e LINQ</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1825018</link><pubDate>Wed, 07 Mar 2007 08:53:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1825018</guid><dc:creator>Il Blog di Antonio Cangiano</dc:creator><description>&lt;p&gt;Il sottotitolo di questo blog ora appare come Pensieri eretici nel mondo .NET . Ho deciso di rinominarlo&lt;/p&gt;
</description></item><item><title>Would MS consider hosting a FP Community site?</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1825123</link><pubDate>Wed, 07 Mar 2007 09:14:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1825123</guid><dc:creator>Tom Kirby-Green</dc:creator><description>&lt;p&gt;Wes,&lt;/p&gt;
&lt;p&gt;Would Microsoft consider hosting a FP community site? It seems clear that there's a real interest and hunger in the community for this stuff. The responses to your own posts show that the existing FP community has a considerable body of experience and insight to offer and are now coming out of the woodwork given the tentative steps C# 3 is making in this direction.&lt;/p&gt;
&lt;p&gt;What I'm suggesting is some central place where we can hang out, with links to your blog, HubFS, Lambda The Ultimate etc, Iron Python. The remit would be FP on .NET. &lt;/p&gt;
&lt;p&gt;Perhaps a sub-section of Channel 9, but I was really thinking of something like Coding For Fun in terms of having its own identity.&lt;/p&gt;
&lt;p&gt;Would Microsoft consider putting some resource behind this?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;tom&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1827451</link><pubDate>Wed, 07 Mar 2007 15:58:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1827451</guid><dc:creator>Joost Morsink</dc:creator><description>&lt;p&gt;Tom: I agree :)&lt;/p&gt;</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1828926</link><pubDate>Wed, 07 Mar 2007 19:29:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1828926</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;Joost:&lt;/p&gt;
&lt;p&gt;You can't do that today, but I'd love to add support for that.&lt;/p&gt;
&lt;p&gt;Tom:&lt;/p&gt;
&lt;p&gt;I forwarded your request on to the people who could organize that. &amp;nbsp;Thanks for the suggestion.&lt;/p&gt;
</description></item><item><title>re: Immutability, Purity, and Referential Transparency</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#1831441</link><pubDate>Thu, 08 Mar 2007 02:25:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1831441</guid><dc:creator>wesdyer</dc:creator><description>&lt;p&gt;I was told that it would be fairly difficult to organize such a site; however, I was also told that we'd be happy to host articles and provide links to FP related things on the C# site. &amp;nbsp;You can contact Charlie Calvert if you have something. &amp;nbsp;His blog is at: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/charlie"&gt;http://blogs.msdn.com/charlie&lt;/a&gt;.&lt;/p&gt;
</description></item><item><title>MVC, Desktop Clients, &amp; WPF</title><link>http://blogs.msdn.com/wesdyer/archive/2007/03/01/immutability-purity-and-referential-transparency.aspx#2095161</link><pubDate>Thu, 12 Apr 2007 06:55:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2095161</guid><dc:creator>Christopher Bennage</dc:creator><description>&lt;p&gt;I've spent the majority of my career as a Web developer, and I've only recently (with the discovery of&lt;/p&gt;
</description></item></channel></rss>