GHCI は の型を与えてくれます1 ++ 2
:
$ ghci
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :t 1 ++ 2
1 ++ 2 :: Num [a] => [a]
しかし、これは明らかに間違っています。タイプチェックするだけでなく、評価しようとすると、正しく失敗します。
Prelude> 1 ++ 2
<interactive>:3:1:
No instance for (Num [a0])
arising from the literal `1'
Possible fix: add an instance declaration for (Num [a0])
In the first argument of `(++)', namely `1'
In the expression: 1 ++ 2
In an equation for `it': it = 1 ++ 2
何を与える?