on master help sign in
tweak error message for unexpected arrow in expressions
00ee154Evan Czaplicki
compiler/src/Reporting/Error/Syntax.hs+8−4
@@ -2868,11 +2868,15 @@ toOperatorReport source context operator row col =
2868 else
2868 else
2869 (
2869 (
2870 D.reflow $
2870 D.reflow $
2871− "I was not expecting an arrow here:"
2871+ "I was partway through parsing an expression when I got stuck on this arrow:"
2872 ,
2872 ,
2873− D.reflow $
2873+ D.stack
2874− "Arrows should only appear in `case` expressions and anonymous functions. Maybe\
2874+ [ "Arrows should only appear in `case` expressions and anonymous functions.\n\
2875− \ you want > or >= instead?"
2875+ \Maybe it was supposed to be a > sign instead?"
2876+ , D.toSimpleNote $
2877+ "The syntax for anonymous functions is (\\x -> x + 1) so the arguments all appear\
2878+ \ after the backslash and before the arrow. Maybe you forgot the backslash earlier?"
2879+ ]
2876 )
2880 )
2877
2881
2878 BadEquals ->
2882 BadEquals ->