Drawing Fractals with PureScript
Recently, for no good reason, I added an easter egg to my personal website. I love fractals and decided to add a visualization of the dragon curve. Here were the requirements: Every 10 seconds, a new iteration of the dragon curve would be drawn. If the user clicked anywhere within the drawing area, a new iteration would be drawn and the 10 second clock would be reset. After the 10th iteration is drawn, the drawing should be cleared and the process should restart. I decided to use SVG to draw the lines of the fractal. Initially, I built a solution in Elm. However, I was missing the flexibility I’d experienced with my previous back end work in PureScript and wanted to explore using it on the front end. This post walks through the process of rebuilding the solution in PureScript. ...