[1 of 1] Compiling Main ( /in/foo.hs, /tmp/Main.o )
/in/foo.hs:2:8: error:
* Ambiguous type variable `t0' arising from a use of `readLn'
prevents the constraint `(Read (t0 String))' from being solved.
Probable fix: use a type annotation to specify what `t0' should be.
These potential instances exist:
instance (Read a, Read b) => Read (Either a b)
-- Defined in `Data.Either'
instance Read a => Read (Maybe a) -- Defined in `GHC.Read'
instance (Read a, Read b) => Read (a, b) -- Defined in `GHC.Read'
...plus 14 others
...plus 18 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
* In a stmt of a 'do' block: t <- readLn
In the expression:
do { t <- readLn;
putStrLn $ sum t }
In an equation for `main':
main
= do { t <- readLn;
putStrLn $ sum t }
/in/foo.hs:3:16: error:
* No instance for (Num String) arising from a use of `sum'
* In the second argument of `($)', namely `sum t'
In a stmt of a 'do' block: putStrLn $ sum t
In the expression:
do { t <- readLn;
putStrLn $ sum t }