Skip to content

Commit 9c15cf4

Browse files
BebeSparkelSparkelhdgarrood
authored andcommitted
Update ArgListLengthsDiffer.md (#268)
* Update ArgListLengthsDiffer.md * Update CONTRIBUTORS.md
1 parent 69fba66 commit 9c15cf4

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ If you would prefer to use different terms, please use the section below instead
6565
| [@tchajed](https://github.com/tchajed) | Tej Chajed | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
6666
| [@stephencelis](https://github.com/stephencelis) | Stephen Celis | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
6767
| [@AidanDelaney](https://github.com/AidanDelaney) | Aidan Delaney | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
68+
| [@BebeSparkelSparkel](https://github.com/BebeSparkelSparkel) | William Rusnack | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
6869

6970
### Contributors using Modified Terms
7071

errors/ArgListLengthsDiffer.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,38 @@
22

33
## Example
44

5+
Differing number of arguments for each foo declaration:
6+
57
```purescript
6-
module ShortFailingExample where
8+
foo 0 y = 0
9+
foo x y z = x * y * z
10+
```
11+
12+
Forgotten parenthesis around ADT deconstruction:
713

8-
...
14+
```purescript
15+
data Some = Three Int Int Int
16+
| NoneHere
17+
18+
bar Three x y z = x * y * z -- needs parenthesis around
19+
bar NoneHere = 0
20+
21+
-- corrected with parenthesis
22+
bar (Three x y z) = x * y * z
23+
bar NoneHere = 0
924
```
1025

1126
## Cause
1227

13-
Explain why a user might see this error.
28+
ArgListLengthsDiffer arrises from a function having different numbers of argument variables.
29+
30+
Commonly seen when parenthesis are forgotten around an ADT deconstruction argument.
1431

1532
## Fix
1633

17-
- Suggest possible solutions.
34+
Ensure that there are the same number of arguments for each pattern matching function declaration.
35+
36+
Check to ensure that there are parenthesis around ADT deconstruction.
1837

1938
## Notes
2039

0 commit comments

Comments
 (0)