1
putStrLn "Enter the Artist Name"
art <- getLine
putStrLn "Enter the Number of CD's"
num <- getLine
let test= buyItem currentStockBase art num
printListIO (showcurrentList test)
我必須通過對buyItem值是哈斯克爾輸入和值傳遞給函數
buyItem currentStockBase "Akon" 20
,但我想「阿肯」發送到藝術和20我想送NUM
它給了我這個錯誤
ERROR file:.\Project2.hs:126 - Type error in application
*** Expression : buyItem currentStockBase art num
*** Term : num
*** Type : [Char]
*** Does not match : Int
請幫我
幫你一個忙,看看http://book.realworldhaskell.org/和http://learnyouahaskell.com/。我敢打賭,它不會像在這裏一直陷入困境並等待答案那樣令人沮喪。 – stefaanv 2010-03-18 11:58:51