Skip to content

Commit 4c8e1d8

Browse files
Added order to examples; added error message to descriptions
1 parent c08a62d commit 4c8e1d8

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
module Simple where
2-
31
inc :: Int -> Int
42
inc i = i + 1
53

64
two = inc 1
7-
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
module Simple where
2-
31
inc :: Int -> Int
42
inc i = i + 1
53

64
two = inc "x"
7-

message-index/messages/GHC-83865/terms/index.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Values of Different Types
3-
order: 1
3+
order: 0
44
---
55

66
Function `inc` has type `Int -> Int`, hence it expects an argument
@@ -14,3 +14,18 @@ and ask for it with `:type` (or its shorthand `:t`):
1414
ghci> :t "x"
1515
"x" :: String
1616
```
17+
18+
## Error Message
19+
20+
```
21+
Terms.hs:6:11: error: [GHC-83865]
22+
• Couldn't match type ‘[Char]’ with ‘Int’
23+
Expected: Int
24+
Actual: String
25+
• In the first argument of ‘inc’, namely ‘"x"’
26+
In the expression: inc "x"
27+
In an equation for ‘two’: two = inc "x"
28+
|
29+
4 | two = inc "x"
30+
|
31+
```

message-index/messages/GHC-83865/type-kind-mism/index.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Type expected, but kind received.
3-
order: 0
3+
order: 1
44
---
55

66
Forgetting the type parameter to `Maybe` is the culprit, but it is only caught in the
@@ -20,3 +20,15 @@ ghci> :k (->)
2020
ghci> :k Maybe
2121
Maybe :: * -> *
2222
```
23+
24+
## Error Message
25+
26+
```
27+
Type.hs:1:14: error: [GHC-83865]
28+
• Expecting one more argument to ‘Maybe’
29+
Expected a type, but ‘Maybe’ has kind ‘* -> *’
30+
• In the type signature: isNothing :: Maybe -> Bool
31+
|
32+
1 | isNothing :: Maybe -> Bool
33+
|
34+
```

0 commit comments

Comments
 (0)