Skip to content
Haskell example: A simple fractal image renderer
Haskell TeX
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Haskell example:

A simple fractal image renderer

I've always been intrigued by fractals, and decided to make an example program in Haskell that renders a part of the Mandelbrot set to an image.

The code is based on Michael Bradshaw's Mandelbrot blog post, tweaked it for brevity and educational purposes. Finally I sharpened the contrast a bit. To find a nice contrast enhancing curve I used the awesome curve fitter of

The idea is that it can show some of Haskell's features in a short program with a wonderfully complex output. Hopefully it is more suitable for introducing Haskell to newcomers then the fibonacci sequence and the quicksort algorithm.

Posting this project to Reddit resulted in some adjustments to the code, please find the details in the comments.


A fairly large rendering (10000 x 14142) is commited to this repository in PNG format. Have a look (17MB, sorry Github).

PDF version

This code comes with a PDF version of the fractal rendering combined with the Haskell source code used to create it.


On a recent Haskell setup the following commands should be enough to build and run the code from a cabal sandbox:

cabal sandbox init
cabal install

To make test renderings a width of 2000 should be enough, for a final rendering the width may be increased to something like 10000.

Finally ShareLatex chimed in to compile the PDF.

You can’t perform that action at this time.