Skip to content
Haskell example: A simple fractal image renderer
Haskell TeX
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
LICENSE
README.md
Setup.hs
fractal.hs
haskell-fractal.cabal
poster.pdf
poster.tex
w10000_i1200.png

README.md

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 zunzun.com.

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.

Output

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.

Usage

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
./.cabal-sandbox/bin/haskell-fractal

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.

Something went wrong with that request. Please try again.