Can anybody explain, why it is valid to read a number to add it to a another number, although reading just a number is not valid?
Prelude> read "5" + 3
8
Prelude> read "5"
:33:1:
No instance for (Read a0) arising from a use of `read'
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
instance Read () -- Defined in `GHC.Read'
instance (Read a, Read b) => Read (a, b) -- Defined in `GHC.Read'
instance (Read a, Read b, Read c) => Read (a, b, c)
-- Defined in `GHC.Read'
...plus 25 others
In the expression: read "5"
In an equation for `it': it = read "5"
Why is "5" ambiguous?