Browse by Tags

Tagged Content List
  • Blog Post: The Marvels of Monads

    If the word "continuation" causes eyes to glaze over, then the word "monad" induces mental paralysis.  Perhaps, this is why some have begun inventing more benign names for monads. These days, monads are the celebrities of programming language theory.  They gloss the cover...
  • Blog Post: Continuation-Passing Style

    There are some technical words that cause quite a stir even amongst geeks.  When someone says the word "continuation" , people's eyes glaze over and they seek the first opportunity to change the subject.  The stir is caused because most people don't understand what a continuation...
  • Blog Post: Immutability, Purity, and Referential Transparency

    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 well? If it happened recently then congratulations...
  • Blog Post: The Virtues of Laziness

    It seems that I riled some people up with my blog post yesterday. After some thought, I think the primary reason that there was some backlash is because some people feel that I violated one of the sacred principles of FP: lists are *the* data structure. Well, let me set the matter straight. I love lists...
  • Blog Post: Why all the love for lists?

    One of the things that I have noticed when participating in interviews with potential candidates is that most candidates have a favorite data structure. Presumably this is the data structure that they feel the most comfortable with. The problem is that no matter what coding question I ask them, they...
  • Blog Post: Memoization and Anonymous Recursion

    Keith Farmer brought it to my attention that there is at least a little confusion about how closures work. Hopefully, I can help shed a little light on the subject. The question is why doesn't the following code actually memoize fib in the call to Test? Func<int, int> fib = null; fib = n =>...
  • Blog Post: Anonymous Recursion in C#

    Recursion is beautiful and lambdas are the ultimate abstraction. But how can they be used together? Lambdas are anonymous functions and recursion requires names. Let's try to define a lambda that computes the nth fibonacci number. Func<int, int> fib = n => n > 1 ? fib(n - 1) + fib(n...
  • Blog Post: 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...
  • Blog Post: 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 good way to accommodate...
  • Blog Post: 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...
  • Blog Post: 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 me. I instantly...
  • Blog Post: Thus Quoth the Humble Programmer

    I love Scheme! It is such a beautiful language. I was first introduced to it during college. At that time, I thought it was an interesting language but I didn't see the power of the language until later. That moment came when I experienced reading The Structure and Interpretation of Computer Programs...
Page 1 of 1 (12 items)