Implementation of solution suggested by @Ahnfelt

From “MF#K Odd Tuesdays” meetup on tuesday the 28th of August.
It was written in Notepad by Joakim Ahnfelt-Rønne on a Windows
computer with no Haskell interpreter or compiler.