Skip to content

Put the newline after errors instead of before them

Jade requested to merge wip/newline-after-error into master

This changes how error messages are represented slightly:

-
Foo.hs:3:7: error: [GHC-88464] Data constructor not in scope: ABC
  |
3 | foo = ABC
  |       ^^^

Foo.hs:4:7: error: [GHC-88464] Variable not in scope: x
  |
4 | bar = x
  |       ^
+

This mainly has an effect on ghci:

ghci> 5 * 'x'
-
<interactive>:1:1: error: [GHC-39999]
    • No instance for ‘Num Char’ arising from the literal ‘5’
    • In the first argument of ‘(*)’, namely ‘5’
      In the expression: 5 * 'x'
      In an equation for ‘it’: it = 5 * 'x'
+
ghci> foo
-
<interactive>:2:1: error: [GHC-88464] Variable not in scope: foo
+
ghci>

This makes it easier to see which expression an error belongs to and feels like more of a 'correct' behavior

Merge request reports