@@ -813,8 +813,8 @@ toExprReport source name expr _ _ =
813 Tuple _ _ _ ->
813 Tuple _ _ _ ->
814 error "TODO Tuple"
814 error "TODO Tuple"
816− Func _ _ _ ->
816+ Func func row col ->
817− error "TODO Func"
817+ toFuncReport source name func row col
819 Dot row col ->
819 Dot row col ->
820 let region = toRegion row col in
820 let region = toRegion row col in
@@ -1327,6 +1327,105 @@ toOperatorReport source name operator row col =
1330+toFuncReport :: Code.Source -> Name.Name -> Func -> Row -> Col -> Report.Report
1331+toFuncReport source name func frow fcol =
1333+ FuncSpace space row col ->
1334+ toSpaceReport source space row col
1336+ FuncArg pattern row col ->
1337+ error "TODO FuncArg" pattern row col
1339+ FuncBody expr row col ->
1340+ toExprReport source name expr row col
1342+ FuncArrow row col ->
1344+ surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1345+ region = toRegion row col
1347+ Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
1348+ Report.toCodeSnippet source surroundings (Just region)
1351+ "I was expecting to see an arrow here:"
1354+ "The syntax for anonymous functions is (\\x -> x + 1) so I am missing the arrow\
1355+ \ and the body of the function."
1358+ FuncIndentArg row col ->
1360+ surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1361+ region = toRegion row col
1363+ Report.Report "MISSING ARGUMENT" region [] $
1364+ Report.toCodeSnippet source surroundings (Just region)
1367+ "I just saw the start of an anonymous function, so I was expecting to see an argument here:"
1371+ ["Something","like",D.dullyellow"x","or",D.dullyellow "name" <> "."
1372+ ,"Anything","that","starts","with","a","lower","case","letter!"
1375+ "The syntax for anonymous functions is (\\x -> x + 1) where the backslash\
1376+ \ is meant to look a bit like a lambda if you squint. This visual pun seemed\
1377+ \ like a better idea at the time!"
1381+ FuncIndentArrow row col ->
1383+ surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1384+ region = toRegion row col
1386+ Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
1387+ Report.toCodeSnippet source surroundings (Just region)
1390+ "I was expecting to see an arrow here:"
1394+ "The syntax for anonymous functions is (\\x -> x + 1) so I am missing the arrow\
1395+ \ and the body of the function."
1397+ "It is possible that I am confused about indetation! I generally recommend\
1398+ \ switching to named functions if the definition cannot fit inline nicely, so\
1399+ \ either (1) try to fit the whole anonymous function on one line or (2) break\
1400+ \ the whole thing out into a named function. Things tend to be clearer that way!"
1404+ FuncIndentBody row col ->
1406+ surroundings = A.Region (A.Position frow fcol) (A.Position row col)
1407+ region = toRegion row col
1409+ Report.Report "UNFINISHED ANONYMOUS FUNCTION" region [] $
1410+ Report.toCodeSnippet source surroundings (Just region)
1413+ "I was expecting to see the body of your anonymous function here:"
1417+ "The syntax for anonymous functions is (\\x -> x + 1) so I am missing all the stuff after the arrow!"
1419+ "It is possible that I am confused about indetation! I generally recommend\
1420+ \ switching to named functions if the definition cannot fit inline nicely, so\
1421+ \ either (1) try to fit the whole anonymous function on one line or (2) break\
1422+ \ the whole thing out into a named function. Things tend to be clearer that way!"
1331 case err of
1430 case err of
1332 CommentOnNothing region ->
1431 CommentOnNothing region ->