1

I'm using Prelude and Haskell mode and trying to set the indentation. The default indentation gives me the following:

main = do
  contents <- getContents
  print (sumFile contents)
  where sumFile = sum . map read . words

I'd like to have it indented like this:

main = do
    contents <- getContents
    print (sumFile contents)
  where sumFile = sum . map read . words

I tried to set M-x customize-option RET haskell-indentation-left-offset, set the value to 4, chose "Apply and Save" and nothing happened.

How do I fix the indentation? Thanks.

  • haskell-indent-after-keywords can be used to customize indentation on per-keyword basis, but I can't get it to work with your example. – DoMiNeLa10 Mar 26 '18 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.