Haskell has an excellent 2D graphics library called diagrams
. Its website begins with an short example that produces the repeating pattern (called a “Hilbert curve”) displayed in the page header.
The objective of our demonstration will be to:
- Download this code;
- Run it, producing a vector image; and
- Convert the result to a PNG file.
First we’ll do this in a traditional fashion using Make, and then we’ll rewrite it using Nix.