Edd Mann Developer

Building an Enigma Machine in Haskell

Following on from my previous post which highlighted my experience building an Enigma Machine in ClojureScript, I decided it would be interesting to model the machine within Haskell. I felt solving the same problem in this mannor would be a great way to compare and contrast Lisp and heavily-typed languages such as Haskell. Through this process I also wanted to explore using Hspec and QuickCheck for comparable Property-based testing that I achieved in the ClojureScript counterpart.

Building an Enigma Machine in ClojureScript

The Enigma Machine is a typewriter-sized substitution encryption device used by Germany in World War 2. It was so important to the war-time efforts that work carried out by Alan Turing at Bletchley Park to decode the resulting ciphers helped end the war. For years I have been fascinated by this device, and thought it would be interesting to explore implementing a web-based Enigma Machine using ClojureScript. I also thought it would be a great opportunity to explore how I can use Property-based testing to help garner confidence from the resulting implementation.

The Mystery Calculator in ClojureScript and Reagent

The Mystery Calculator is a commonly found Christmas cracker gift, which uses a neat powers of two (binary) addition trick to fool the spectator. I thought it would be interesting to create a small web application in ClojureScript and Reagent, which provided the ability to generate a selection of these cards and perform the trick.