将输入作为字符串并使用do-notation打印10次?
print10Times :: String -> IO () print10Times name = putStrLn $ repeat 10 name main :: IO () main = do putStrLn "What is your name?" name <- getLine print10Times name
string monads haskell
haskell ×1
monads ×1
string ×1