我想读取一个String和toUpper所有的字符.
import Data.Char
main = do
a <- getLine
b <- getLine
map toUpper a
if (a == b)
then print 0
else if (a < b)
then print (-1)
else print 1
Run Code Online (Sandbox Code Playgroud)
然后我得到了这个
Couldn't match expected type `IO a0' with actual type `[b0]'
In the return type of a call of `map'
In a stmt of a 'do' expression: map toUpper a
In the expression:
do { a <- getLine;
b <- getLine;
map toUpper a;
if (a == …Run Code Online (Sandbox Code Playgroud)