`indent-according-to-mode` is called in: 1. In `newline-and-indent`. 2. In `electric-indent-mode` after `\n` has been inserted. 3. In `evil-open-above`. 4. In `evil-open-below`. Each of these cases is same: it is to semantically continue previous line. So we need: 1. If previous line ends with operator, continue expression. 2. If inside parenthesized expression, continue on the level of the expression. 3. Lacking other context continue same indentation block. Note that `haskell-indentation` already has `haskell-indentation-newline-and-indent` that touches this problem but hard to say how good it is. Reference: https://github.com/syl20bnr/spacemacs/issues/5010, https://github.com/syl20bnr/spacemacs/issues/621, https://github.com/syl20bnr/spacemacs/issues/3162, https://github.com/haskell/haskell-mode/issues/896