haddock improvements and trailing whitespace removal