Skip to content

Commit 94b8745

Browse files
antarestraderhdgarroodJordanMartinez
authored
OrphanTypeDeclaration Error explaination (#395)
* OrphanTypeDeclaration Error explaination Doing my part to fill in some documentation * Fixed typos * Wording change requested by Jordan Martinez "How about 'This is often caused by typographical issues.' ?" * Style Guide change: PureScript Use appropriate capitalization of `PureScript` Co-authored-by: Harry Garrood <[email protected]> * Rephrase 'typographical issues' to 'spelling mistakes' Co-authored-by: Harry Garrood <[email protected]> Co-authored-by: Harry Garrood <[email protected]> Co-authored-by: JordanMartinez <[email protected]>
1 parent 39a872d commit 94b8745

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

errors/OrphanTypeDeclaration.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@
55
```purescript
66
module ShortFailingExample where
77
8+
addTwo :: Number -> Number -> Number
9+
addToo a b = a + b
810
...
911
```
1012

1113
## Cause
1214

13-
Explain why a user might see this error.
15+
Purescript requires that the type declaration for a function or value (i.e. the line with the `::` in it)
16+
be followed immediately by the definition of that function or value (i.e. the line with the `=` in it). The
17+
compiler has found a declaration for which a definition did not follow.
1418

15-
## Fix
16-
17-
- Suggest possible solutions.
19+
This is often caused by spelling mistakes. Check to see that the declaration and the
20+
definition are spelled the same. PureScript is a whitespace sensitive language and the presence of an
21+
extra space can make the definition look like a part of the declaration.
1822

19-
## Notes
23+
## Fix
2024

21-
- Additional notes.
25+
- Ensure that the next (non-comment) line is the definition for the listed declaration.
26+
- Check that the spelling of the two matches.
27+
- Check for extra spaces. Both declaration and definition should start with the same indentation.

0 commit comments

Comments
 (0)