+ haskell implementation of bonus ass. 8
TODO: testable properties of ass. 7, remainder of ass. 8, ass. 9