Thursday, May 20, 2010

Tuesday, May 11, 2010

Implicit Folds in Haskell (for those jealous of LISP)

Ever wish you could do things like (+ 3 4 5) from LISP, but in Haskell? Wish no more with the beautiful FoldyList datatype! An example instance for Show is given but feel free to write your own, otherwise the code is next to useless.

Tuesday, March 23, 2010

Bad and Slow Numeric Integration in Haskell

It's not very fast, but at least it'll work on arbitrary real functions.

On the Length of a Differentiable Curve

So for a function f on an interval (a,b) the length of the curve produced is given by:
\int_a^b \sqrt{f'(x)^2+1} \, dx


You can try it using f(x)=x and get 2^(1/2) x, how thrilling.