Search Wiki:
Resource Page Description
This is a set of libraries to demonstrate functional programming aspects as implemented in C#. This is not to imply that C# is a functional language, but can implement some of the aspects of it. This project is to demonstrate some of those techniques

This project includes samples of the following topics:

More will be added as I implement them. Suggestions and comments always welcome
Last edited Sep 17 2008 at 3:08 AM  by MatthewPodwysocki, version 7
Comments
damonwildercarr wrote  Oct 4 2008 at 8:21 AM  
Thanks so much Matthew again for your work. This is so cool that you provide much hard work for the benefit of others..

Damon

wkhazzard wrote  Oct 7 2008 at 9:34 PM  
Thanks, Matt. You may want to provide a link to the Microsoft Parallel Extensions to .NET Framework 3.5, June 2008 Community Technology Preview at:

http://www.microsoft.com/downloads/details.aspx?FamilyId=348F73FD-593D-4B3C-B055-694C50D2B0F3&displaylang=en

The extensions are required to build Functional C#. Excellent work. I really enjoyed your presentation at the Richmond Code Camp on October 4th, 2008.

Thanks,

Kevin

leppie wrote  Oct 15 2008 at 9:40 AM  
Tail recursion/calls implies no stack grow. All the 'tail' examples has stack growth. This is not tail recursion. It is just normal recursion. Unless you are planning on adding proper tail call support to LINQ expressions, please dont calls it something it is not.

MatthewPodwysocki wrote  Oct 15 2008 at 8:00 PM  
@leppie,

I disagree with your statement. Just because the C# compiler doesn't optimize the tail calls properly, does not mean that the x64 JITer cannot do it. Since the last thing they do is call itself, that is a tail call recursion, whether or not C# chooses to respect it.

reinux wrote  Oct 1 2009 at 5:32 AM  
I don't. The only purpose of distinguishing tail recursion from any other kind of recursion is because it can be optimized. Whether the use of the term is technically correct or not, it's wrong to use it in this context. It's like selling a notebook on eBay for $1000 and shipping the customer a pen & paper notebook.

The availability of tail recursion optimization affects the structure of your algorithms; if you can't expect every computer you're targeting to support tail recursion, then you have to redesign your code -- i.e., you can't use tail recursion.

The fact that only x64 supports tail recursion optimization means that apps targeting the CLR are going to become more fragmented.

Updating...
Page view tracker