This page shows the source for this entry, with WebCore formatting language tags and attributes highlighted.


Verity Stob Teaches Functional Programming


The article <a href="" source="The Register" author="Verity Stob">Learn you Func Prog on five minute quick!</a> provides a typically twisted and unhelpful overview of the state of functional programming in this 21st-century renaissance---heralded decades ago by Lisp programmers. It includes an honest overview of the major players, including Scala, for which the "pro" and "con" are the same (a <iq>[c]lose relationship with Java [...]</iq>) and ending with JavaScript, for which the "pro" is <iq>It's what you'll end up using.</iq> The discussion continues with rules: variable immutability, function purity, curryability and monadicity, which is where things really go off the rails. Property 7 dribbles to a shuddering halt with, <bq>All monads define a <c>unit()</c> function called <c>of()</c>, a <c>bind()</c> function called <c>map()</c> and a type constructor function called... Wait a minute. Wait a minute. Perhaps <c>bind()</c> is a functor not a function. I'm pretty sure about that. Hold on to the horses a moment there while I look it up. ...And I should perhaps clarify that this <c>bind()</c> and <c>map()</c> is nothing to do with any other <c>bind()</c> or <c>map()</c> methods or functions that you might be familiar with, although their actions are in some sense quite similar. <i>Summary:</i> It has been an honour and a pleasure to clear all that up for you. <i>Final Reader's comment:</i> My gratitude is inexpressible.<fn></bq> <hr> <ft>I've been reading Verity Stob since the days when she was published in <i>Dr. Dobbs</i>. Nice to see her still going with the same sense of humour (sic) and insight into the at-times puffed-up and self-important programming world.<fn></ft> <ft>Which is not to say that I don't enjoy immensely the functional aspects of C#. I do. I also have read a lot about monads and am completely familiar with the tragically bad and unenlightening explanations. Stob captures this elegantly with the following corollary to Rule 4: <bq>If you should by some accident come to understand what a Monad is, you will simultaneously lose the ability to explain it to anybody else.</bq></ft>