Richmond Code Camp 2008.2 - Functional C# Recap
Thanks to everyone who attended my session "Functional C# or how I lost the foreach and learned to love LINQ". This is still an ongoing passion of mine that I hope to expand upon in the upcoming posts. Some of these topics include favoring functional composition over inheritance and implementing patterns such as the Specification Pattern using these techniques. I'll be posting all code snippets from the functional posts up to date on the MSDN Code Gallery Functional C# Project.
Here are some resources that will be helpful in covering functional programming aspects as well as other topics covered:
Functional Programming
C# Futures
- Is C# Becoming a Functional Language? - Mads Torgersen
- C# 4.0 : Meet the Design Team
- Anders Hejlsberg and Guy Steele on Concurrency and Language Design
Functional Programming Aspects with C#
- Functional C# - Into the Great Void
- Functional C# - Unfolding Lists
- Functional C# - Learn from F# and LINQ
- Functional C# - Pattern Matching
Recursion in C#
- Part 1 - Basic Recursion Techniques
- Part 2 - Recursing into Linear, Tail and Binary Recursion
- Part 3 - Recursion on Lists
- Part 4 - Recursing into Recursion - Memoization
- Part 5 - Continuation Passing
Monads
- The Marvel of Monads - Wes Dyer
- Don't Fear the Monads - Brian Beckman
- Monads, Monoids and Mort - Brian Beckman
Spec#
- Spec# Home Page
- Hanselminutes Episode 110 - Spec# with Rustan Leino and Mike Barnett
- .NET 3.5, Design by Contract and Spec#
Podcasts
- Software Engineering Radio Episode 108 - Simon Peyton Jones on Functional Programming and Haskell
- Software Engineering Radio Episode 97 - Anders Hejlsberg
- Software Engineering Radio Episode 72 - Erik Meijer on LINQ
- .NET Rocks Episode 310 - Simon Peyton Jones on Functional Programming and Haskell
- .NET Rocks Episode 270 - Erik Meijer on LINQ
As I said before, I'm making the code available as I put it up on MSDN Code Gallery as the FunctionalCSharp project. This is intended to be a library of functional programming techniques in C# 3.0 and some demonstrations of moving from imperative style programming to a more functional programming style. This is an ongoing project and more will be added in time, and I may end up just putting them up not as samples, but as a library.
Some of the topics covered in these code projects are:
- Closures
- Currying
- Filter High Order Function
- Fold High Order Function
- Iterators
- Lazy Evaluation
- LINQ
- Lists (Immutable and Recursive)
- List Comprehensions
- Map High Order Function
- Memoization
- Monads
- Operators (Forward, Reverse, etc)
- Recursion
- Unfolding and Generators
As always, my code snippets can be found on MSDN Code Gallery at the Functional C# Library.