Code based on exercises from the book 'The Haskell Road to Logic, Maths, and Programming'