Hilbert curve
An order-5 approximation to the space-filling Hilbert curve.
> {-# LANGUAGE NoMonomorphismRestriction #-}
> import Diagrams.Prelude
>
> hilbert = iterate expand mempty where
> expand t = alignBL $ hcat [u, hrule 1, reflectX u] where
> u = vcat [t, alignT $ vrule 1, rotateBy (3/4) t]
>
> example = pad 1.1 . centerXY . lw 0.05 $ hilbert!!5
Haskell drawing framework