GHCI da mi typ dla 1 ++ 2
:Dlaczego ghci daje mi typ "1 ++ 2" zamiast wściekłości?
$ 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]
Ale to jest oczywiście błędne. Jeśli spróbuję i oceniam, zamiast po prostu wpisać, sprawdź, czy coś nie działa poprawnie:
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
Co daje?
+1 dla tytułu – Mysticial