Saturday, August 14, 2010

As if from nowhere, e appears, at it's own pace!

Inspired by this lovely blogpost I decided to write my own slow and arcane "e" maker. Please compile it before running, otherwise it has runtime complexity O(forever).

Tuesday, August 3, 2010

Sunday, June 27, 2010

A Couple of Haskell Quines

A simple little quine. A quaint quine.

Fancier applicative version, because it's more hardcore.

Thursday, June 17, 2010

Floating Point is Shit Part Two

Haskell is a great logical language and can be used for proofs and has Curry-Howard isomorphic-mathematical-glorious beauty. With that in mind I feel that when ghci says Peano's eighth postulate is false you best listen.

Wednesday, June 2, 2010

Gorgeous Haskell Mandelbrot (and Burning Ship) in Haskell for your Enjoyment

As usual it's slow. It could be made much faster by using a parallel map. That's an exercise for the reader. Also PPM is terrible for anything but writing to, it must be converted immediately.

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.