我有一个putStrLn,它在下一行看到一个函数,因此无法正确编译。
if director == "" then
putStrLn "Please enter a directors name"
startFunctional 5 userName database --This line is seen as an argument for the putStrLn
else do
*etc*
我尝试使用括号来隔离字符串,但这会引发相同的错误。
错误讯息:
The function `putStrLn' is applied to five arguments, but its type `String -> IO ()' has only one
答案 0 :(得分:6)
您是否可能错过do
阻止?
if director == ""
then do
putStrLn "Please enter a directors name"
startFunctional 5 userName database
else do
*etc*
另外,请尝试调整then
块的else
和if
个关键字。