File tree Expand file tree Collapse file tree 4 files changed +29
-8
lines changed
message-index/messages/GHC-83865 Expand file tree Collapse file tree 4 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 1
- module Simple where
2
-
3
1
inc :: Int -> Int
4
2
inc i = i + 1
5
3
6
4
two = inc 1
7
-
Original file line number Diff line number Diff line change 1
- module Simple where
2
-
3
1
inc :: Int -> Int
4
2
inc i = i + 1
5
3
6
4
two = inc " x"
7
-
Original file line number Diff line number Diff line change 1
1
---
2
2
title : Values of Different Types
3
- order : 1
3
+ order : 0
4
4
---
5
5
6
6
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`):
14
14
ghci> :t "x"
15
15
"x" :: String
16
16
```
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
+ ```
Original file line number Diff line number Diff line change 1
1
---
2
2
title : Type expected, but kind received.
3
- order : 0
3
+ order : 1
4
4
---
5
5
6
6
Forgetting the type parameter to ` Maybe ` is the culprit, but it is only caught in the
@@ -20,3 +20,15 @@ ghci> :k (->)
20
20
ghci> :k Maybe
21
21
Maybe :: * -> *
22
22
```
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
+ ```
You can’t perform that action at this time.
0 commit comments