German enigma machine implemented with pure functional programming