Currying and Partial Function Application

When I first heard the term Currying, I thought immediately of tasty Thai and Indian food.  To my dismay, I found that the conversation was not about wonderful spices but rather about transforming a function that takes n arguments into a function that takes only one argument and returns a curried function of n -…


Function Memoization

One of my favorite pastimes is playing games.  No not XBox 360, PS3, or Wii games nor other computer games, but board games, card games, and other such games.  It’s probably because I’m from a large family – I have 8 siblings – and we would often spend time together playing games.  It is a…


Video on Linq Queries and Delayed Evaluation

I recently recorded a video with Charlie Calvert about Linq queries and delayed evaluation.  You can find it here (streaming video).  Download it here.


Why Functional Programming is Important in a Mixed Environment

While my last post addressed how to go about learning to think functionally, it did not address why a programmer should embark on the journey in the first place.  Why is learning to think functionally important, especially in a mixed environment like C#, Python, or Ruby?  Why is it not good enough to stick with the tried…


Thinking Functionally

Every programmer has a story about how he got his start.  My own journey began at age 14 when I was bored to death while completing a second-year algebra assignment.  My father who was working on the couch with a brand new laptop showed me that I could write a program to do the work for…


About Queries

This concludes my series of posts about queries.  I will still discuss them occassionally and if anyone has any specific questions then I would be very glad to address them. Query Expression Posts 1. Comprehending Comprehensions What are queries?  How are queries treated by the compiler?  2. Transparent Identifiers How are local variables introduced by queries? 3. …


Another Model for Query Interpretation

An imperative model for interpreting Linq to Objects queries has already been discussed, but are there any other models or method for interpreting queries?  It turns out that there are other models.  Linq to SQL queries operate in a completely different manner.  In the discussion about Linq to Object queries, it was pointed out that…


Having Trouble with Queries

A Funny Joke and a Sad Joke There is a joke that goes something like this: Two men are hopelessly lost in hot air balloon.  Their condition is aggravated by the fact that they are enshrouded by a thicket of fog.  When it seems all is lost, suddenly the fog parts and miraculously a man is standing…


How Linq to Objects Queries Work

If you have ever tried to step through a Linq to Objects query in the debugger, you may have been mildly surprised at the results.  It may have seemed as if the program had a mind of its own and ran certain expressions when it wanted to and not when it was supposed to.  Be…