Improvements to the generated Haskell code