I’ve given in to the unholy urge to write a monad tutorial. Here are some remarks that might help you decide whether it’s worth your time to read on. My intended readers are programmers interested in functional programming, not mathematicians. No category theory is required. All the code will be in Clojure. The level of [...]
Archives for Clojure
The expressiveness of functional programming
I’d like to revisit the discrete convolution problem described in my previous post, to consider the expressiveness of functional programming. Here I am interested in the power of code to communicate intent; the bare metal speed of the code is secondary. The various comments and proposed implementations in this Google Groups thread are what got [...]
Discrete convolution of finite vectors
Isaac Hodes posted a request to both StackOverflow and the Clojure mailing list, asking for some help implementing a discrete convolution function in Clojure. I am trying to create a lazy/functional/efficient/Clojuresque function to carry out convolution on two lists/vectors of (ideally BigDecimals but that may be inefficient) doubles. … Right now, it seems as though [...]
British Lottery Puzzle
Have I mentioned that I’m a sucker for probability puzzles? I found this one at ibbly.com: Two teams from opposite ends of the country have been drawn to play each other in a competition. They need to determine which team plays at home and do so fairly at a distance. They decide to try to [...]
The Matchbook Problem
I have been reading a lovely book by Paul Nahin, Digital Dice. The book is subtitled Computational Solutions to Practical Probability Problems. I don’t know how practical the problems are, but they are a lot of fun. Probability theory is rife with seemingly simple problems which turn out to be less simple than first appears. [...]
Cartesian product
I was browsing the 6-24 Clojure-log archive and ran across an invitation from Craig Andera: I’ve knocked out a quick definition of something that computes the Cartesian cross product of multiple sequences. But as always when I write Clojure, I have to assume someone else can do it in less code. Anyone care to take [...]
Clojure bowling problem
ObjectMentor’s Uncle Bob posted about learning Clojure via a bowling challenge. The challenge is to write a program to compute bowling scores. I decided to give it a go. I’m not a bowler, so my first step was to try to understand how bowling scores are computed. Once I did that, it struck me that [...]
My road to Clojure
I’ve been studying Clojure, using my standard approach of solving Project Euler problems. I am very much impressed. Here’s why. Functional Programming Short of speech itself, mathematics is humanity’s most powerful and influential symbolic technology. Mathematics makes possible the science that shapes our world-view, and the technology that shapes our world. The central abstraction in [...]
The wait is over
Daniel Weinreb is a man with impeccable Common Lisp credentials. Wikipedia cites him as one of the authors of the original language spec, Common Lisp: The Language, First Edition, and as a cofounder of Symbolics, Inc., makers of legendary lisp machines. Here is what Weinreb had to say in a comment on Stuart Sierra’s blog: [...]
Posts