In GHCi, i type
let xs = [1, 'a']
it complains the error immediately:
<interactive>:28:11:
No instance for (Num Char) arising from the literal ‘1’
In the expression: 1
In the expression: [1, 'a']
In an equation for ‘xs’: xs = [1, 'a']
However, when I type
let xs = [1, [1, 1]]
It just passed. And it complains when I try to print xs:
<interactive>:5:1:
No instance for (Num [t0]) arising from a use of ‘it’
In a stmt of an interactive GHCi command: print it
I think Haskell is a static type language so any type error should be caught in compile time. I am wondering why the above 2 errors are caught at different time?