Skip to content

Commit 35d3607

Browse files
committed
Add more examples and fix PL lingo
1 parent 1ad6bfe commit 35d3607

File tree

14 files changed

+121
-19
lines changed

14 files changed

+121
-19
lines changed

message-index/messages/GHC-44432/example1/index.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

message-index/messages/GHC-44432/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ severity: error
55
introduced: 9.6.1
66
---
77

8-
If a toplevel type signature is given, then there also needs to be an accompanying binding.
8+
If a type signature is given for a name, then that name also needs to be defined.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module MissingBinding where
2+
3+
fortytwo :: Integer
4+
fortytwo =
5+
let
6+
two :: Integer
7+
two = 2
8+
in
9+
40 + two
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module MissingBinding where
2+
3+
fortytwo :: Integer
4+
fortytwo =
5+
let
6+
two :: Integer
7+
in
8+
40 + two
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Type signature lacks an accompanying binding
3+
---
4+
5+
If a type signature is given for a name in a local let expression, then the name also needs to be defined.
6+
7+
In this example, a type signature was given for the name `two` in a let expression, but no definition was specified.
8+
This error can be fixed by adding a definition which accompanies the type signature.
9+
10+
## Error Message
11+
12+
```
13+
MissingBinding.hs:6:5: error: [GHC-44432]
14+
The type signature for ‘two’ lacks an accompanying binding
15+
|
16+
6 | two :: Integer
17+
| ^^^
18+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Type signature lacks an accompanying binding
3+
---
4+
5+
If a type signature is given for a name in a Haskell module, then the name also needs to be defined.
6+
7+
In this example, a type signature was given for the name `someBoolean` in a Haskell module, but no definition was specified.
8+
This error can be fixed by adding a definition which accompanies the type signature.
9+
10+
## Error Message
11+
12+
```
13+
MissingBinding.hs:3:1: error: [GHC-44432]
14+
The type signature for ‘someBoolean’ lacks an accompanying binding
15+
|
16+
3 | someBoolean :: Bool
17+
| ^^^^^^^^^^^
18+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module MissingBinding where
2+
3+
import Numeric.Natural
4+
5+
factorial :: Natural -> Natural
6+
factorial n
7+
| n == 0 = 1
8+
| otherwise = n * factorial (n - 1)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module MissingBinding where
2+
3+
import Numeric.Natural
4+
5+
factorial :: Natural -> Natural
6+
fatcorial n
7+
| n == 0 = 1
8+
| otherwise = n * factorial (n - 1)

0 commit comments

Comments
 (0)