Thanks to
http://stackoverflow.com/questions/22162461/num-type-class-operations-in-haskell/22162583?noredirect=1#22162583
got rid of boilerplate code