
22 Aug
2011
22 Aug
'11
11:26 p.m.
Can somebody explain the following situation? $ ghci GHCi, version 7.0.3: 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> :type map show map show :: Show a => [a] -> [String] Prelude> map show [1,2,3] ["1","2","3"] Prelude> let f = map show Prelude> :type f f :: [()] -> [String] Prelude> f [1,2,3] <interactive>:1:8: No instance for (Num ()) arising from the literal `3' Possible fix: add an instance declaration for (Num ()) In the expression: 3 In the first argument of `f', namely `[1, 2, 3]' In the expression: f [1, 2, 3]