8000 suggest naming the arguments · purescript/documentation@f62b797 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f62b797

Browse files
authored
suggest naming the arguments
keep the original suggestion as a note
1 parent 46cc22a commit f62b797

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

errors/IncorrectAnonymousArgument.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ In an [operator section](https://github.com/purescript/documentation/blob/fc4a9d
1717

1818
## Fix
1919

20-
In the case of multiple arguments:
20+
In the case of multiple arguments, give them names:
2121
```purescript
22-
add = \a -> (a + _)
22+
add a b = (a + b)
2323
```
2424
or in the case of a normal function: Write the function [as an operator](https://github.com/purescript/documentation/blob/fc4a9db4b128aa3331e5f990cb1860e59077af31/language/Syntax.md#functions-as-operators) using backticks:
2525
```purescript
@@ -29,7 +29,9 @@ mapArray = _ `map` [1, 2, 3]
2929

3030
## Notes
3131

32-
If you really want to have multiple anonymous arguments, this can be achieved like this:
32+
- While `_ + _` will give this error; `\a -> a + _` will not
33+
34+
- If you really want to have multiple anonymous arguments, it can be achieved like this:
3335
```purescript
3436
add = (((+) $ _) $ _)
3537
```

0 commit comments

Comments
 (0)
0