0
我有一個問題,這個代碼不工作,我不知道爲什麼:如何在haskell中做出簡單的選擇?
foo :: [String] -> IO [String]
foo input = do
choice <- getLine
if choice == "1" then do
putStrLn "good choice"
return input
else
return []
你是什麼意思「此代碼不工作」..任何編譯器錯誤?運行時錯誤? – Ankur 2011-06-08 10:47:28