@@ -85,8 +85,10 @@ What about doing `5 + "llama"` or `5 == True`?
8585Well, if we try the first snippet, we get a big scary error message!
8686
8787``` {.haskell: .ghci}
88- • No instance for (Num String) arising from a use of ‘+’
89- • In the expression: 5 + "llama"
88+ <interactive>:1:1: error: [GHC-39999]
89+ • No instance for ‘Num String’ arising from the literal ‘5’
90+ • In the first argument of ‘(+)’, namely ‘5’
91+ In the expression: 5 + "llama"
9092 In an equation for ‘it’: it = 5 + "llama"
9193```
9294
@@ -102,6 +104,13 @@ We'll take a closer look at types a bit later.
102104Note: you can do ` 5 + 4.0 ` because ` 5 ` is sneaky and can act like an integer or a floating-point number.
103105` 4.0 ` can't act like an integer, so ` 5 ` is the one that has to adapt.
104106
107+ ::: {.hintbox}
108+ ** Note:** GHC errors are all assigned unique identifiers such as ` GHC-39999 ` above.
109+ Whenever you are stuck with a stubborn error, you can look it up at
110+ [ https://errors.haskell.org/ ] ( https://errors.haskell.org/ ) to learn typical causes
111+ and solutions.
112+ :::
113+
105114You may not have known it but we've been using functions now all along.
106115For instance, ` * ` is a function that takes two numbers and multiplies them.
107116As you've seen, we call it by sandwiching it between them.
@@ -777,8 +786,9 @@ What if we tried to make a shape like `[(1,2),(8,11,5),(4,5)]`?
777786Well, we'd get this error:
778787
779788``` {.haskell: .ghci}
780- • Couldn't match expected type ‘(a, b)’
781- with actual type ‘(a0, b0, c0)’
789+ <interactive>:1:8: error: [GHC-83865]
790+ • Couldn't match expected type: (a, b)
791+ with actual type: (a0, b0, c0)
782792 • In the expression: (8, 11, 5)
783793 In the expression: [(1, 2), (8, 11, 5), (4, 5)]
784794 In an equation for ‘it’: it = [(1, 2), (8, 11, 5), (4, 5)]
0 commit comments