optimize haskell mode