| Start |
|---|
Basic examples In the examples above, the type-checker infers a type-class rather than a concrete type for the two constants. In Haskell, the The concrete types above were inferred by GHC. More general types like |
Could not deduce (Fractional Int) ... The error message in the title is a common beginner mistake. Let's see how it arises and how to fix it. Suppose we need to compute the average value of a list of numbers; the following declaration would seem to do it, but it wouldn't compile: The problem is with the division We can fix the error message with |
| Function examples What's the type of What's the type of What's the type of RemarksThe numeric typeclass hierarchy
We have already seen the The
Caution: while expressions such as |
Read Article
https://develop.horje.com/learn/1434/reference