Factorization diagrams, as seen on the cover of Hacker Monthly.

Author: Brent Yorgey

Download raw source code

import Diagrams.Backend.SVG.CmdLine
{-# LANGUAGE NoMonomorphismRestriction #-}

import Diagrams.Prelude

To see how this example is implemented, see the source code of the Diagrams.TwoD.Factorization module included in the diagrams-contrib package, or read the original blog posts here and here.

import Diagrams.TwoD.Factorization

example = fdGridList 6 # center # pad 1.05
main = mainWith (example :: Diagram B)