Thursday 24th October, 2013
2:00pm to 2:45pm
The computational sciences are still learning the benefits of functional programming. Most users of R are familiar with object-oriented programming but have not been exposed to the joys of functional programming. In this session I discuss why functional programming is important for the computational sciences in terms of modeling, program organization, and reasoning about the correctness of a program.
The session introduces lambda.r, a package I wrote that enables a functional programming style in the R language. Using examples based on my work forecasting consumer financial transactions, I will discuss when and why I use the various features of lambda.r, including multipart function definitions, guard expressions, type constraints and variables, and attributes in my models.
The session also explores practical uses of the lambda calculus to reason about numerical programs and show the equivalence between various forms (using Church numerals and iterative function systems as examples). As R supports vectors natively, there are some surprising results that stem from this.
Sign in to add slides, notes or videos to this session